* [meta-raspberrypi][PATCH v5 0/4] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+
@ 2016-06-17 15:35 Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 1/4] linux-raspberrypi_4.4.inc: support for .dtbo files for dtb overlays Herve Jourdain
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Herve Jourdain @ 2016-06-17 15:35 UTC (permalink / raw)
To: yocto
v5: modifications after more review
* Added an Upstream-Status to the kernel patch
* Only one instance of KERNEL_DEVICETREE defined (with the new .dtbo syntax)
* Modification of the KERNEL_DEVICETREE is done in linux-raspberry-base.bbclass, based on the kernel version
v4: rebased
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 (4):
linux-raspberrypi_4.4.inc: support for .dtbo files for dtb overlays
rpi-base.inc: support for .dtbo files for dtb overlays
linux-raspberrypi-base.bbclass: support for .dtbo files for dtb
overlays
sdcard_image-rpi.bbclass: support for .dtbo files for dtb overlays
classes/linux-raspberrypi-base.bbclass | 19 ++++++----
classes/sdcard_image-rpi.bbclass | 15 +++++---
conf/machine/include/rpi-base.inc | 30 +++++++--------
.../0001-fix-dtbo-rules.patch | 44 ++++++++++++++++++++++
recipes-kernel/linux/linux-raspberrypi_4.4.bb | 1 +
5 files changed, 81 insertions(+), 28 deletions(-)
create mode 100644 recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
--
2.7.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [meta-raspberrypi][PATCH v5 1/4] linux-raspberrypi_4.4.inc: support for .dtbo files for dtb overlays
2016-06-17 15:35 [meta-raspberrypi][PATCH v5 0/4] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
@ 2016-06-17 15:35 ` Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 2/4] rpi-base.inc: " Herve Jourdain
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Herve Jourdain @ 2016-06-17 15:35 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 | 44 ++++++++++++++++++++++
recipes-kernel/linux/linux-raspberrypi_4.4.bb | 1 +
2 files changed, 45 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..5113e23
--- /dev/null
+++ b/recipes-kernel/linux/linux-raspberrypi-4.4/0001-fix-dtbo-rules.patch
@@ -0,0 +1,44 @@
+From 13c8784da3dbd977f64cec740eba775b6fab11c2 Mon Sep 17 00:00:00 2001
+From: Herve Jourdain <herve.jourdain@neuf.fr>
+Date: Fri, 20 May 2016 16:02:23 +0800
+Subject: [yocto][meta-raspberrypi][PATCH v4 4/5] linux-raspberrypi_4.4.inc:
+ support for .dtbo files for dtb overlays
+
+Upstream-Status: Pending
+
+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/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) ; \
diff --git a/recipes-kernel/linux/linux-raspberrypi_4.4.bb b/recipes-kernel/linux/linux-raspberrypi_4.4.bb
index ba47b22..789fef1 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.9"
SRCREV = "3b440738b5c1adc3ec3ee72ceca799d1b8d264df"
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] 8+ messages in thread
* [meta-raspberrypi][PATCH v5 2/4] rpi-base.inc: support for .dtbo files for dtb overlays
2016-06-17 15:35 [meta-raspberrypi][PATCH v5 0/4] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 1/4] linux-raspberrypi_4.4.inc: support for .dtbo files for dtb overlays Herve Jourdain
@ 2016-06-17 15:35 ` Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: " Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 4/4] sdcard_image-rpi.bbclass: " Herve Jourdain
3 siblings, 0 replies; 8+ messages in thread
From: Herve Jourdain @ 2016-06-17 15:35 UTC (permalink / raw)
To: yocto
Kernel 4.4.6+ on RaspberryPi support .dtbo files for overlays, instead of .dtb.
Add support for .dtbo variant of overlays for the default KERNEL_DEVICETREE variable
(the list will be turned into "-overlay.dtb" by linux-raspberry-base.bbclass, if needed, depending on the kernel version)
Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
conf/machine/include/rpi-base.inc | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index 56ca83e..47eb23b 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -22,21 +22,21 @@ KERNEL_DEVICETREE ?= " \
bcm2709-rpi-2-b.dtb \
bcm2710-rpi-3-b.dtb \
\
- overlays/hifiberry-amp-overlay.dtb \
- overlays/hifiberry-dac-overlay.dtb \
- overlays/hifiberry-dacplus-overlay.dtb \
- overlays/hifiberry-digi-overlay.dtb \
- overlays/i2c-rtc-overlay.dtb \
- overlays/iqaudio-dac-overlay.dtb \
- overlays/iqaudio-dacplus-overlay.dtb \
- overlays/lirc-rpi-overlay.dtb \
- overlays/pitft22-overlay.dtb \
- overlays/pitft28-resistive-overlay.dtb \
- overlays/pps-gpio-overlay.dtb \
- overlays/rpi-ft5406-overlay.dtb \
- overlays/w1-gpio-overlay.dtb \
- overlays/w1-gpio-pullup-overlay.dtb \
- overlays/pi3-miniuart-bt-overlay.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 \
"
KERNEL_IMAGETYPE ?= "Image"
--
2.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
2016-06-17 15:35 [meta-raspberrypi][PATCH v5 0/4] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 1/4] linux-raspberrypi_4.4.inc: support for .dtbo files for dtb overlays Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 2/4] rpi-base.inc: " Herve Jourdain
@ 2016-06-17 15:35 ` Herve Jourdain
2016-06-25 15:48 ` Francois Muller
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 4/4] sdcard_image-rpi.bbclass: " Herve Jourdain
3 siblings, 1 reply; 8+ messages in thread
From: Herve Jourdain @ 2016-06-17 15:35 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")
Change which variant needs to be supported based on the kernel version
CAUTION: when called from IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing get_kernelversion_file() to fail!
To avoid this problem, get_dts() and split_overlays() MUST be called with the kernel version parameter set, when called from IMAGE_CMD_rpi-sdimg!
Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
classes/linux-raspberrypi-base.bbclass | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/classes/linux-raspberrypi-base.bbclass b/classes/linux-raspberrypi-base.bbclass
index 40beef1..930fc44 100644
--- a/classes/linux-raspberrypi-base.bbclass
+++ b/classes/linux-raspberrypi-base.bbclass
@@ -1,7 +1,8 @@
inherit linux-kernel-base
-
def get_dts(d, ver):
+ import re
+
staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
dts = d.getVar("KERNEL_DEVICETREE", True)
@@ -20,20 +21,24 @@ def get_dts(d, ver):
# Always turn off device tree support for kernel's < 3.18
try:
- if int(min_ver[0]) <= 3:
- if int(min_ver[1]) < 18:
- dts = ""
+ if int(min_ver[0]) >= 4:
+ if (int(min_ver[1]) < 4) or (int(min_ver[1]) == 4 and int(min_ver[2]) < 6):
+ dts = ' '.join([(re.sub(r'(.*)\.dtbo$', r'\1-overlay.dtb', x)) for x in dts.split()])
+ elif int(min_ver[1]) < 18:
+ dts = ""
except IndexError:
min_ver = None
return dts
-def split_overlays(d, out):
- dts = get_dts(d, None)
+def split_overlays(d, ver, out):
+ dts = get_dts(d, ver)
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] 8+ messages in thread
* [meta-raspberrypi][PATCH v5 4/4] sdcard_image-rpi.bbclass: support for .dtbo files for dtb overlays
2016-06-17 15:35 [meta-raspberrypi][PATCH v5 0/4] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
` (2 preceding siblings ...)
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: " Herve Jourdain
@ 2016-06-17 15:35 ` Herve Jourdain
3 siblings, 0 replies; 8+ messages in thread
From: Herve Jourdain @ 2016-06-17 15:35 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")
CAUTION: in IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing get_dts() to not being able to get the kernel version!
To avoid this problem, the kernel version is added in a new variable outside the scope of IMAGE_CMD_rpi-sdimg, and its value passed to get_dts() and split_overlays()!
Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
---
classes/sdcard_image-rpi.bbclass | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/classes/sdcard_image-rpi.bbclass b/classes/sdcard_image-rpi.bbclass
index 4dfd7a3..560d2c3 100644
--- a/classes/sdcard_image-rpi.bbclass
+++ b/classes/sdcard_image-rpi.bbclass
@@ -74,6 +74,8 @@ FATPAYLOAD ?= ""
IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"
IMAGE_CMD_rpi-sdimg[vardepsexclude] = "IMAGEDATESTAMP"
+RPI_KERNEL_VERSION := "${@get_kernelversion_file('${STAGING_KERNEL_BUILDDIR}')}"
+
IMAGE_CMD_rpi-sdimg () {
# Align partitions
@@ -84,7 +86,7 @@ IMAGE_CMD_rpi-sdimg () {
echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS $ROOTFS_SIZE KiB"
# Check if we are building with device tree support
- DTS="${@get_dts(d, None)}"
+ DTS="${@get_dts(d, '${RPI_KERNEL_VERSION}')}"
# Initialize sdcard image file
dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
@@ -110,9 +112,9 @@ 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
- DT_OVERLAYS="${@split_overlays(d, 0)}"
- DT_ROOT="${@split_overlays(d, 1)}"
+ # 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, '${RPI_KERNEL_VERSION}', 0)}"
+ DT_ROOT="${@split_overlays(d, '${RPI_KERNEL_VERSION}', 1)}"
# Copy board device trees to root folder
for DTB in ${DT_ROOT}; do
@@ -124,9 +126,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] 8+ messages in thread
* Re: [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: " Herve Jourdain
@ 2016-06-25 15:48 ` Francois Muller
2016-07-20 14:51 ` ***SPAM*** " Herve Jourdain
0 siblings, 1 reply; 8+ messages in thread
From: Francois Muller @ 2016-06-25 15:48 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 3150 bytes --]
Hi Hervé,
I haven't tested your patch yet, but while reviewing the diff I'm a
bit surprised about this:
> overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', > dts
, d)
> + overlays = oe.utils.str_filter_out('\S+\.dtbo$', > overlays,
> d)
Shouldn't .dtbo files be filtered out from 'dts' instead of 'overlays'
in the added line?
Seems like a typo to me.
BR,
François
Le vendredi 17 juin 2016 à 23:35 +0800, Herve Jourdain a écrit :
> 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")
> Change which variant needs to be supported based on the kernel
> version
>
> CAUTION: when called from IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set,
> causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing
> get_kernelversion_file() to fail!
> To avoid this problem, get_dts() and split_overlays() MUST be called
> with the kernel version parameter set, when called from
> IMAGE_CMD_rpi-sdimg!
>
> Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
> ---
> classes/linux-raspberrypi-base.bbclass | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/classes/linux-raspberrypi-base.bbclass b/classes/linux-
> raspberrypi-base.bbclass
> index 40beef1..930fc44 100644
> --- a/classes/linux-raspberrypi-base.bbclass
> +++ b/classes/linux-raspberrypi-base.bbclass
> @@ -1,7 +1,8 @@
> inherit linux-kernel-base
>
> -
> def get_dts(d, ver):
> + import re
> +
> staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
> dts = d.getVar("KERNEL_DEVICETREE", True)
>
> @@ -20,20 +21,24 @@ def get_dts(d, ver):
>
> # Always turn off device tree support for kernel's < 3.18
> try:
> - if int(min_ver[0]) <= 3:
> - if int(min_ver[1]) < 18:
> - dts = ""
> + if int(min_ver[0]) >= 4:
> + if (int(min_ver[1]) < 4) or (int(min_ver[1]) == 4 and
> int(min_ver[2]) < 6):
> + dts = ' '.join([(re.sub(r'(.*)\.dtbo$', r'\1-
> overlay.dtb', x)) for x in dts.split()])
> + elif int(min_ver[1]) < 18:
> + dts = ""
> except IndexError:
> min_ver = None
>
> return dts
>
>
> -def split_overlays(d, out):
> - dts = get_dts(d, None)
> +def split_overlays(d, ver, out):
> + dts = get_dts(d, ver)
> 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
>
[-- Attachment #2: Type: text/html, Size: 3175 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: ***SPAM*** Re: [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
2016-06-25 15:48 ` Francois Muller
@ 2016-07-20 14:51 ` Herve Jourdain
2016-07-25 14:33 ` Francois Muller
0 siblings, 1 reply; 8+ messages in thread
From: Herve Jourdain @ 2016-07-20 14:51 UTC (permalink / raw)
To: 'Francois Muller', yocto
[-- Attachment #1: Type: text/plain, Size: 4044 bytes --]
Hi François,
Sorry for the late response, I’ve been busy on other things recently.
Actually, it’s not a typo, it’s just that we’re using the “overlays” variable for storing 2 things, depending on the value of the parameter “out” of the split_overlays() function:
1. either all the overlays
2. or all the dtb that are not overlays
The case you’re mentioning is for “out” being selected, so you want to exclude all the overlays from the dts, and store that in the “overlays” variable (the naming of the variable is a bit unfortunate in this context, I must admit, but I only re-used the existing one).
So now, you not only need to exclude the “-overlay.dtb” files, but also the “.dtbo” files.
So the second pass takes the output of the first pass, in “overlays”, and filters out the “.dtbo” if any.
Hope that helps,
Hervé
From: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] On Behalf Of Francois Muller
Sent: samedi 25 juin 2016 17:48
To: yocto@yoctoproject.org
Subject: ***SPAM*** Re: [yocto] [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
Hi Hervé,
I haven't tested your patch yet, but while reviewing the diff I'm a bit surprised about this:
overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d)
+ overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d)
Shouldn't .dtbo files be filtered out from 'dts' instead of 'overlays' in the added line?
Seems like a typo to me.
BR,
François
Le vendredi 17 juin 2016 à 23:35 +0800, Herve Jourdain a écrit :
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")
Change which variant needs to be supported based on the kernel version
CAUTION: when called from IMAGE_CMD_rpi-sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not be expanded, causing get_kernelversion_file() to fail!
To avoid this problem, get_dts() and split_overlays() MUST be called with the kernel version parameter set, when called from IMAGE_CMD_rpi-sdimg!
Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr <mailto:herve.jourdain@neuf.fr> >
---
classes/linux-raspberrypi-base.bbclass | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/classes/linux-raspberrypi-base.bbclass b/classes/linux-raspberrypi-base.bbclass
index 40beef1..930fc44 100644
--- a/classes/linux-raspberrypi-base.bbclass
+++ b/classes/linux-raspberrypi-base.bbclass
@@ -1,7 +1,8 @@
inherit linux-kernel-base
-
def get_dts(d, ver):
+ import re
+
staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
dts = d.getVar("KERNEL_DEVICETREE", True)
@@ -20,20 +21,24 @@ def get_dts(d, ver):
# Always turn off device tree support for kernel's < 3.18
try:
- if int(min_ver[0]) <= 3:
- if int(min_ver[1]) < 18:
- dts = ""
+ if int(min_ver[0]) >= 4:
+ if (int(min_ver[1]) < 4) or (int(min_ver[1]) == 4 and int(min_ver[2]) < 6):
+ dts = ' '.join([(re.sub(r'(.*)\.dtbo$', r'\1-overlay.dtb', x)) for x in dts.split()])
+ elif int(min_ver[1]) < 18:
+ dts = ""
except IndexError:
min_ver = None
return dts
-def split_overlays(d, out):
- dts = get_dts(d, None)
+def split_overlays(d, ver, out):
+ dts = get_dts(d, ver)
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
[-- Attachment #2: Type: text/html, Size: 11365 bytes --]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
2016-07-20 14:51 ` ***SPAM*** " Herve Jourdain
@ 2016-07-25 14:33 ` Francois Muller
0 siblings, 0 replies; 8+ messages in thread
From: Francois Muller @ 2016-07-25 14:33 UTC (permalink / raw)
To: Herve Jourdain, yocto
[-- Attachment #1: Type: text/plain, Size: 4777 bytes --]
Hi Hervé,
Thanks for the explanation, I actually missed the 2nd pass aspect of
the process.
Your patch is running ok for me (4.1.21 and 4.4.13) after having found
and applied the required linux-dtb.inc patch you prepared (for the
record, it is named "[PATCH v3] Support for .dtbo files for dtb
overlays" in oe-core list).
Nevertheless, I've some remarks about the process that I'll emit on
your latest patch version (v6) for consistency.
BR,
François
Le mercredi 20 juillet 2016 à 16:51 +0200, Herve Jourdain a écrit :
> > > > > > > > > > > > > > > Hi François, Sorry for the late response, I’ve been busy on other
things recently. Actually, it’s not a typo, it’s just that we’re
using the “overlays” variable for storing 2 things, depending on the
value of the parameter “out” of the split_overlays() function:1.
either all the overlays2. or all the dtb that are not overlays The
case you’re mentioning is for “out” being selected, so you want to
exclude all the overlays from the dts, and store that in the
“overlays” variable (the naming of the variable is a bit unfortunate
in this context, I must admit, but I only re-used the existing
one).So now, you not only need to exclude the “-overlay.dtb” files,
but also the “.dtbo” files.So the second pass takes the output of the
first pass, in “overlays”, and filters out the “.dtbo” if any. Hope
that helps, Hervé From: yocto-bounces@yoctoproject.org [mailto:yocto-
bounces@yoctoproject.org] On Behalf Of Francois Muller
> Sent: samedi 25 juin 2016 17:48
> To: yocto@yoctoproject.org
> > > Subject: ***SPAM*** Re: [yocto] [meta-raspberrypi][PATCH v5 3/4]
linux-raspberrypi-base.bbclass: support for .dtbo files for dtb
overlays
>
> Hi Hervé,
>
> > I haven't tested your patch yet, but while reviewing the diff I'm a
bit surprised about this:
> > overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$',
dts, d)
> > + overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays,
d)
> > Shouldn't .dtbo files be filtered out from 'dts' instead of
'overlays' in the added line?
> Seems like a typo to me.
>
> BR,
> François
>
> Le vendredi 17 juin 2016 à 23:35 +0800, Herve Jourdain a écrit :
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 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")Change which variant needs to be supported
based on the kernel version CAUTION: when called from IMAGE_CMD_rpi-
sdimg, 'TMPDIR' is not set, causing 'STAGING_KERNEL_BUILDDIR' to not
be expanded, causing get_kernelversion_file() to fail!To avoid this
problem, get_dts() and split_overlays() MUST be called with the
kernel version parameter set, when called from IMAGE_CMD_rpi-
sdimg! Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>---
classes/linux-raspberrypi-base.bbclass | 19 ++++++++++++------- 1
file changed, 12 insertions(+), 7 deletions(-) diff --git
a/classes/linux-raspberrypi-base.bbclass b/classes/linux-raspberrypi-
base.bbclassindex 40beef1..930fc44 100644--- a/classes/linux-
raspberrypi-base.bbclass+++ b/classes/linux-raspberrypi-
base.bbclass@@ -1,7 +1,8 @@ inherit linux-kernel-base - def
get_dts(d, ver):+ import re+ staging_dir =
d.getVar("STAGING_KERNEL_BUILDDIR", True) dts =
d.getVar("KERNEL_DEVICETREE", True) @@ -20,20 +21,24 @@ def
get_dts(d, ver): # Always turn off device tree support for
kernel's < 3.18 try:- if int(min_ver[0]) <= 3:-
if int(min_ver[1]) < 18:- dts = ""+ if
int(min_ver[0]) >= 4:+ if (int(min_ver[1]) < 4) or
(int(min_ver[1]) == 4 and int(min_ver[2]) < 6):+ dts =
' '.join([(re.sub(r'(.*)\.dtbo$', r'\1-overlay.dtb', x)) for x in
dts.split()])+ elif int(min_ver[1]) < 18:+ dts =
"" except IndexError: min_ver = None return dts -
def split_overlays(d, out):- dts = get_dts(d, None)+def
split_overlays(d, ver, out):+ dts = get_dts(d, ver) 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
[-- Attachment #2: Type: text/html, Size: 13097 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-07-25 14:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17 15:35 [meta-raspberrypi][PATCH v5 0/4] Support for .dtbo files for dtb overlays, required by kernels 4.4.6+ Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 1/4] linux-raspberrypi_4.4.inc: support for .dtbo files for dtb overlays Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 2/4] rpi-base.inc: " Herve Jourdain
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 3/4] linux-raspberrypi-base.bbclass: " Herve Jourdain
2016-06-25 15:48 ` Francois Muller
2016-07-20 14:51 ` ***SPAM*** " Herve Jourdain
2016-07-25 14:33 ` Francois Muller
2016-06-17 15:35 ` [meta-raspberrypi][PATCH v5 4/4] sdcard_image-rpi.bbclass: " 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.