diff options
| author | Denys Dmytriyenko <denys@konsulko.com> | 2025-07-25 16:49:08 -0400 |
|---|---|---|
| committer | Ryan Eatmon <reatmon@ti.com> | 2025-07-25 16:08:55 -0500 |
| commit | 3fd46742645be6be766558ae6431e561e483fedb (patch) | |
| tree | 286ad1fe5a7391c5c760e1e2d27085a2dc46463f | |
| parent | 5e8eca8bfd4fa345af36c9b74212811359f4898d (diff) | |
| download | meta-ti-3fd46742645be6be766558ae6431e561e483fedb.tar.gz | |
meta-ti-bsp: convert DTB prefix matching into class
Convert devicetree prefix matching functionality into a generic
class that can be used by the kernel and wic images. That way
dynamically generated KERNEL_DEVICETREE list will be the same
when populating /boot dir of rootfs and/or FAT boot partition
of a wic image.
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
| -rw-r--r-- | meta-ti-bsp/classes/ti-devicetree-prefix.bbclass (renamed from meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc) | 7 | ||||
| -rw-r--r-- | meta-ti-bsp/conf/machine/include/ti-soc.inc | 8 | ||||
| -rw-r--r-- | meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb | 2 | ||||
| -rw-r--r-- | meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb | 1 | ||||
| -rw-r--r-- | meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb | 1 |
5 files changed, 13 insertions, 6 deletions
diff --git a/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc b/meta-ti-bsp/classes/ti-devicetree-prefix.bbclass index 2d7be280..5858cc65 100644 --- a/meta-ti-bsp/recipes-kernel/linux/ti-kernel-devicetree-prefix.inc +++ b/meta-ti-bsp/classes/ti-devicetree-prefix.bbclass | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | # Generate list of DTBs from the kernel source | ||
| 1 | def get_dtbs_from_kernel(dts_dir, dts_prefix): | 2 | def get_dtbs_from_kernel(dts_dir, dts_prefix): |
| 2 | import os | 3 | import os |
| 3 | import glob | 4 | import glob |
| @@ -17,6 +18,8 @@ def get_dtbs_from_kernel(dts_dir, dts_prefix): | |||
| 17 | matches.append(filename) | 18 | matches.append(filename) |
| 18 | return ' '.join(matches) | 19 | return ' '.join(matches) |
| 19 | 20 | ||
| 21 | # Generate list of "merged" DTBs from the kernel source | ||
| 22 | # It is TI custom feature to merge DTB overlays into a single DTB | ||
| 20 | def get_merge_dtbs_from_kernel(dts_dir, dts_pattern): | 23 | def get_merge_dtbs_from_kernel(dts_dir, dts_pattern): |
| 21 | import os | 24 | import os |
| 22 | matches = [] | 25 | matches = [] |
| @@ -32,9 +35,9 @@ def get_merge_dtbs_from_kernel(dts_dir, dts_pattern): | |||
| 32 | matches.append(pattern) | 35 | matches.append(pattern) |
| 33 | return ' '.join(matches) | 36 | return ' '.join(matches) |
| 34 | 37 | ||
| 35 | KERNEL_DEVICETREE_DTBMERGE ?= "" | ||
| 36 | |||
| 37 | KERNEL_DEVICETREE = " \ | 38 | KERNEL_DEVICETREE = " \ |
| 38 | ${@get_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} \ | 39 | ${@get_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_PREFIX}')} \ |
| 39 | ${@get_merge_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_DTBMERGE}')} \ | 40 | ${@get_merge_dtbs_from_kernel('${STAGING_KERNEL_DIR}/arch/${ARCH}/boot/dts/', '${KERNEL_DEVICETREE_DTBMERGE}')} \ |
| 40 | " | 41 | " |
| 42 | |||
| 43 | do_image_wic[depends] += "virtual/kernel:do_shared_workdir" | ||
diff --git a/meta-ti-bsp/conf/machine/include/ti-soc.inc b/meta-ti-bsp/conf/machine/include/ti-soc.inc index 85f6f338..018e9bfb 100644 --- a/meta-ti-bsp/conf/machine/include/ti-soc.inc +++ b/meta-ti-bsp/conf/machine/include/ti-soc.inc | |||
| @@ -19,3 +19,11 @@ KERNEL_DTBVENDORED = "1" | |||
| 19 | 19 | ||
| 20 | # Also build a non-vendored list w/o dir structure | 20 | # Also build a non-vendored list w/o dir structure |
| 21 | DEVICETREE_FILES = "${@' '.join([os.path.basename(f) for f in d.getVar("KERNEL_DEVICETREE").split()])}" | 21 | DEVICETREE_FILES = "${@' '.join([os.path.basename(f) for f in d.getVar("KERNEL_DEVICETREE").split()])}" |
| 22 | |||
| 23 | KERNEL_DEVICETREE_DTBMERGE ?= "" | ||
| 24 | |||
| 25 | # Dynamically build DTBs list based on prefix matching | ||
| 26 | CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''}" | ||
| 27 | |||
| 28 | KERNEL_CLASSES += "${CLASS_DEVICETREE_PREFIX}" | ||
| 29 | IMAGE_CLASSES += "${CLASS_DEVICETREE_PREFIX}" | ||
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb index 1feb7564..60b647f1 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-next_git.bb | |||
| @@ -2,8 +2,6 @@ require linux-ti-mainline_git.bb | |||
| 2 | 2 | ||
| 3 | SUMMARY = "Linux-next kernel for TI devices" | 3 | SUMMARY = "Linux-next kernel for TI devices" |
| 4 | 4 | ||
| 5 | include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''} | ||
| 6 | |||
| 7 | # 6.6.0-rc3+ version | 5 | # 6.6.0-rc3+ version |
| 8 | SRCREV = "6465e260f48790807eef06b583b38ca9789b6072" | 6 | SRCREV = "6465e260f48790807eef06b583b38ca9789b6072" |
| 9 | PV = "6.6.0-rc3+git" | 7 | PV = "6.6.0-rc3+git" |
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb index 9235cbc5..aa677cb2 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.12.bb | |||
| @@ -8,7 +8,6 @@ inherit kernel | |||
| 8 | 8 | ||
| 9 | require recipes-kernel/linux/setup-defconfig.inc | 9 | require recipes-kernel/linux/setup-defconfig.inc |
| 10 | require recipes-kernel/linux/ti-kernel.inc | 10 | require recipes-kernel/linux/ti-kernel.inc |
| 11 | include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''} | ||
| 12 | include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''} | 11 | include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''} |
| 13 | 12 | ||
| 14 | DEPENDS += "gmp-native libmpc-native" | 13 | DEPENDS += "gmp-native libmpc-native" |
diff --git a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb index 17bcd300..d6985b27 100644 --- a/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb +++ b/meta-ti-bsp/recipes-kernel/linux/linux-ti-staging_6.6.bb | |||
| @@ -8,7 +8,6 @@ inherit kernel | |||
| 8 | 8 | ||
| 9 | require recipes-kernel/linux/setup-defconfig.inc | 9 | require recipes-kernel/linux/setup-defconfig.inc |
| 10 | require recipes-kernel/linux/ti-kernel.inc | 10 | require recipes-kernel/linux/ti-kernel.inc |
| 11 | include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''} | ||
| 12 | include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''} | 11 | include ${@ 'recipes-kernel/linux/ti-extras.inc' if d.getVar('TI_EXTRAS') else ''} |
| 13 | 12 | ||
| 14 | DEPENDS += "gmp-native libmpc-native" | 13 | DEPENDS += "gmp-native libmpc-native" |
