From: Jamin Lin <jamin_lin@aspeedtech.com>
To: <openembedded-core@lists.openembedded.org>
Cc: <troy_lee@aspeedtech.com>, <jamin_lin@aspeedtech.com>,
<vince_chang@aspeedtech.com>
Subject: [PATCH v2 2/2] uboot-sign: Add support for setting firmware property in FIT configuration
Date: Tue, 20 May 2025 18:01:28 +0800 [thread overview]
Message-ID: <20250520100128.4019721-3-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20250520100128.4019721-1-jamin_lin@aspeedtech.com>
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.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
meta/classes-recipe/uboot-sign.bbclass | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass
index dcf94b7179..283b68759d 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"
# User specific settings
UBOOT_FIT_USER_SETTINGS ?= ""
+# Sets the firmware property to select the image to boot first.
+# If not set, the first entry in "loadables" is used instead.
+UBOOT_FIT_CONF_FIRMWARE ?= ""
+
# Unit name containing a list of users additional binaries to be loaded.
# It is a comma-separated list of strings.
UBOOT_FIT_CONF_USER_LOADABLES ?= ''
@@ -361,6 +365,7 @@ EOF
# we want to sign it so that the SPL can verify it
uboot_fitimage_assemble() {
conf_loadables="\"uboot\""
+ conf_firmware=""
rm -f ${UBOOT_ITS} ${UBOOT_FITIMAGE_BINARY}
# First we create the ITS script
@@ -432,6 +437,10 @@ EOF
conf_loadables="${conf_loadables}${UBOOT_FIT_CONF_USER_LOADABLES}"
fi
+ if [ -n "${UBOOT_FIT_CONF_FIRMWARE}" ] ; then
+ conf_firmware="firmware = \"${UBOOT_FIT_CONF_FIRMWARE}\";"
+ fi
+
cat << EOF >> ${UBOOT_ITS}
};
@@ -439,6 +448,7 @@ EOF
default = "conf";
conf {
description = "Boot with signed U-Boot FIT";
+ ${conf_firmware}
loadables = ${conf_loadables};
fdt = "fdt";
};
--
2.43.0
prev parent reply other threads:[~2025-05-20 10:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 10:01 [PATCH v2 0/2] Add support for setting firmware property in FIT configuration Jamin Lin
2025-05-20 10:01 ` [PATCH v2 1/2] uboot-sign: Fix unintended "-e" written into ITS Jamin Lin
2025-05-20 10:01 ` Jamin Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250520100128.4019721-3-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=troy_lee@aspeedtech.com \
--cc=vince_chang@aspeedtech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox