Options for running CM3 on current upstream kernel?

Hi,

I am considering to base an audio-oriented project on CM3, due to its support for multiple I2S interfaces, compared to RPi CM4.

But the product requires support for USB gadgets in the recent kernels (5.19+). That code has the general part (all the USB gadget functions) and the HW-specific part - DWC3 in this case. I assume the DWC3 code in radxa 5.10 kernel (heavily patched 4.4 android kernel, IIUC) is OK to run on CM3. But there is no code for the general part as that has not been merged to the radxa kernel yet.

Also, when hitting problems (unavoidably, there will always be some), I discuss details with the gadget and DWC3 specialists on usb-linux mailing list, perform tests and submit the resultant patches to the upstream kernel, logically.

Radxa CM3 is not supported by armbian which seems to keep reasonably close the upstream, with a limited number of patches only (their patches on top of reasonable amount of patches in https://github.com/ayufan-rock64/linux-mainline-kernel/ , IIUC) .

Radxa Rock3A is supported in Armbian, with kernel 6.1. IMO the patch difference between Rock3A patches in https://github.com/armbian/build/tree/master/patch/kernel/archive/rockchip64-6.1 and patches for CM3 should be minimal. IMO mostly “just” DTS changes. That makes a very reasonable number of patches against the upstream. Unlike the radxa kernel which does not derive from the upstream kernel at all (“Branch linux-5.10-gen-rkr3.4 is 457612 commits ahead, 6732 commits behind rockchip-linux:develop-4.4.”) - impossible to discuss anything with the upstream developers.

Has anyone done such project, is this path recommendable? IMO keeping just patches for CM3 against the latest armbian build tree should be viable.

Thanks a lot for any suggestions.

Best regards,

Pavel.

ROCK 3A is supported in mainline linux kernel since 5.19. CM3I (Radxa E25) will be supported in 6.3. CM3 and CM3S will be supported in future release.

our new BSP supports mainline linux kernel (currently v6.1.x) for Radxa CM3S and CM3I. we will add support for CM3.

Naoki, thanks a lot for the great news. HW-specific patches over the latest upstream are just what I was hoping for :slight_smile: May I ask about your time estimate of adding CM3 support to your BSP? The CM3 + IO board have already arrived and I would like to start testing with the latest kernel.

IIUC the support should be very similar to the patches for CM3S. I could do it myself but I do not know the exact differences between the SODIMM and CM boards. The wiki says there are very few…

When the support is added to BSP, can I expect the board to be accessible upon booting (ethernet ssh link-local or display + USB keyboard)?

Thanks a lot for the support.

With regards,

Pavel.

If device tree already exists, following this should not be hard. It just has to be done by someone holding hardware in their hands, to do at least basic tests. Minimal requirements for official Armbian support is if at least one person agrees to stick around and look after the device - major kernel upgrades almost always kills some functions and knowing which is already a valuable information.

Igor, thanks a lot for your pointer. You are doing a great job with armbian, hats off (yes I know about the link to subscriptions :slight_smile: )

I do not think there is a device tree applicable to newer kernels for this board published yet, IIUC. After the radxa BSP gets the update (i.e. mostly the device tree files), I could add it to Armbian. But to be honest - if the official BSP (also debian) turns out OK, I will most likely stick with it and do my work first. I will/would try to push the patches (should any result from my work) to upstream kernel if possible, after Radxa/Naoki submit their support upstream.