diff options
author | Tom Hochstein <tom.hochstein@nxp.com> | 2023-11-02 07:39:14 -0700 |
---|---|---|
committer | Tom Hochstein <tom.hochstein@nxp.com> | 2023-11-02 10:56:38 -0700 |
commit | f06c7376ee29932c3637efc8db1b02de26ed1793 (patch) | |
tree | 21dc3e9d506669cf6597c6fea493afa7bed68b53 /recipes-kernel | |
parent | ee4dc924f5d7d45e1d11df2239944480fe599c6a (diff) | |
download | meta-freescale-f06c7376ee29932c3637efc8db1b02de26ed1793.tar.gz |
linux: Add compatibility logic for 32-bit dtb move
Newer kernels have moved the dtbs to a vendor sub-folder.
In order to maintain one KERNEL_DEVICETREE for both new and old kernels,
provide logic that can be enabled in older kernels to strip the new
sub-folder.
Fixes: 0d838c68
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'recipes-kernel')
-rw-r--r-- | recipes-kernel/linux/linux-fslc-imx_6.1.bb | 2 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-fslc-lts_6.1.bb | 2 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-imx.inc | 26 | ||||
-rw-r--r-- | recipes-kernel/linux/linux-imx_6.1.bb | 2 |
4 files changed, 32 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-fslc-imx_6.1.bb b/recipes-kernel/linux/linux-fslc-imx_6.1.bb index 38bc0b97..3f028b84 100644 --- a/recipes-kernel/linux/linux-fslc-imx_6.1.bb +++ b/recipes-kernel/linux/linux-fslc-imx_6.1.bb | |||
@@ -52,6 +52,8 @@ Latest stable Kernel patchlevel is applied and maintained by Community." | |||
52 | 52 | ||
53 | require linux-imx.inc | 53 | require linux-imx.inc |
54 | 54 | ||
55 | KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1" | ||
56 | |||
55 | KBRANCH = "6.1-2.1.x-imx" | 57 | KBRANCH = "6.1-2.1.x-imx" |
56 | SRC_URI = "git://github.com/Freescale/linux-fslc.git;branch=${KBRANCH};protocol=https" | 58 | SRC_URI = "git://github.com/Freescale/linux-fslc.git;branch=${KBRANCH};protocol=https" |
57 | SRCREV = "3f41fbe42851375d3d5996e4bf9e9809e6c79517" | 59 | SRCREV = "3f41fbe42851375d3d5996e4bf9e9809e6c79517" |
diff --git a/recipes-kernel/linux/linux-fslc-lts_6.1.bb b/recipes-kernel/linux/linux-fslc-lts_6.1.bb index 51202796..c211bb44 100644 --- a/recipes-kernel/linux/linux-fslc-lts_6.1.bb +++ b/recipes-kernel/linux/linux-fslc-lts_6.1.bb | |||
@@ -12,6 +12,8 @@ upstreaming in any form." | |||
12 | 12 | ||
13 | require linux-imx.inc | 13 | require linux-imx.inc |
14 | 14 | ||
15 | KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1" | ||
16 | |||
15 | SRC_URI = "git://github.com/Freescale/linux-fslc.git;branch=${KBRANCH};protocol=https" | 17 | SRC_URI = "git://github.com/Freescale/linux-fslc.git;branch=${KBRANCH};protocol=https" |
16 | 18 | ||
17 | # PV is defined in the base in linux-imx.inc file and uses the LINUX_VERSION definition | 19 | # PV is defined in the base in linux-imx.inc file and uses the LINUX_VERSION definition |
diff --git a/recipes-kernel/linux/linux-imx.inc b/recipes-kernel/linux/linux-imx.inc index ea006bb1..34d50cfc 100644 --- a/recipes-kernel/linux/linux-imx.inc +++ b/recipes-kernel/linux/linux-imx.inc | |||
@@ -38,3 +38,29 @@ KCONFIG_MODE="--alldefconfig" | |||
38 | # We need to pass it as param since kernel might support more then one | 38 | # We need to pass it as param since kernel might support more then one |
39 | # machine, with different entry points | 39 | # machine, with different entry points |
40 | KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" | 40 | KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" |
41 | |||
42 | # A function to strip the new 32-bit dtb sub-folders in KERNEL_DEVICETREE | ||
43 | # for older kernel builds. | ||
44 | # Set KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1" to enable. | ||
45 | KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE ?= "0" | ||
46 | python kernel_devicetree_32bit_compatibility_update() { | ||
47 | import os.path | ||
48 | import re | ||
49 | if d.getVar('KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE') != "1" or d.getVar('TUNE_ARCH') != "arm": | ||
50 | return | ||
51 | input = d.getVar('KERNEL_DEVICETREE').split() | ||
52 | output = "" | ||
53 | stripped = "" | ||
54 | for original in input: | ||
55 | if re.match("^.*/", original): | ||
56 | stripped = os.path.basename(original) | ||
57 | output += stripped + " " | ||
58 | bb.debug(1, "Devicetrees are moved to sub-folder, stripping the sub-folder for older kernel: %s -> %s" % (original, stripped)) | ||
59 | else: | ||
60 | output += original + " " | ||
61 | if stripped: | ||
62 | bb.warn("Updating KERNEL_DEVICETREE, removing sub-folders for older kernel. Use -D for more details. Set KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = \"0\" to disable.") | ||
63 | d.setVar('KERNEL_DEVICETREE', output) | ||
64 | } | ||
65 | addhandler kernel_devicetree_32bit_compatibility_update | ||
66 | kernel_devicetree_32bit_compatibility_update[eventmask] = "bb.event.RecipeParsed" | ||
diff --git a/recipes-kernel/linux/linux-imx_6.1.bb b/recipes-kernel/linux/linux-imx_6.1.bb index f8a9ce1d..9e5fa2b0 100644 --- a/recipes-kernel/linux/linux-imx_6.1.bb +++ b/recipes-kernel/linux/linux-imx_6.1.bb | |||
@@ -12,6 +12,8 @@ i.MX Family Reference Boards. It includes support for many IPs such as GPU, VPU | |||
12 | 12 | ||
13 | require recipes-kernel/linux/linux-imx.inc | 13 | require recipes-kernel/linux/linux-imx.inc |
14 | 14 | ||
15 | KERNEL_DEVICETREE_32BIT_COMPATIBILITY_UPDATE = "1" | ||
16 | |||
15 | SRCBRANCH = "lf-6.1.y" | 17 | SRCBRANCH = "lf-6.1.y" |
16 | LOCALVERSION = "-6.1.36-2.1.0" | 18 | LOCALVERSION = "-6.1.36-2.1.0" |
17 | SRCREV = "04b05c5527e9af8d81254638c307df07dc9a5dd3" | 19 | SRCREV = "04b05c5527e9af8d81254638c307df07dc9a5dd3" |