All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: yocto@yoctoproject.org
Subject: [meta-raspberrypi][PATCH 03/23] linux-raspberrypi-base.bbclass: support for .dtbo files for dtb overlays
Date: Thu, 11 Aug 2016 18:05:48 -0700	[thread overview]
Message-ID: <20160812010608.31182-3-raj.khem@gmail.com> (raw)
In-Reply-To: <20160812010608.31182-1-raj.khem@gmail.com>

From: Herve Jourdain <herve.jourdain@neuf.fr>

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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 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.9.2



  parent reply	other threads:[~2016-08-12  1:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12  1:05 [meta-raspberrypi][PATCH 01/23] linux-raspberrypi_4.4.bb: support for .dtbo files for dtb overlays Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 02/23] rpi-base.inc: " Khem Raj
2016-08-12  1:05 ` Khem Raj [this message]
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 04/23] sdcard_image-rpi.bbclass: " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 05/23] rpi-default-providers.inc: change default providers to support vc4graphics Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 06/23] rpi-base.inc: add vc4-kms-v3d to the overlays " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 07/23] raspberrypi.conf: set the default value of VC4_CMA_SIZE " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 08/23] raspberrypi0.conf: " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 09/23] raspberrypi2.conf: " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 10/23] raspberrypi3.conf: " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 11/23] rpi-config_git.bb: add v4c overlay to config.txt " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 12/23] wayland/weston_%.bbappend: modify configuration options " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 13/23] weston/weston_%.bbappend: " Khem Raj
2016-08-12  1:05 ` [meta-raspberrypi][PATCH 14/23] mesa_%.bbappend: new file to add the correct " Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 15/23] linux-rpi.inc: add the configuration options required " Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 16/23] linux-raspberrypi-4.4: add patch to enable proper operation of renderD128 device Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 17/23] linux-raspberrypi_4.4: upgrade to 4.4.16 Khem Raj
2016-09-21 16:41   ` Andrei Gherzan
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 18/23] linux-raspberrypi: Add recipe for 4.7 release Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 19/23] linux-raspberrypi_3.18: Remove Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 20/23] firmware, userland: Bump to latest Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 21/23] vc4graphics: Support X11 with the VC4 driver Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 22/23] Switch to using 4.4 as default kernel Khem Raj
2016-08-12  1:06 ` [meta-raspberrypi][PATCH 23/23] weston: Fix typo with override Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160812010608.31182-3-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.