Instructions for building and booting mainline kernel on cm3

Hi there,

i’ve been trying lots of things to get the mainline kernel to boot on the cm3 io.

No matter what i do it always seems to hang the device right after it did “Starting kernel…” - no keyboard leds, no hdmi, no serial out

This seems to be clearly related to the kernel image itself, as i was using a known good sd card with u-boot and dtbs from the rockchip-bsp.

What are the official instructions on how to build and boot an arm64 mainline kernel? Which config is recommended?

Here you can observe how porting of 3A was made:


This is the closest instructions you will have on the topic. You can use this and diff of 3A / CM3 device tree to generate a working CM3 DT. Official instructions does not exists since Radxa didn’t get there yet and they probably never will. Their primary job is making hardware and keep them operational under stock Rockchip SDK supported by Rockchip. Mainline is chaotic world …

1 Like

@Milp1I haven’t tried booting mainline kernel for CM3 so far. But building kernel should be possible with explicit make.

make ARCH=arm64 CROSS_COMPILE=<cross_compile_prefix> <defconfig> -j<number of CPU cores>
make ARCH=arm64 CROSS_COMPILE=<cross_compile_prefix> -j<number of CPU cores>
make ARCH=arm64 CROSS_COMPILE=<cross_compile_prefix> modules -j<number of CPU cores>
make ARCH=arm64 CROSS_COMPILE=<cross_compile_prefix> modules_install INSTALL_MOD_PATH=</path/to/have/modules> -j<number of CPU cores>

You will have 2 files from

cp arch/arm64/boot/dts/rockchip/<name of the dtb> /path/to/destination/boot
cp arch/arm64/boot/Image /path/to/destination/boot

Kernel and dtb can then be loaded from u-boot hush shell.

1 Like

Don’t waste your time.

There is a “small” problem - there is no support for this hardware whatsoever in the mainline kernel. When it arrives, those rules apply.

1 Like

@igorp

There is a “small” problem - there is no support for this hardware whatsoever in the mainline kernel.

Yeah, am aware of this. I tried mainlining activities, but got swapped. Soon will resume posting the patch in mainline tree.

I don’t see the huge blocker to be honest, if you look at the following site the majority of hardware feature of the rk3566 should be already supported by mainline:

https://wiki.pine64.org/wiki/Quartz64_Development

@parthitce Thank you for the advice, i know how to build a kernel in general. The problem i had was that it would never actually go beyond “Starting kernel…” when trying to boot the image.

I have now however ported the device tree over to mainline and managed to build AND boot kernel 5.17.y

AFAIK Technically there could be 2 reasons for this,

  1. Device tree blob is wrong or console not set. earlyprintk in bootargs can help see this if it’s trying to boot
  2. Wrong architecture

I have now however ported the device tree over to mainline and managed to build AND boot kernel 5.17.y

That’s great.

1 Like

I didn’t say its a huge blocker as Armbian provides images for Quartz, Rock3 A and others on this chip for several months, since end of 2021 IIRC. Features are ported into LTS kernels as they arrive. That mainline table that Pine is drawing makes sense only for those that will builds from raw mainline and hope that things works. With Armbian, all that is possible, works.

For CM3 its a matter of different and more complicated DT. If you want that everything works … which is in mainline support only - almost never.

Has there been any more development to getting mainline booting?