Amlogic 4.9 kernel on Radxa Zero


I needed some amlogic features (h.264/h.265 encoding) on my Radxa Zero (512 & 1GB versions) that are not present in Debian version (I could boot only buster).

I have downloaded amlogic kernel 4.9 that has these features. Copied my .config and successfully compiled the kernel after endless hours fixing the bugs.

I could do make -j8 and I could even build debian packages (kernel image and headers)

I am unable to boot into the new kernel.

1st error FDT image overlays OS image when I try to modify uEnv.txt.
I tried editing extlinux.conf (make install fails on extlinux.conf) but it wont boot.
I copied dtb file from the previous kernel version (5.10).

Could someone point me to the process after successfully completing the kernel compile to booting from kernel, instead of me reinventing the wheel?

Thanks in advance.

Anil Chandra K

You have to compile the dtb against the the same headers as the kernel you’re running. Even then, it might not compile cleanly if there were changes in the bindings. Check OpenELEC. I think they’ve got a Radxa Zero build with the 4.9 amlogic kernel. You could try their dts with your kernel tree and see if it compiles.

I did “make dtbs”
got some dts files in “arch/arm64/boot/dts/amlogic”
Relevant files are g12a_s905y2_u220.dts & g12a_s905y2_u221.dts
Did not know which one is relevant.
so prepared dtb files for both.
cpp -nostdinc -I /root/linux-amlogic/include/ -undef -x assembler-with-cpp g12a_s905y2_u220.dts > g12a_s905y2_u220_tmp.dts
cpp -nostdinc -I /root/linux-amlogic/include/ -undef -x assembler-with-cpp g12a_s905y2_u221.dts > g12a_s905y2_u221_tmp.dts
dtc -O dtb -b 0 -o g12a_s905y2_u220.dtb g12a_s905y2_u220_tmp.dts
dtc -O dtb -b 0 -o g12a_s905y2_u221.dtb g12a_s905y2_u221_tmp.dts

Placed dtb files in /boot/dtbs/4.9.113/amlogic (bootloader was looking in this directory).
Setup uEnv.txt to look for g12a_s905y2_u220.dtb (& later g12a_s905y2_u221.dtb)

all files loaded by bootloader. Got another error.

Cannot setup simplefb: node not found

What next?

Thanks in advance.

You would need CoreELEC for that. OpenELEC is dead since 2016 and LibreELEC (which replaced it, and CoreELEC is forked from) uses only the upstream kernel. If/when you eventually get the 4.9 kernel working you’ll discover Amlogic’s encoders aren’t great and CPU encoding will give better results; albeit with some CPU/thermal cost that your board implementation needs to handle.

Do you have CONFIG_FB_SIMPLE enabled in kernel config?