Skip to contentSkip to conversation

kernel-fitimage.bbclass: Allow set/unset load address for FDT

PATCH In review Nikunj Kela 3 participants 3 messages Feb 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel-fitimage.bbclass: Allow set/unset load address for FDT

Allow the load address for the FDT segment in the fitImage. This allows U-Boot to load the FDT at a specific address.

UBOOT_FDT_LOADADDRESS - Specifies the load address used by u-boot
for the FDT

---
 meta/classes/kernel-fitimage.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)
meta/classes/kernel-fitimage.bbclass +6 -0
index 1c3b4b7..7f9da49 100644
@@ -127,6 +127,11 @@ EOF
 fitimage_emit_section_dtb() {
 
 	dtb_csum="sha1"
+	fdt_loadline=""
+
+	if [ -n "${UBOOT_FDT_LOADADDRESS}" ]; then
+		fdt_loadline="load = <${UBOOT_FDT_LOADADDRESS}>;"
+	fi
 
 	cat << EOF >> ${1}
                 fdt@${2} {
@@ -135,6 +140,7 @@ fitimage_emit_section_dtb() {
                         type = "flat_dt";
                         arch = "${UBOOT_ARCH}";
                         compression = "none";
+                        ${fdt_loadline}
                         hash@1 {
                                 algo = "${dtb_csum}";
                         };
Signature · 1 line
2.5.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 45 lines · Nikunj Kela

Allow the load address for the FDT segment in the fitImage. This allows U-Boot to load the FDT at a specific address.

UBOOT_FDT_LOADADDRESS - Specifies the load address used by u-boot
for the FDT

---
 meta/classes/kernel-fitimage.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)
meta/classes/kernel- renamed from meta/classes/kernel-fitimage.bbclass +0 -0

fitimage.bbclass
index 1c3b4b7..7f9da49 100644

meta/classes/kernel-fitimage.bbclass +6 -1
@@ -127,6 +127,11 @@ EOF
 fitimage_emit_section_dtb() {
 
        dtb_csum="sha1"
+       fdt_loadline=""
+
+       if [ -n "${UBOOT_FDT_LOADADDRESS}" ]; then
+               fdt_loadline="load = <${UBOOT_FDT_LOADADDRESS}>;"
+       fi
 
        cat << EOF >> ${1}
                 fdt@${2} {
@@ -135,6 +140,7 @@ fitimage_emit_section_dtb() {
                         type = "flat_dt";
                         arch = "${UBOOT_ARCH}";
                         compression = "none";
+                        ${fdt_loadline}
                         hash@1 {
                                 algo = "${dtb_csum}";
                         };
--

2.5.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core