Skip to contentSkip to conversation

devicetree.bbclass: don't pad DT overlays

PATCH RESEND In review [email protected] 2 participants 2 messages Sep 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 devicetree.bbclass: don't pad DT overlays

From: Luca Ceresoli <[email protected]>

By default the devicetree class adds padding to the generated .dtb files, which can be needed by the bootloader. However it also pads .dtbo files, which is not useful.

Don't apply padding to the overlay devicetrees.

To achieve this:

* move "-p ${DT_PADDING_SIZE}" to a new variable, DTB_BFLAGS (B for "base")
* add "-p 0" to DTC_OFLAGS to disable padding for overlays

---

Resending from a gmail account due to ongoing issues between my provider and lists.openembedded.org.

---
 meta/classes/devicetree.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/devicetree.bbclass +5 -2
index dbc83f2a1d98..8fe5a5ed795c 100644
@@ -55,9 +55,10 @@ DT_RESERVED_MAP ??= "8"
 DT_BOOT_CPU[doc] = "The boot cpu, defaults to 0"
 DT_BOOT_CPU ??= "0"
 
-DTC_FLAGS ?= "-R ${DT_RESERVED_MAP} -p ${DT_PADDING_SIZE} -b ${DT_BOOT_CPU}"
+DTC_FLAGS ?= "-R ${DT_RESERVED_MAP} -b ${DT_BOOT_CPU}"
 DTC_PPFLAGS ?= "-nostdinc -undef -D__DTS__ -x assembler-with-cpp"
-DTC_OFLAGS ?= "-@ -H epapr"
+DTC_BFLAGS ?= "-p ${DT_PADDING_SIZE}"
+DTC_OFLAGS ?= "-p 0 -@ -H epapr"
 
 python () {
     if d.getVar("KERNEL_INCLUDE"):
@@ -106,6 +107,8 @@ def devicetree_compile(dtspath, includes, d):
     dtcargs = ["dtc"] + (d.getVar("DTC_FLAGS") or "").split()
     if isoverlay:
         dtcargs += (d.getVar("DTC_OFLAGS") or "").split()
+    else:
+        dtcargs += (d.getVar("DTC_BFLAGS") or "").split()
     for i in includes:
         dtcargs += ["-i", i]
     dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")]
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Tue, 11 Sep 2018 at 21:14, <[email protected]> wrote:

From: Luca Ceresoli <[email protected]>

By default the devicetree class adds padding to the generated .dtb files, which can be needed by the bootloader. However it also pads .dtbo files, which is not useful.

Don't apply padding to the overlay devicetrees.

Quoted 8 lines

To achieve this:

* move "-p ${DT_PADDING_SIZE}" to a new variable, DTB_BFLAGS (B for "base")
* add "-p 0" to DTC_OFLAGS to disable padding for overlays

You shouldn't put "[meta-oe]" in the subject for oe-core/meta patches. But otherwise the change looks good.

Regards,
Nathan

Quoted 38 lines

---

Resending from a gmail account due to ongoing issues between my provider and lists.openembedded.org.

---
 meta/classes/devicetree.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/classes/devicetree.bbclass +5 -3
index dbc83f2a1d98..8fe5a5ed795c 100644
@@ -55,9 +55,10 @@ DT_RESERVED_MAP ??= "8"
 DT_BOOT_CPU[doc] = "The boot cpu, defaults to 0"
 DT_BOOT_CPU ??= "0"
 
-DTC_FLAGS ?= "-R ${DT_RESERVED_MAP} -p ${DT_PADDING_SIZE} -b ${DT_BOOT_CPU}"
+DTC_FLAGS ?= "-R ${DT_RESERVED_MAP} -b ${DT_BOOT_CPU}"
 DTC_PPFLAGS ?= "-nostdinc -undef -D__DTS__ -x assembler-with-cpp"
-DTC_OFLAGS ?= "-@ -H epapr"
+DTC_BFLAGS ?= "-p ${DT_PADDING_SIZE}"
+DTC_OFLAGS ?= "-p 0 -@ -H epapr"
 
 python () {
     if d.getVar("KERNEL_INCLUDE"):
@@ -106,6 +107,8 @@ def devicetree_compile(dtspath, includes, d):
     dtcargs = ["dtc"] + (d.getVar("DTC_FLAGS") or "").split()
     if isoverlay:
         dtcargs += (d.getVar("DTC_OFLAGS") or "").split()
+    else:
+        dtcargs += (d.getVar("DTC_BFLAGS") or "").split()
     for i in includes:
         dtcargs += ["-i", i]
     dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")]
--

2.17.1