diff mbox series

uboot-sign: allow customizing the FIT configuration description

Message ID 20260622180909.43993-1-ricardo.salveti@oss.qualcomm.com
State New
Headers show
Series uboot-sign: allow customizing the FIT configuration description | expand

Commit Message

Ricardo Salveti June 22, 2026, 6:09 p.m. UTC
The U-Boot fitImage configuration node description was hardcoded to
"Boot with signed U-Boot FIT". Some targets need a board/hardware
specific configuration description so the correct configuration can be
identified when the SPL loads the U-Boot FIT (SPL -> u-boot.itb).

When CONFIG_SPL_LOAD_FIT is enabled, the SPL selects a U-Boot FIT
configuration via fit_find_config_node(), which matches each
configuration node's "description" property against the board's
board_fit_config_name_match() hook. Boards that override this hook
(e.g. CZ.NIC Turris MOX matching "armada-3720-turris-mox", Engicam
i.CoreM6 matching "imx6q-icore", StarFive VisionFive2 and Siemens
IOT2050) require the description to be a specific board/DT-derived
string. The previously hardcoded "Boot with signed U-Boot FIT" can
never match such a hook; it only works by falling through to the
default configuration and breaks when the right configuration must be
selected by name.

Introduce UBOOT_FIT_CONF_DESC to make the configuration node
description overridable, mirroring the existing UBOOT_FIT_DESC variable
used for the root node description. The default value preserves the
previous behaviour, so existing layers are unaffected.

Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
---
 meta/classes-recipe/uboot-sign.bbclass   | 5 ++++-
 meta/lib/oeqa/selftest/cases/fitimage.py | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass
index 2b10e71730..78d85aaa9c 100644
--- a/meta/classes-recipe/uboot-sign.bbclass
+++ b/meta/classes-recipe/uboot-sign.bbclass
@@ -103,6 +103,9 @@  UBOOT_FIT_TEE_IMAGE ?= "tee-raw.bin"
 # User specific settings
 UBOOT_FIT_USER_SETTINGS ?= ""
 
+# U-Boot fitImage configuration description
+UBOOT_FIT_CONF_DESC ?= "Boot with signed U-Boot FIT"
+
 # 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 ?= ""
@@ -452,7 +455,7 @@  EOF
     configurations {
         default = "conf";
         conf {
-            description = "Boot with signed U-Boot FIT";
+            description = "${UBOOT_FIT_CONF_DESC}";
             ${conf_firmware}
             loadables = ${conf_loadables};
             fdt = "fdt";
diff --git a/meta/lib/oeqa/selftest/cases/fitimage.py b/meta/lib/oeqa/selftest/cases/fitimage.py
index 34b248ee0b..9858d8a4d5 100644
--- a/meta/lib/oeqa/selftest/cases/fitimage.py
+++ b/meta/lib/oeqa/selftest/cases/fitimage.py
@@ -1335,6 +1335,7 @@  class UBootFitImageTests(FitImageTestCase):
             'UBOOT_FIT_ARM_TRUSTED_FIRMWARE_ENTRYPOINT',
             'UBOOT_FIT_ARM_TRUSTED_FIRMWARE_LOADADDRESS',
             'UBOOT_FIT_ARM_TRUSTED_FIRMWARE',
+            'UBOOT_FIT_CONF_DESC',
             'UBOOT_FIT_CONF_USER_LOADABLES',
             'UBOOT_FIT_DESC',
             'UBOOT_FIT_HASH_ALG',
@@ -1432,7 +1433,7 @@  class UBootFitImageTests(FitImageTestCase):
             loadables.insert(0, "atf")
         its_field_check += [
             'default = "conf";',
-            'description = "Boot with signed U-Boot FIT";',
+            'description = "%s";' % bb_vars['UBOOT_FIT_CONF_DESC'],
             'loadables = "%s";' % '", "'.join(loadables),
             'fdt = "fdt";',
         ]
@@ -1590,6 +1591,9 @@  class UBootFitImageTests(FitImageTestCase):
                      Image Tree Source. Not all the fields are tested,
                      only the key fields that wont vary between
                      different architectures.
+                     3. The custom root node (UBOOT_FIT_DESC) and
+                     configuration node (UBOOT_FIT_CONF_DESC) descriptions
+                     are honoured in the Image Tree Source.
         Product:     oe-core
         Author:      Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
                      based on work by Usama Arif <usama.arif@arm.com>
@@ -1607,6 +1611,7 @@  UBOOT_FITIMAGE_ENABLE = "1"
 UBOOT_LOADADDRESS = "0x80080000"
 UBOOT_ENTRYPOINT = "0x80080000"
 UBOOT_FIT_DESC = "A model description"
+UBOOT_FIT_CONF_DESC = "Boot board XYZ config"
 """
         self.write_config(config)
         bb_vars = self._fit_get_bb_vars()