Skip to contentSkip to conversation

kernel-fitimage: Allow DTB file relocation at boot time

PATCH Superseded Mihai Serban 2 participants 3 messages Jun 15, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-fitimage: Allow DTB file relocation at boot time

Use UBOOT_DTB_LOADADDRESS and UBOOT_DTB_ENTRYPOINT variables to instruct U-Boot where to place the selected DTB file when booting the system. Without these settings U-Boot uses the relative offset where DTB resides inside the loading address of the FIT image.

---
 meta/classes/kernel-fitimage.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/classes/kernel-fitimage.bbclass +11 -0
index 50a91e199069..981d11f19f8d 100644
@@ -134,6 +134,15 @@ EOF
 fitimage_emit_section_dtb() {
 
 	dtb_csum="sha1"
+	dtb_loadline=""
+	dtb_entryline=""
+
+	if [ -n "${UBOOT_DTB_LOADADDRESS}" ]; then
+		dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;"
+	fi
+	if [ -n "${UBOOT_DTB_ENTRYPOINT}" ]; then
+		dtb_entryline="entry = <${UBOOT_DTB_ENTRYPOINT}>;"
+	fi
 
 	cat << EOF >> ${1}
                 fdt@${2} {
@@ -142,6 +151,8 @@ fitimage_emit_section_dtb() {
                         type = "flat_dt";
                         arch = "${UBOOT_ARCH}";
                         compression = "none";
+                        ${dtb_loadline}
+                        ${dtb_entryline}
                         hash@1 {
                                 algo = "${dtb_csum}";
                         };
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · Mihai Serban

Use UBOOT_DTB_LOADADDRESS and UBOOT_DTB_ENTRYPOINT variables to instruct U-Boot where to place the selected DTB file when booting the system. Without these settings U-Boot uses the relative offset where DTB resides inside the loading address of the FIT image.

I've a similar patch I've been sitting on for a while, which also deals with the case where you want DTB overlays, but I don't have the entry line - what's the use for that in a DTB inside a FIT image?

I'll get what I've got posted up.

Quoted 41 lines
---
 meta/classes/kernel-fitimage.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/classes/kernel-fitimage.bbclass +11 -1
index 50a91e199069..981d11f19f8d 100644
@@ -134,6 +134,15 @@ EOF
 fitimage_emit_section_dtb() {
 
        dtb_csum="sha1"
+       dtb_loadline=""
+       dtb_entryline=""
+
+       if [ -n "${UBOOT_DTB_LOADADDRESS}" ]; then
+               dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;"
+       fi
+       if [ -n "${UBOOT_DTB_ENTRYPOINT}" ]; then
+               dtb_entryline="entry = <${UBOOT_DTB_ENTRYPOINT}>;"
+       fi
 
        cat << EOF >> ${1}
                 fdt@${2} {
@@ -142,6 +151,8 @@ fitimage_emit_section_dtb() {
                         type = "flat_dt";
                         arch = "${UBOOT_ARCH}";
                         compression = "none";
+                        ${dtb_loadline}
+                        ${dtb_entryline}
                         hash@1 {
                                 algo = "${dtb_csum}";
                         };
--

2.17.1

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

Signature · 1 line
Alex Kiernan
#2 lore raw
Quoted 8 lines · Alex Kiernan
Quoted 6 lines · Mihai Serban

Use UBOOT_DTB_LOADADDRESS and UBOOT_DTB_ENTRYPOINT variables to instruct U-Boot where to place the selected DTB file when booting the system. Without these settings U-Boot uses the relative offset where DTB resides inside the loading address of the FIT image.

Quoted 5 lines
Quoted 1 line

I've a similar patch I've been sitting on for a while, which also deals with the case where you want DTB overlays, but I don't have the entry line - what's the use for that in a DTB inside a FIT image?

Thanks for pointing this out. Entry is not used for DTB, I'll send v2.

Quoted 49 lines

I'll get what I've got posted up.

Quoted 36 lines
---
 meta/classes/kernel-fitimage.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/classes/kernel-fitimage.bbclass +11 -1
index 50a91e199069..981d11f19f8d 100644
@@ -134,6 +134,15 @@ EOF
 fitimage_emit_section_dtb() {
 
        dtb_csum="sha1"
+       dtb_loadline=""
+       dtb_entryline=""
+
+       if [ -n "${UBOOT_DTB_LOADADDRESS}" ]; then
+               dtb_loadline="load = <${UBOOT_DTB_LOADADDRESS}>;"
+       fi
+       if [ -n "${UBOOT_DTB_ENTRYPOINT}" ]; then
+               dtb_entryline="entry = <${UBOOT_DTB_ENTRYPOINT}>;"
+       fi
 
        cat << EOF >> ${1}
                 fdt@${2} {
@@ -142,6 +151,8 @@ fitimage_emit_section_dtb() {
                         type = "flat_dt";
                         arch = "${UBOOT_ARCH}";
                         compression = "none";
+                        ${dtb_loadline}
+                        ${dtb_entryline}
                         hash@1 {
                                 algo = "${dtb_csum}";
                         };
--

2.17.1

Quoted 5 lines

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

--
Alex Kiernan