Currently, uboot-sign.bbclass only supports to create Image Tree Source(ITS)
for "u-boot" and "flat_dt". However, users may want to support their private
images for specific application and purpose.

To make this bbclass more flexible and support users specific ITS, creates new
"uboot_fitimage_user_image" function. It is an empty function, so users can
create a bbappend to overwrite this function with their specific settings.

Otherwise, users need to overwrite the "uboot_fitimage_assemble" function.

Add a variable "UBOOT_FIT_USER_IMAGE" to enable users specific ITS generation
and it is disable by default.

Add a variable "UBOOT_FIT_CONF_USER_LOADABLES" to load users specific images
and it is an empty by default.

Signed-off-by: Jamin Lin <jamin_...@aspeedtech.com>
---
 meta/classes-recipe/uboot-sign.bbclass | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/meta/classes-recipe/uboot-sign.bbclass 
b/meta/classes-recipe/uboot-sign.bbclass
index f1b3470127..3b61f239e3 100644
--- a/meta/classes-recipe/uboot-sign.bbclass
+++ b/meta/classes-recipe/uboot-sign.bbclass
@@ -100,6 +100,13 @@ UBOOT_FIT_ARM_TRUSTED_FIRMWARE_IMAGE ?= "bl31.bin"
 UBOOT_FIT_TEE ?= "0"
 UBOOT_FIT_TEE_IMAGE ?= "tee-raw.bin"
 
+# User specific image
+UBOOT_FIT_USER_IMAGE ?= "0"
+
+# 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 ?= ''
+
 UBOOT_FIT_UBOOT_LOADADDRESS ?= "${UBOOT_LOADADDRESS}"
 UBOOT_FIT_UBOOT_ENTRYPOINT ?= "${UBOOT_ENTRYPOINT}"
 
@@ -246,6 +253,12 @@ do_uboot_generate_rsa_keys() {
 
 addtask uboot_generate_rsa_keys before do_uboot_assemble_fitimage after 
do_compile
 
+# Create a ITS file for the user specific image. It is an empty function and
+# users should create a bbappend to overwrite this function
+uboot_fitimage_user_image() {
+       bbwarn "Please add your specific image ITS settings for u-boot FIT 
image generation."
+}
+
 # Create a ITS file for the atf
 uboot_fitimage_atf() {
        cat << EOF >> ${UBOOT_ITS}
@@ -366,6 +379,13 @@ EOF
                conf_loadables="\"atf\", ${conf_loadables}"
                uboot_fitimage_atf
        fi
+
+       if [ "${UBOOT_FIT_USER_IMAGE}" = "1" ] ; then
+               if [ -n "${UBOOT_FIT_CONF_USER_LOADABLES}" ] ; then
+                       
conf_loadables="${conf_loadables}${UBOOT_FIT_CONF_USER_LOADABLES}"
+               fi
+               uboot_fitimage_user_image
+       fi
        cat << EOF >> ${UBOOT_ITS}
     };
 
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207205): 
https://lists.openembedded.org/g/openembedded-core/message/207205
Mute This Topic: https://lists.openembedded.org/mt/109640120/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to