Add SpacemiT K3 Vendor BSP#636
Conversation
8287ba3 to
bcc32c9
Compare
|
how is this related to #635 ? Can you consolidate both PRs, I do not want multiple PRs addressing same patches. |
This is my effort to break down what's in #635 into more reviewable chunks and clean it up - I had started yesterday but hadn't sent a PR yet before that one went up. I will discuss with the submitter and we'll get it down to one or the other soon. |
bcc32c9 to
4baa2b2
Compare
|
Latest push builds OK, but has some warnings and a lot of unnecessary stuff. Still need to do a sweep of licensing info, fix attribution (waiting for SpacemiT feedback), and summarize all of the differences. My K3 was scheduled to arrive today, but it isn't here. Will start testing as soon as it arrives. |
4baa2b2 to
ba7e56b
Compare
|
Pushed some more cleanups to break the branch down to a basic image for SD card flashing only. From here on out I will start cleanups like what Alistair Francis (@alistair23) has suggested. |
ba7e56b to
80e4d14
Compare
|
Getting there. Still some problems I'm tweaking in the U-Boot recipe, plus the outstanding review comments. Aiming to have something functional for the Monday or Tuesday timeframe. Thanks for the feedback so far! |
80e4d14 to
c0456cd
Compare
|
With my latest push, U-Boot is also building OK - I reworked it after reviewing what the vendor BSP for the OrangePi boards was doing. Still have a few outstanding review comments to address, followed by device testing when it's here. |
|
I'm able to tftpboot my kernel + dtb OK on a K3 Pico-ITX, using the existing rootfs: Note the |
c0456cd to
88de1ac
Compare
|
Booting with initramfs: |
314645a to
4a15075
Compare
|
Latest updates (also in top-level summary):
|
4a15075 to
c1a7e8b
Compare
|
Correction: Got NVMe secondary boot working. See the summary/overview details for log output including how to do it. I think this should be documented, so I'll write a commit. |
47c67ef to
a33f0ea
Compare
38224e0 to
fa777da
Compare
49731c6 to
5cb8ae1
Compare
5cb8ae1 to
55d4647
Compare
|
Think I may have introduced a regression with the latest change - getting a kernel panic on boot after cleaning my build directory. Doing some debug... |
0447638 to
15bd6f9
Compare
After updating the |
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Create a recipe for pulling in the esos.itb file from SpacemiT's repositories, which is loaded by K3 platforms following the FSBL. The binaries are under a simple copyright in the spacemit-firmware repository rather than an open-source license, so mark the recipe license as 'CLOSED' with a note about why. Tested: - bitbake esos-k3: builds successfully - esos.itb deployed and embedded in wic image esos partition - core-image-minimal builds successfully with new recipe Tested-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Backport a patch from upstream to ensure that the build works for newer GCC versions (e.g. Fedora 44 has 16.1), which is not yet in 6.18: |tgamblin@megalith ~/workspace/git/linux (master)$ git tag --contains 905c559e51497 |v7.1-rc4 |v7.1-rc5 Without it, we see errors like: | In file included from /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/randomize_layout_plugin.c:19: | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h: In function 'void debug_tree(const_tree)': | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h:417:20: error: 'CONST_CAST_TREE' was not declared in this scope; did you mean 'CONST_CAST_EXPR'? | 417 | debug_tree(CONST_CAST_TREE(t)); | | ^~~~~~~~~~~~~~~ | | CONST_CAST_EXPR | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h: In function 'void debug_gimple_stmt(const_gimple_ptr)': | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h:312:47: error: expected primary-expression before ',' token | 312 | #define CONST_CAST_GIMPLE(X) CONST_CAST(gimple, (X)) | | ^ | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h:422:27: note: in expansion of macro 'CONST_CAST_GIMPLE' | 422 | debug_gimple_stmt(CONST_CAST_GIMPLE(s)); | | ^~~~~~~~~~~~~~~~~ | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h:312:30: error: 'CONST_CAST' was not declared in this scope; did you mean 'CONST_INT'? | 312 | #define CONST_CAST_GIMPLE(X) CONST_CAST(gimple, (X)) | | ^~~~~~~~~~ | /home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/gcc-common.h:422:27: note: in expansion of macro 'CONST_CAST_GIMPLE' | 422 | debug_gimple_stmt(CONST_CAST_GIMPLE(s)); | | ^~~~~~~~~~~~~~~~~ | make[3]: *** [/home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/gcc-plugins/Makefile:54: scripts/gcc-plugins/randomize_lay out_plugin.so] Error 1 | make[2]: *** [/home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/scripts/Makefile.build:556: scripts/gcc-plugins] Error 2 | make[1]: *** [/home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/Makefile:1263: scripts] Error 2 | make: *** [/home/tgamblin/workspace/yocto/bitbake-builds/meta-riscv-oe-nodistro-master-k3-bsp/build/tmp/work-shared/k3-pico-itx/kernel-source/Makefile:248: __sub-make] Error 2 | ERROR: oe_runmake failed Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Make sure to be explicit about the image contents by naming things with a "-k3" suffix, rather than something more typical like "-generic". Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Co-developed-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Yingjie Liu <yingjie-liu@spacemit.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
15bd6f9 to
6e185cd
Compare
Khem Raj (kraj)
left a comment
There was a problem hiding this comment.
LGTM, thanks for patiently addressing all the review comments Trevor Gamblin (@threexc)
No worries. Thank you all for reviewing this exciting but complex PR! |
Overview
This is an effort on behalf of SpacemiT to add support for their K3 platforms to meta-riscv. It breaks down the changes made in the spacemit-yocto fork of meta-riscv into more discrete and digestible pieces focused on a minimal, headless image, while omitting the parts which aren't strictly required, notably:
mesarecipes and related graphics supportThese features will be investigated after basic support is tested and merged.
I've opened this now so that others can review and propose additional BSP support if they have other K3 boards to test with. I've followed the same format we did for the K1 platforms and created a
k3-vendor.incfile with the common logic included so that adding those other BSPs as we go will require minimal effort.Status
As of EOD on May 29th, 2026, I have confirmed that this works by booting three ways:
tftpboot:.wicimage to my NVMe drive with a USB-to-NVMe adapter andbmaptoolI'll test an NFS root soon. Do you all think that this combination is sufficient proof that the BSP is ready? It would be good to confirm this also with a CoM260 and microSD card, but I'm not sure how soon I'll be able to try that. Is there someone else out there who's expecting a CoM260 board any day now?
Note that most of the commits have been updated to fix attribution - Yingjie Liu is the correct author for almost all of the commits (excepting the
u-boot-spl-k3patch), and I have added myCo-developed-bytag.See also: #635
June 8th, 2026 Update: We have confirmed that NVMe flash and boot works. Here is the console output from Yingjie's testing: