Skip to contentSkip to conversation

linux-ti-staging: Add extra dtc flags to support dtb overlays

PATCH New Yogesh Siraswar 1 participant 1 message May 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 linux-ti-staging: Add extra dtc flags to support dtb overlays

Added KERNEL_DTB_OVERLAY_SUPPORT to common ti-soc include. This fixes the issue where the dtbs are build without symbols causing issue with overlays.

Please note this increases the size of the dtb for all platform derived from ti-soc. So for custom boards disable it from local.conf to reduce size.

---
Changes:
Moved the KERNEL_DTB_OVERLAY_SUPPORT to common ti-soc.inc This makes it more maintainable and with weak assignement can be override from local.conf

 conf/machine/include/ti-soc.inc               | 1 +
 recipes-kernel/linux/linux-ti-mainline_git.bb | 6 ++++--
 recipes-kernel/linux/linux-ti-staging_5.10.bb | 6 ++++--
 recipes-kernel/linux/ti-kernel.inc            | 9 +++++++++
 4 files changed, 18 insertions(+), 4 deletions(-)
 create mode 100644 recipes-kernel/linux/ti-kernel.inc
conf/machine/include/ti-soc.inc +1 -0
index 227d8972..2792d2a0 100644
@@ -1,4 +1,5 @@
 # This is a generic TI SOC family. It is a superset of all other SOCs
 # and platforms defined in meta-ti to allow BSP-level overrides.
 SOC_FAMILY = "ti-soc"
+KERNEL_DTB_OVERLAY_SUPPORT ?= "1"
 require conf/machine/include/soc-family.inc
recipes-kernel/linux/linux-ti-mainline_git.bb +4 -2
index fc16485d..6770adca 100644
@@ -8,10 +8,12 @@ inherit kernel
 DEFCONFIG_BUILDER = "${WORKDIR}/ti-upstream-tools/config/defconfig_builder.sh"
 require recipes-kernel/linux/setup-defconfig.inc
 require recipes-kernel/linux/kernel-rdepends.inc
+require recipes-kernel/linux/ti-kernel.inc
 
 DEPENDS += "gmp-native"
 
-KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
+KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT} \
+		      ${EXTRA_DTC_ARGS}"
 
 S = "${WORKDIR}/git"
 
@@ -23,7 +25,7 @@ SRCREV = "9f4ad9e425a1d3b6a34617b8ea226d56a119a717"
 PV = "5.12+git${SRCPV}"
 
 # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild
-MACHINE_KERNEL_PR_append = "a"
+MACHINE_KERNEL_PR_append = "b"
 PR = "${MACHINE_KERNEL_PR}"
 
 KERNEL_GIT_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
recipes-kernel/linux/linux-ti-staging_5.10.bb +4 -2
index 4ec19af7..0a134f93 100644
@@ -11,11 +11,13 @@ require recipes-kernel/linux/cmem.inc
 require recipes-kernel/linux/ti-uio.inc
 require recipes-kernel/linux/bundle-devicetree.inc
 require recipes-kernel/linux/kernel-rdepends.inc
+require recipes-kernel/linux/ti-kernel.inc
 
 # Look in the generic major.minor directory for files
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-5.10:"
 
-KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"
+KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT} \
+		      ${EXTRA_DTC_ARGS}"
 
 S = "${WORKDIR}/git"
 
@@ -25,7 +27,7 @@ SRCREV = "d85aee3e19aa7403bd157d2ae30917e736096a7f"
 PV = "5.10.30+git${SRCPV}"
 
 # Append to the MACHINE_KERNEL_PR so that a new SRCREV will cause a rebuild
-MACHINE_KERNEL_PR_append = "a"
+MACHINE_KERNEL_PR_append = "b"
 PR = "${MACHINE_KERNEL_PR}"
 
 KERNEL_GIT_URI = "git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git"
recipes-kernel/linux/ti-kernel.inc new file +9 -0
new file mode 100644
index 00000000..a7eb476e
@@ -0,0 +1,9 @@
+# Add DTC FLAGS -@ when KERNEL_DTB_OVERLAY_SUPPORT is enabled
+
+def get_extra_dtc_args(d):
+    if d.getVar('KERNEL_DTB_OVERLAY_SUPPORT') == "1":
+        return "DTC_FLAGS=-@"
+    else:
+        return ""
+
+EXTRA_DTC_ARGS += "${@get_extra_dtc_args(d)}"
Signature · 1 line
2.17.1