diff mbox series

[meta-ti,master,v2] ti-core-initramfs: Rework logic

Message ID 20260211220333.1979383-1-reatmon@ti.com
State New
Headers show
Series [meta-ti,master,v2] ti-core-initramfs: Rework logic | expand

Commit Message

Ryan Eatmon Feb. 11, 2026, 10:03 p.m. UTC
Clean up the logic of the new ti-core-initramfs to reduce the impact on
downstream layers.

- Flip the logic in the machine .conf files to track the list of
  required kernel modules for that platform, but if the variable is set
  to "" then the ti-core-initramfs will not be created.

- Redo the logic of when we require creation/usage of the initramfs to
  just platforms that need it (ie that set TI_CORE_INITRAMFS_KERNEL_MODULES).

- Add a big switch to disable the initramfs entirely.  In that case, the
  user is on their own to make sure that the kernel has everything it
  needs to boot either via config fragments to turn on the needed
  modules, or by using the TI_CORE_INITRAMFS_KERNEL_MODULES
  variable to populate their own initramfs.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
v2: Fix default value for TI_CORE_INITRAMFS_ENABLED.

 meta-ti-bsp/conf/machine/include/am62axx.inc  |  6 ++--
 meta-ti-bsp/conf/machine/include/j721e.inc    |  6 ++--
 meta-ti-bsp/conf/machine/include/j784s4.inc   |  6 ++--
 .../machine/include/ti-core-initramfs.inc     | 29 +++++++++++++++++++
 meta-ti-bsp/conf/machine/include/ti-soc.inc   | 20 +------------
 .../packagegroup-ti-core-initramfs.bb         |  4 +--
 6 files changed, 41 insertions(+), 30 deletions(-)
 create mode 100644 meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc

Comments

PRC Automation Feb. 11, 2026, 10:12 p.m. UTC | #1
meta-ti / na / 20260211220333.1979383-1-reatmon

PRC Results: PASS

=========================================================
  check-yocto-patches: PASS
=========================================================
Patches
----------------------------------------
All patches passed



=========================================================
  apply-yocto-patch: PASS
=========================================================
master
=====================
Summary:
- Patch Series: [meta-ti][master][PATCH v2] ti-core-initramfs: Rework logic
- Submitter: From: Ryan Eatmon <reatmon@ti.com>
- Date: Date: Wed, 11 Feb 2026 16:03:33 -0600
- Num Patches: 1
- Mailing List (public inbox) Commit SHA: ec077e88353f93918738afcc23f88a7d2f8ef77b

Applied to:
- Repository: lcpd-prc-meta-ti
- Base Branch: master-next
- Commit Author: Ryan Eatmon <reatmon@ti.com>
- Commit Subject: u-boot: Update ECDSA signing make option
- Commit SHA: c0e80f86dec421d7518f47617c970eec6630640e

Patches
----------------------------------------
All patches applied



=========================================================
  check-yocto-repo: PASS
=========================================================
master
=====================
PASS



=========================================================
  yocto-check-layers: PASS
=========================================================
master - PASS
=====================
All checks passed
diff mbox series

Patch

diff --git a/meta-ti-bsp/conf/machine/include/am62axx.inc b/meta-ti-bsp/conf/machine/include/am62axx.inc
index 1fd4a1ac..0577ffaa 100644
--- a/meta-ti-bsp/conf/machine/include/am62axx.inc
+++ b/meta-ti-bsp/conf/machine/include/am62axx.inc
@@ -12,6 +12,6 @@  OPTEEMACHINE = "k3-am62x"
 
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cnm-wave-fw"
 
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-ti-6_18 = " kernel-module-tps6594-i2c kernel-module-tps6594-regulator kernel-module-tps6594-core"
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-tps6594-i2c kernel-module-tps6594-regulator kernel-module-tps6594-core"
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-tps6594-i2c kernel-module-tps6594-regulator kernel-module-tps6594-core"
+TI_CORE_INITRAMFS_KERNEL_MODULES = "kernel-module-tps6594-i2c kernel-module-tps6594-regulator kernel-module-tps6594-core"
+TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_6 = ""
+TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_12 = ""
diff --git a/meta-ti-bsp/conf/machine/include/j721e.inc b/meta-ti-bsp/conf/machine/include/j721e.inc
index f329e269..3e4fbf17 100644
--- a/meta-ti-bsp/conf/machine/include/j721e.inc
+++ b/meta-ti-bsp/conf/machine/include/j721e.inc
@@ -21,6 +21,6 @@  TI_VXE_VXD_DRIVER:bsp-ti-6_18 = ""
 
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw vxd-dec-fw ti-eth-fw-j721e ${TI_VXE_VXD_DRIVER}"
 
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-ti-6_18 = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
+TI_CORE_INITRAMFS_KERNEL_MODULES = "kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
+TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_6 = ""
+TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_12 = ""
diff --git a/meta-ti-bsp/conf/machine/include/j784s4.inc b/meta-ti-bsp/conf/machine/include/j784s4.inc
index 42c95b11..4dc3a71b 100644
--- a/meta-ti-bsp/conf/machine/include/j784s4.inc
+++ b/meta-ti-bsp/conf/machine/include/j784s4.inc
@@ -14,6 +14,6 @@  OPTEEMACHINE = "k3-j784s4"
 
 MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "cadence-mhdp-fw cnm-wave-fw ti-eth-fw-j784s4"
 
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-ti-6_18 = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-mainline = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
-TI_INITRAMFS_KERNEL_MODULES:append:bsp-next = " kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
+TI_CORE_INITRAMFS_KERNEL_MODULES = "kernel-module-cdns-pltfrm kernel-module-ti-j721e-ufs"
+TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_6 = ""
+TI_CORE_INITRAMFS_KERNEL_MODULES:bsp-ti-6_12 = ""
diff --git a/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc b/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc
new file mode 100644
index 00000000..5fe78202
--- /dev/null
+++ b/meta-ti-bsp/conf/machine/include/ti-core-initramfs.inc
@@ -0,0 +1,29 @@ 
+#------------------------------------------------------------------------------
+#
+# To turn off the ti-core-initramfs.cpio creation just set:
+#
+#   TI_CORE_INITRAMFS_ENABLED = "0"
+#
+#------------------------------------------------------------------------------
+TI_CORE_INITRAMFS_ENABLED ?= "1"
+
+TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
+
+TI_CORE_INITRAMFS_IMAGE = "ti-core-initramfs"
+TI_CORE_INITRAMFS_IMAGE_FILE = "${TI_CORE_INITRAMFS_IMAGE}.cpio.xz"
+
+#------------------------------------------------------------------------------
+# Only enable the initramf code if TI_CORE_INITRAMFS_KERNEL_MODULES is set.
+#------------------------------------------------------------------------------
+TI_CORE_INITRAMFS_DO_IMAGE_WIC = "${@ '${TI_CORE_INITRAMFS_IMAGE}:do_image_complete' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') else ''}"
+TI_CORE_INITRAMFS_WKS_FLAG = "${@ ',initrd=${TI_CORE_INITRAMFS_IMAGE_FILE}' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') else ''}"
+TI_CORE_INITRAMFS_IMAGE_BOOT_FILES = "${@ '${TI_CORE_INITRAMFS_IMAGE_FILE}' if d.getVar('TI_CORE_INITRAMFS_KERNEL_MODULES') else ''}"
+
+#------------------------------------------------------------------------------
+# Apply all of the needed changes to create/use the initramfs (if enabled).
+#------------------------------------------------------------------------------
+do_image_wic[depends] += "${@ '${TI_CORE_INITRAMFS_DO_IMAGE_WIC}' if d.getVar('TI_CORE_INITRAMFS_ENABLED') == "1" else ''}"
+
+TI_WKS_INITRAMFS ?= "${@ '${TI_CORE_INITRAMFS_WKS_FLAG}' if d.getVar('TI_CORE_INITRAMFS_ENABLED') == "1" else ''}"
+
+IMAGE_BOOT_FILES += "${@ '${TI_CORE_INITRAMFS_IMAGE_BOOT_FILES}' if d.getVar('TI_CORE_INITRAMFS_ENABLED') == "1" else ''}"
diff --git a/meta-ti-bsp/conf/machine/include/ti-soc.inc b/meta-ti-bsp/conf/machine/include/ti-soc.inc
index 74346430..c4472113 100644
--- a/meta-ti-bsp/conf/machine/include/ti-soc.inc
+++ b/meta-ti-bsp/conf/machine/include/ti-soc.inc
@@ -3,6 +3,7 @@ 
 SOC_FAMILY = "ti-soc"
 require conf/machine/include/soc-family.inc
 require conf/machine/include/ti-extras.inc
+require conf/machine/include/ti-core-initramfs.inc
 
 # kernel, initrd load addresses for the fitImage in all TI platforms
 UBOOT_ENTRYPOINT = "0x82000000"
@@ -28,22 +29,3 @@  CLASS_DEVICETREE_PREFIX = "${@ 'ti-devicetree-prefix' if d.getVar('KERNEL_DEVICE
 
 KERNEL_CLASSES += "${CLASS_DEVICETREE_PREFIX}"
 IMAGE_CLASSES += "${CLASS_DEVICETREE_PREFIX}"
-
-BUILD_CORE_INITRAMFS_IMAGE = "ti-core-initramfs"
-BUILD_CORE_INITRAMFS_IMAGE_FILE = "${BUILD_CORE_INITRAMFS_IMAGE}.cpio.xz"
-
-BUILD_CORE_INITRAMFS_IMAGE_STEP ?= ""
-BUILD_CORE_INITRAMFS_IMAGE_STEP:bsp-ti-6_18 = "${BUILD_CORE_INITRAMFS_IMAGE}:do_image_complete"
-BUILD_CORE_INITRAMFS_IMAGE_STEP:bsp-mainline = "${BUILD_CORE_INITRAMFS_IMAGE}:do_image_complete"
-BUILD_CORE_INITRAMFS_IMAGE_STEP:bsp-next = "${BUILD_CORE_INITRAMFS_IMAGE}:do_image_complete"
-
-do_image_wic[depends] += "${BUILD_CORE_INITRAMFS_IMAGE_STEP}"
-
-TI_WKS_INITRAMFS ?= ""
-TI_WKS_INITRAMFS:bsp-ti-6_18 = ",initrd=${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
-TI_WKS_INITRAMFS:bsp-mainline = ",initrd=${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
-TI_WKS_INITRAMFS:bsp-next = ",initrd=${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
-
-IMAGE_BOOT_FILES:append:bsp-ti-6_18 = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
-IMAGE_BOOT_FILES:append:bsp-mainline = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
-IMAGE_BOOT_FILES:append:bsp-next = " ${BUILD_CORE_INITRAMFS_IMAGE_FILE}"
diff --git a/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb b/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb
index c759808c..aae63495 100644
--- a/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb
+++ b/meta-ti-bsp/recipes-ti/initramfs/packagegroup-ti-core-initramfs.bb
@@ -6,10 +6,10 @@  PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 inherit packagegroup
 
-TI_INITRAMFS_KERNEL_MODULES ?= ""
+TI_CORE_INITRAMFS_KERNEL_MODULES ?= ""
 
 RDEPENDS:${PN} += "\
-    ${TI_INITRAMFS_KERNEL_MODULES} \
+    ${TI_CORE_INITRAMFS_KERNEL_MODULES} \
     ${VIRTUAL-RUNTIME_base-utils} \
     base-passwd \
     initramfs-framework-base \