# directories: # - /compile/doc/stable-am - the files in this dir # - /compile/source/linux-stable-am - the kernel sources checked out from gitrepo # - /compile/result/stable-am - the resulting kernel, modules etc. tar.gz files # name: stb-aml # patches: # add picoseconds delay for eth to work properly on some g12a and sm1 boxes patch -p1 < /compile/doc/stable-am/misc.aml/patches/g12a-sm1-eth-picoseconds-delay-fix.patch # some dwmac-meson8b clock fixes patch -p1 < /compile/doc/stable-am/misc.aml/patches/dwmac-meson8b-clk-fix.patch # reduce cma mem for amlogic patch -p1 < /compile/doc/stable-am/misc.aml/patches/reduce-cma-mem-for-amlogic.patch # many s905w tv boxes have very low spec emmc chips so lower the freq for them patch -p1 < /compile/doc/stable-am/misc.aml/patches/lower-emmc-frequency-for-s905w.patch # add some extra but disabled opp entries for g12a, g12b and sm1 patch -p1 < /compile/doc/stable-am/misc.aml/patches/additional-disabled-opp-entires-v5.8.patch # allow higher cpu temps patch -p1 < /compile/doc/stable-am/misc.aml/patches/gxl-higher-temps.patch # enable cpufreq on odroid c2 patch -p1 < /compile/doc/stable-am/misc.aml/patches/enable-cpufreq-on-odroid-c2.patch # add new dtbs to Makefile patch -p1 < /compile/doc/stable-am/misc.aml/patches/add-new-dtbs-to-Makefile-v5.9.patch # copy additional dtb files - maintained: sm1-h96max-x3, g12a-t95q and gxl-s905x-mi-box cp -i /compile/doc/stable-am/misc.aml/dtb/*.dts arch/arm64/boot/dts/amlogic cp /compile/doc/stable-am/config.aml /compile/source/linux-stable-am/.config cd /compile/source/linux-stable-am # git pull export ARCH=arm64 # make defconfig # /compile/doc/stable-am/misc.aml/options/enable-docker-options.sh # /compile/doc/stable-am/misc.aml/options/enable-additional-options.sh make oldconfig make -j 4 Image dtbs modules cd tools/perf make cd ../power/cpupower make cd ../../.. export kver=`make kernelrelease` echo ${kver} # remove debug info if there and wanted # find . -type f -name '*.ko' | sudo xargs -n 1 objcopy --strip-unneeded make modules_install mkdir -p /lib/modules/${kver}/tools cp -v tools/perf/perf /lib/modules/${kver}/tools cp -v tools/power/cpupower/cpupower /lib/modules/${kver}/tools cp -v tools/power/cpupower/libcpupower.so.0.0.1 /lib/modules/${kver}/tools/libcpupower.so.0 # make headers_install INSTALL_HDR_PATH=/usr cp -v .config /boot/config-${kver} # for rpi cp -v arch/arm64/boot/Image /boot/Image-${kver} # in case it is needed somewhere for legacy u-boot mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 -n linux-${kver} -d arch/arm64/boot/Image /boot/uImage-${kver} mkdir /boot/dtb-${kver} cp -v arch/arm64/boot/dts/amlogic/meson-g*.dtb /boot/dtb-${kver} cp -v arch/arm64/boot/dts/amlogic/meson-sm1*.dtb /boot/dtb-${kver} cp -v System.map /boot/System.map-${kver} cd /boot update-initramfs -c -k ${kver} # in case it is needed somewhere for legacy u-boot mkimage -A arm64 -O linux -T ramdisk -a 0x0 -e 0x0 -n initrd.img-${kver} -d initrd.img-${kver} uInitrd-${kver} tar cvzf /compile/source/linux-stable-am/${kver}.tar.gz /boot/*-${kver} /lib/modules/${kver} cp -v /compile/doc/stable-am/config.aml /compile/doc/stable-am/config.aml.old cp -v /compile/source/linux-stable-am/.config /compile/doc/stable-am/config.aml cp -v /compile/source/linux-stable-am/.config /compile/doc/stable-am/config.aml-${kver} cp -v /compile/source/linux-stable-am/*.tar.gz /compile/result/stable-am # well working dtbs: - s905 tv boxes: meson-gxbb-nexbox-a95x.dts - s905x tv boxes: meson-gxl-s905x-p212.dts or meson-gxl-s905x-nexbox-a95x.dts - s905w tv boxes: meson-gxl-s905w-p281.dts - s912 tv boxes: meson-gxm-q201.dts (m8spro) or meson-gxm-vega-s96.dts (x92) # s905w tv box cat /boot/s905_autoscript.txt-5.6.13-stb-aml+ setenv kver 5.6.13-stb-aml+ # hardcode the eth mac addr in uboot as otherwise we will get a new one each time setenv ethaddr 2e:19:c4:a0:b0:6d setenv mac 2e:19:c4:a0:b0:6d setenv bootargs "console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 root=/dev/sda3 rootwait ro fsck.fix=yes fsck.repair=yes net.ifnames=0 ipv6.disable=1 zswap.enabled=0 threadirqs noresume" #fatload usb 0 0x11000000 Image-${kver} fatload usb 0 0x01080000 uImage-${kver} fatload usb 0 0x13000000 uInitrd-${kver} fatload usb 0 ${dtb_mem_addr} dtb-${kver}/meson-aml-s905w-p281.dtb # booti only works out of the box with blb kernels due some patches - otherwise mkimage is required #booti 0x11000000 0x13000000 ${dtb_mem_addr} # as describe at linux-meson.com bootm 0x1080000 0x13000000 $dtb_mem_addr # use: mkimage -A arm64 -T script -O linux -d s905_autoscript.txt s905_autoscript.scr