diff mbox series

[meta-rockchip] rk3288: use u-boot.itb as bootloader image

Message ID 20251102132931.228967-1-mustela@erminea.space
State New
Headers show
Series [meta-rockchip] rk3288: use u-boot.itb as bootloader image | expand

Commit Message

Peter Shkenev Nov. 2, 2025, 1:29 p.m. UTC
Currently, u-boot.bin is used for supported rk3288-based boards. But, as
U-Boot for those boards gets built without OP-TEE, u-boot.bin is a raw
image, and, since raw images support for those boards is disabled as
well, u-boot will fail to boot.

Fix this by using u-boot.itb for supported rk3288 boards, which is a FIT
image.

Signed-off-by: Peter Shkenev <mustela@erminea.space>
---
 conf/machine/include/rk3288.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Quentin Schulz Nov. 3, 2025, 1:31 p.m. UTC | #1
Hi Peter,

On 11/2/25 2:29 PM, Peter Shkenev via lists.yoctoproject.org wrote:
> [You don't often get email from mustela=erminea.space@lists.yoctoproject.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Currently, u-boot.bin is used for supported rk3288-based boards. But, as
> U-Boot for those boards gets built without OP-TEE, u-boot.bin is a raw
> image, and, since raw images support for those boards is disabled as
> well, u-boot will fail to boot.
> 
> Fix this by using u-boot.itb for supported rk3288 boards, which is a FIT
> image.
> 

rock2_defconfig used for the rock2-square machine doesn't build (nor 
supports booting U-Boot proper from) a FIT image. Same can be said for 
the Amarula Vyasa RK3288, so this would break the build for them.

Please build U-Boot for all RK3288 to see if it works (I didn't, but 
reading their defconfig was enough to know this will be an issue).

This change *could* be fine if it was accompanied by the necessary 
changes for the boards that cannot boot the .itb image to change their 
UBOOT_SUFFIX as well, to .img as thats what we build now (c.f. 
u-boot-img node instead of fit in arch/arm/dts/rockchip-u-boot.dtsi, and 
tools/binman/entries.rst).

You can also add a comment stating this needs to be itb if 
SPL_OPTEE_IMAGE and SPL_FIT are set in the .config, otherwise img.

On a side note, I think it should be possible to migrate away from 
classes/rockchip-gpt-img.bbclass to wks/wic and upstream U-Boot. Not 
something you need to do though.

Cheers,
Quentin
Peter Shkenev Nov. 4, 2025, 12:55 p.m. UTC | #2
Hello,

Thank you for the review!

On Mon Nov 3, 2025 at 4:31 PM MSK, Quentin Schulz via lists.yoctoproject.org wrote:
> rock2_defconfig used for the rock2-square machine doesn't build (nor 
> supports booting U-Boot proper from) a FIT image. Same can be said for 
> the Amarula Vyasa RK3288, so this would break the build for them.
>
> Please build U-Boot for all RK3288 to see if it works (I didn't, but 
> reading their defconfig was enough to know this will be an issue).
>
> This change *could* be fine if it was accompanied by the necessary 
> changes for the boards that cannot boot the .itb image to change their 
> UBOOT_SUFFIX as well, to .img as thats what we build now (c.f. 
> u-boot-img node instead of fit in arch/arm/dts/rockchip-u-boot.dtsi, and 
> tools/binman/entries.rst).

I have checked. Turns out defconfigs for all boards supported by
meta-rockchip do not build .itb, but they build .img and .bin. So I
guess I should have set UBOOT_SUFFIX to img by default and set it to bin
for rock2-square and vyasa.

> You can also add a comment stating this needs to be itb if 
> SPL_OPTEE_IMAGE and SPL_FIT are set in the .config, otherwise img.

Will do.

> On a side note, I think it should be possible to migrate away from 
> classes/rockchip-gpt-img.bbclass to wks/wic and upstream U-Boot. Not 
> something you need to do though.

Can we discuss that (either here, or in private, or on IRC)?

> Cheers,
> Quentin
>

---
Best regards,
Peter
Quentin Schulz Nov. 4, 2025, 1:24 p.m. UTC | #3
Hi Peter,

On 11/4/25 1:55 PM, Peter Shkenev via lists.yoctoproject.org wrote:
> [You don't often get email from mustela=erminea.space@lists.yoctoproject.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hello,
> 
> Thank you for the review!
> 
> On Mon Nov 3, 2025 at 4:31 PM MSK, Quentin Schulz via lists.yoctoproject.org wrote:
>> rock2_defconfig used for the rock2-square machine doesn't build (nor
>> supports booting U-Boot proper from) a FIT image. Same can be said for
>> the Amarula Vyasa RK3288, so this would break the build for them.
>>
>> Please build U-Boot for all RK3288 to see if it works (I didn't, but
>> reading their defconfig was enough to know this will be an issue).
>>
>> This change *could* be fine if it was accompanied by the necessary
>> changes for the boards that cannot boot the .itb image to change their
>> UBOOT_SUFFIX as well, to .img as thats what we build now (c.f.
>> u-boot-img node instead of fit in arch/arm/dts/rockchip-u-boot.dtsi, and
>> tools/binman/entries.rst).
> 
> I have checked. Turns out defconfigs for all boards supported by
> meta-rockchip do not build .itb, but they build .img and .bin. So I

Indeed, I misread ROCKCHIP_RK322x as supporting RK3288 where 
SPL_OPTEE_IMAGE is selected whenever SPL_FIT is selected (which is 
selected when SPL_FIT_SIGNATURE is set, which is the case for firefly 
rk3288 and tinker boards).

> guess I should have set UBOOT_SUFFIX to img by default and set it to bin
> for rock2-square and vyasa.
> 

Please use .img everywhere. rock2-square and vyasa generate the .img as 
well. If they cannot use it, we need to fix their defconfig or 
arch/arm/dts/rockchip-u-boot.dtsi so that the generated image can 
actually be used.

>> You can also add a comment stating this needs to be itb if
>> SPL_OPTEE_IMAGE and SPL_FIT are set in the .config, otherwise img.
> 
> Will do.
> 
>> On a side note, I think it should be possible to migrate away from
>> classes/rockchip-gpt-img.bbclass to wks/wic and upstream U-Boot. Not
>> something you need to do though.
> 
> Can we discuss that (either here, or in private, or on IRC)?
> 

OK so I looked a bit more into it. Seems like only the Rock2 square is 
not supported by wic, c.f. commits 
6732e8b981e24ec82a853a1fd3965877a75a694b and 
5e963499996d8c7735f6ed012af6f0b05f1e6c29. I checked upstream and it's 
still not using TPL, though I don't think it should matter anymore since 
we migrated to binman, which will generate an idbloader.img even if 
there's only SPL and no TPL. It warrants making sure the whole thing 
still works as expected and neither of us own this board so I would 
rather not spend time on this.

Cheers,
Quentin
diff mbox series

Patch

diff --git a/conf/machine/include/rk3288.inc b/conf/machine/include/rk3288.inc
index a648b44..a1e5d06 100644
--- a/conf/machine/include/rk3288.inc
+++ b/conf/machine/include/rk3288.inc
@@ -13,6 +13,6 @@  SERIAL_CONSOLES = "115200;ttyS2"
 KBUILD_DEFCONFIG ?= "multi_v7_defconfig"
 KERNEL_FEATURES:append:rk3288 = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
 
-UBOOT_SUFFIX ?= "bin"
+UBOOT_SUFFIX ?= "itb"
 
 ENABLE_STATELESS_VPU_GST ?= "1"