All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
@ 2016-05-20  8:27 Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 1/5] " Herve Jourdain
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Herve Jourdain @ 2016-05-20  8:27 UTC (permalink / raw)
  To: yocto

For kernels 4.4.9+, the behavior for the device tree overlays loading has been modified on RaspberryPi.
For overlays, it loads .dtbo files, not .dtb anymore.
Also, it does not check for -overlay extension, so the name of the overlay that is placed in the "overlays" directory must be <overlay_name>.dtbo, instead of <overlay_name>-overlay.dtb.

This patch addresses the issue for kernels 4.4+, while keeping the same behavior for older kernels.
This patch must be used in conjunction with another patch to meta/recipes-kernel/linux-dtb.inc, which will allow the processing of .dtbo files for overlays, instead of only .dtb like before.

.dtb are still in use, but only for the "real" device trees (not the overlays).

Herve Jourdain (5):
  Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  Support for .dtbo files for dtb overlays, required by kernels 4.4.6+

 classes/linux-raspberrypi-base.bbclass             |  4 ++-
 classes/sdcard_image-rpi.bbclass                   |  7 ++--
 conf/machine/include/rpi-base.inc                  | 37 +++++++++++++++++++++-
 .../0001-fix-dtbo-rules.patch                      | 27 ++++++++++++++++
 recipes-kernel/linux/linux-raspberrypi_4.4.bb      |  1 +
 5 files changed, 71 insertions(+), 5 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch

-- 
2.7.4



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [meta-raspberrypi][PATCH v3 1/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  2016-05-20  8:27 [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
@ 2016-05-20  8:27 ` Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 2/5] " Herve Jourdain
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Herve Jourdain @ 2016-05-20  8:27 UTC (permalink / raw)
  To: yocto

Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for both variants of overlays ("-overlay.dtb" and ".dtbo")

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
 classes/linux-raspberrypi-base.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/classes/linux-raspberrypi-base.bbclass b/classes/linux-raspberrypi-base.bbclass
index 40beef1..2eca037 100644
--- a/classes/linux-raspberrypi-base.bbclass
+++ b/classes/linux-raspberrypi-base.bbclass
@@ -33,7 +33,9 @@ def split_overlays(d, out):
     dts = get_dts(d, None)
     if out:
         overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d)
+        overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d)
     else:
-        overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d)
+        overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + \
+                   " " + oe.utils.str_filter('\S+\.dtbo$', dts, d)
 
     return overlays
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-raspberrypi][PATCH v3 2/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  2016-05-20  8:27 [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 1/5] " Herve Jourdain
@ 2016-05-20  8:27 ` Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 3/5] " Herve Jourdain
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Herve Jourdain @ 2016-05-20  8:27 UTC (permalink / raw)
  To: yocto

Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for both extensions for overlays (".dtb" and ".dtbo")

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
 classes/sdcard_image-rpi.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 4dfd7a3..b3a8bc0 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -110,7 +110,7 @@ IMAGE_CMD_rpi-sdimg () {
 		;;
 	*)
 		if test -n "${DTS}"; then
-			# Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' string and will be put in a dedicated folder
+			# Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' (4.1.x) or by '.dtbo' (4.4.9+) string and will be put in a dedicated folder
 			DT_OVERLAYS="${@split_overlays(d, 0)}"
 			DT_ROOT="${@split_overlays(d, 1)}"
 
@@ -124,9 +124,10 @@ IMAGE_CMD_rpi-sdimg () {
 			# Copy device tree overlays to dedicated folder
 			mmd -i ${WORKDIR}/boot.img overlays
 			for DTB in ${DT_OVERLAYS}; do
-				DTB_BASE_NAME=`basename ${DTB} .dtb`
+				DTB_EXT=${DTB##*.}
+				DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
 
-				mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::overlays/${DTB_BASE_NAME}.dtb
+				mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.${DTB_EXT} ::overlays/${DTB_BASE_NAME}.${DTB_EXT}
 			done
 		fi
 		mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::${SDIMG_KERNELIMAGE}
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-raspberrypi][PATCH v3 3/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  2016-05-20  8:27 [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 1/5] " Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 2/5] " Herve Jourdain
@ 2016-05-20  8:27 ` Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 4/5] " Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 5/5] " Herve Jourdain
  4 siblings, 0 replies; 6+ messages in thread
From: Herve Jourdain @ 2016-05-20  8:27 UTC (permalink / raw)
  To: yocto

Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for both variants of overlays ("-overlay.dtb" and ".dtbo") for the default KERNEL_DEVICETREE variable

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
 conf/machine/include/rpi-base.inc | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index 56ca83e..23f8619 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -16,7 +16,7 @@ XSERVER = " \
     "
 
 # Really supported starting from linux-raspberrypi 3.18.y only
-KERNEL_DEVICETREE ?= " \
+KERNEL_DEVICETREE_OVERLAYS_DTB = " \
     bcm2708-rpi-b.dtb \
     bcm2708-rpi-b-plus.dtb \
     bcm2709-rpi-2-b.dtb \
@@ -38,6 +38,40 @@ KERNEL_DEVICETREE ?= " \
     overlays/w1-gpio-pullup-overlay.dtb \
     overlays/pi3-miniuart-bt-overlay.dtb \
     "
+KERNEL_DEVICETREE_OVERLAYS_DTBO = " \
+    bcm2708-rpi-b.dtb \
+    bcm2708-rpi-b-plus.dtb \
+    bcm2709-rpi-2-b.dtb \
+    bcm2710-rpi-3-b.dtb \
+    \
+    overlays/hifiberry-amp.dtbo \
+    overlays/hifiberry-dac.dtbo \
+    overlays/hifiberry-dacplus.dtbo \
+    overlays/hifiberry-digi.dtbo \
+    overlays/i2c-rtc.dtbo \
+    overlays/iqaudio-dac.dtbo \
+    overlays/iqaudio-dacplus.dtbo \
+    overlays/lirc-rpi.dtbo \
+    overlays/pitft22.dtbo \
+    overlays/pitft28-resistive.dtbo \
+    overlays/pps-gpio.dtbo \
+    overlays/rpi-ft5406.dtbo \
+    overlays/w1-gpio.dtbo \
+    overlays/w1-gpio-pullup.dtbo \
+    overlays/pi3-miniuart-bt.dtbo \
+    "
+
+def cmpver_strings(ver1, ver2, truevalue, falsevalue):
+    from distutils.version import LooseVersion
+    ver1 = ''.join(ch for ch in ver1 if ch in '0123456789.')
+    ver2 = ''.join(ch for ch in ver2 if ch in '0123456789.')
+    if LooseVersion(ver1) >= LooseVersion(ver2):
+        return truevalue
+    else:
+        return falsevalue
+
+KERNEL_DEVICETREE ?= "${@cmpver_strings("${PREFERRED_VERSION_linux-raspberrypi}", "4.4", "${KERNEL_DEVICETREE_OVERLAYS_DTBO}", "${KERNEL_DEVICETREE_OVERLAYS_DTB}")}"
+
 KERNEL_IMAGETYPE ?= "Image"
 
 MACHINE_FEATURES += "apm usbhost keyboard vfat ext2 screen touchscreen alsa bluetooth wifi sdio"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-raspberrypi][PATCH v3 4/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  2016-05-20  8:27 [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
                   ` (2 preceding siblings ...)
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 3/5] " Herve Jourdain
@ 2016-05-20  8:27 ` Herve Jourdain
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 5/5] " Herve Jourdain
  4 siblings, 0 replies; 6+ messages in thread
From: Herve Jourdain @ 2016-05-20  8:27 UTC (permalink / raw)
  To: yocto

Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Patch the kernel, which has faulty rules to generate .dtbo the way yocto does

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
 recipes-kernel/linux/linux-raspberrypi_4.4.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-kernel/linux/linux-raspberrypi_4.4.bb b/recipes-kernel/linux/linux-raspberrypi_4.4.bb
index f6e1005..831ac5a 100644
--- a/recipes-kernel/linux/linux-raspberrypi_4.4.bb
+++ b/recipes-kernel/linux/linux-raspberrypi_4.4.bb
@@ -4,5 +4,6 @@ LINUX_VERSION ?= "4.4.8"
 
 SRCREV = "fe7ad6aa5c6940817fe971d80a7b2a1d6052190a"
 SRC_URI = "git://github.com/raspberrypi/linux.git;protocol=git;branch=rpi-4.4.y \
+           file://0001-fix-dtbo-rules.patch \
 "
 require linux-raspberrypi.inc
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [meta-raspberrypi][PATCH v3 5/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
  2016-05-20  8:27 [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
                   ` (3 preceding siblings ...)
  2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 4/5] " Herve Jourdain
@ 2016-05-20  8:27 ` Herve Jourdain
  4 siblings, 0 replies; 6+ messages in thread
From: Herve Jourdain @ 2016-05-20  8:27 UTC (permalink / raw)
  To: yocto

Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Patch the kernel, which has faulty rules to generate .dtbo the way yocto does

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
 .../0001-fix-dtbo-rules.patch                      | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch

diff --git a/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch b/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
new file mode 100644
index 0000000..ef04a72
--- /dev/null
+++ b/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
@@ -0,0 +1,27 @@
+diff --git a/arch/arm/Makefile b/arch/arm/Makefile
+index a2e7cf7..673c1cb 100644
+--- a/arch/arm/Makefile
++++ b/arch/arm/Makefile
+@@ -333,6 +333,8 @@ $(INSTALL_TARGETS):
+ 
+ %.dtb: | scripts
+ 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
++%.dtbo: | scripts
++	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+ 
+ PHONY += dtbs dtbs_install
+ 
+diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
+index 3079c4f..6cc3766 100644
+--- a/scripts/Makefile.lib
++++ b/scripts/Makefile.lib
+@@ -293,7 +293,8 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
+ 	$(call if_changed_dep,dtc)
+ 
+ quiet_cmd_dtco = DTCO    $@
+-cmd_dtco = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
++cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
++	$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+ 	$(objtree)/scripts/dtc/dtc -@ -H epapr -O dtb -o $@ -b 0 \
+ 		-i $(dir $<) $(DTC_FLAGS) \
+ 		-d $(depfile).dtc.tmp $(dtc-tmp) ; \
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-20  8:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20  8:27 [meta-raspberrypi][PATCH v3 0/5] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 1/5] " Herve Jourdain
2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 2/5] " Herve Jourdain
2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 3/5] " Herve Jourdain
2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 4/5] " Herve Jourdain
2016-05-20  8:27 ` [meta-raspberrypi][PATCH v3 5/5] " Herve Jourdain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.