diff options
author | Jamin Lin <jamin_lin@aspeedtech.com> | 2025-05-21 09:21:21 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-05-22 14:36:49 +0100 |
commit | 13d83810b810c316432c09c91d9e306ebfd4fcda (patch) | |
tree | 424a610b5aecc2840029c912494469a3b59bf211 /meta | |
parent | a50b243ea67514aad4b8ebdca63cf088f42e56ca (diff) | |
download | poky-13d83810b810c316432c09c91d9e306ebfd4fcda.tar.gz |
uboot-sign: Add support for setting firmware property in FIT configuration
Add the ability to set the "firmware" property in the FIT configuration node
by introducing the UBOOT_FIT_CONF_FIRMWARE variable.
This property defines the primary image to be executed during boot. If it is
set, its value will be written into the FIT configuration under the "firmware"
field. If not set, the bootloader will fall back to using the first entry in
the "loadables" list.
Using this property improves control over the boot sequence, especially in
multi-binary boot scenarios.
(From OE-Core rev: 82e1d7cbc855dbe4bec93f9b049851cbe376ea5e)
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes-recipe/uboot-sign.bbclass | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass index dcf94b7179..796c040e8b 100644 --- a/meta/classes-recipe/uboot-sign.bbclass +++ b/meta/classes-recipe/uboot-sign.bbclass | |||
@@ -101,6 +101,10 @@ UBOOT_FIT_TEE_IMAGE ?= "tee-raw.bin" | |||
101 | # User specific settings | 101 | # User specific settings |
102 | UBOOT_FIT_USER_SETTINGS ?= "" | 102 | UBOOT_FIT_USER_SETTINGS ?= "" |
103 | 103 | ||
104 | # Sets the firmware property to select the image to boot first. | ||
105 | # If not set, the first entry in "loadables" is used instead. | ||
106 | UBOOT_FIT_CONF_FIRMWARE ?= "" | ||
107 | |||
104 | # Unit name containing a list of users additional binaries to be loaded. | 108 | # Unit name containing a list of users additional binaries to be loaded. |
105 | # It is a comma-separated list of strings. | 109 | # It is a comma-separated list of strings. |
106 | UBOOT_FIT_CONF_USER_LOADABLES ?= '' | 110 | UBOOT_FIT_CONF_USER_LOADABLES ?= '' |
@@ -361,6 +365,7 @@ EOF | |||
361 | # we want to sign it so that the SPL can verify it | 365 | # we want to sign it so that the SPL can verify it |
362 | uboot_fitimage_assemble() { | 366 | uboot_fitimage_assemble() { |
363 | conf_loadables="\"uboot\"" | 367 | conf_loadables="\"uboot\"" |
368 | conf_firmware="" | ||
364 | rm -f ${UBOOT_ITS} ${UBOOT_FITIMAGE_BINARY} | 369 | rm -f ${UBOOT_ITS} ${UBOOT_FITIMAGE_BINARY} |
365 | 370 | ||
366 | # First we create the ITS script | 371 | # First we create the ITS script |
@@ -432,6 +437,10 @@ EOF | |||
432 | conf_loadables="${conf_loadables}${UBOOT_FIT_CONF_USER_LOADABLES}" | 437 | conf_loadables="${conf_loadables}${UBOOT_FIT_CONF_USER_LOADABLES}" |
433 | fi | 438 | fi |
434 | 439 | ||
440 | if [ -n "${UBOOT_FIT_CONF_FIRMWARE}" ] ; then | ||
441 | conf_firmware="firmware = \"${UBOOT_FIT_CONF_FIRMWARE}\";" | ||
442 | fi | ||
443 | |||
435 | cat << EOF >> ${UBOOT_ITS} | 444 | cat << EOF >> ${UBOOT_ITS} |
436 | }; | 445 | }; |
437 | 446 | ||
@@ -439,6 +448,7 @@ EOF | |||
439 | default = "conf"; | 448 | default = "conf"; |
440 | conf { | 449 | conf { |
441 | description = "Boot with signed U-Boot FIT"; | 450 | description = "Boot with signed U-Boot FIT"; |
451 | ${conf_firmware} | ||
442 | loadables = ${conf_loadables}; | 452 | loadables = ${conf_loadables}; |
443 | fdt = "fdt"; | 453 | fdt = "fdt"; |
444 | }; | 454 | }; |