From 3d2e718c8da29de4fca3b7fd03a2bc0c04f144d5 Mon Sep 17 00:00:00 2001 From: Ryan Eatmon Date: Sat, 10 Jan 2026 10:59:55 -0600 Subject: [PATCH] u-boot: Move the TFA memory location for all k3 platforms In preparation for supporting falcon boot, we are globally moving all k3 memory locations for TFA. Trying to do this platform by platform and only for falcon builds was proving to be onerous, so it was decide to just move it for all Yocto builds. Signed-off-by: Ryan Eatmon --- meta-ti-bsp/conf/machine/include/k3.inc | 5 +++ meta-ti-bsp/conf/machine/include/ti-bsp.inc | 4 +++ .../trusted-firmware-a-ti.inc | 1 + meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 9 ++++++ ...-based-on-KConfig-instead-of-hardcod.patch | 32 +++++++++++++++++++ .../recipes-bsp/u-boot/u-boot/k3_tfa.cfg | 7 ++++ 6 files changed, 58 insertions(+) create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot/0001-env-Make-the-env-based-on-KConfig-instead-of-hardcod.patch create mode 100644 meta-ti-bsp/recipes-bsp/u-boot/u-boot/k3_tfa.cfg diff --git a/meta-ti-bsp/conf/machine/include/k3.inc b/meta-ti-bsp/conf/machine/include/k3.inc index f19db45fa..aebbc8b8e 100644 --- a/meta-ti-bsp/conf/machine/include/k3.inc +++ b/meta-ti-bsp/conf/machine/include/k3.inc @@ -36,6 +36,11 @@ TI_CORE_INITRAMFS_EXTRA_INSTALL:append:bsp-next = " initramfs-module-netsetup" TFA_PLATFORM = "k3" +# Change the default memory location for all k3 devices. This requires an +# in layer config fragment for u-boot. +TFA_K3_PRELOADED_BL33 ?= "${@ '0x82000000' if d.getVar('BSP_TI_K3_TFA_MOVE') else ''}" +TFA_K3_HW_CONFIG_BASE ?= "${@ '0x88000000' if d.getVar('BSP_TI_K3_TFA_MOVE') else ''}" + # Use the expected value of the ubifs filesystem's volume name in the kernel # and u-boot. UBI_VOLNAME = "rootfs" diff --git a/meta-ti-bsp/conf/machine/include/ti-bsp.inc b/meta-ti-bsp/conf/machine/include/ti-bsp.inc index bf90d1da8..0c9122a92 100644 --- a/meta-ti-bsp/conf/machine/include/ti-bsp.inc +++ b/meta-ti-bsp/conf/machine/include/ti-bsp.inc @@ -46,6 +46,8 @@ BSP_ROGUE_DRIVER_PROVIDER:bsp-ti-6_18 = "ti-img-rogue-driver" BSP_ROGUE_DRIVER_VERSION:bsp-ti-6_18 = "26%" BSP_MESA_PVR_VERSION:bsp-ti-6_18 = "25%" +BSP_TI_K3_TFA_MOVE:bsp-ti-6_18 = "1" + # ========== # ti-6_12 # TI staging kernel 6.12, u-boot 2025.01 @@ -95,6 +97,8 @@ BSP_ROGUE_DRIVER_PROVIDER ?= "" BSP_ROGUE_DRIVER_VERSION ?= "" BSP_MESA_PVR_VERSION ?= "" +BSP_TI_K3_TFA_MOVE ?= "" + # ========== # global preferences # ========== diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc index 3d6baec1a..77a0118bc 100644 --- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc +++ b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc @@ -28,4 +28,5 @@ TFA_INSTALL_TARGET:am62lxx = "bl31 bl1" EXTRA_OEMAKE += "${@ 'K3_USART=' + d.getVar('TFA_K3_USART') if d.getVar('TFA_K3_USART') else ''}" EXTRA_OEMAKE += "${@ 'BL32_BASE=' + d.getVar('TFA_K3_BL32_BASE') if d.getVar('TFA_K3_BL32_BASE') else ''}" EXTRA_OEMAKE += "${@ 'PRELOADED_BL33_BASE=' + d.getVar('TFA_K3_PRELOADED_BL33') if d.getVar('TFA_K3_PRELOADED_BL33') else ''}" +EXTRA_OEMAKE += "${@ 'K3_HW_CONFIG_BASE=' + d.getVar('TFA_K3_HW_CONFIG_BASE') if d.getVar('TFA_K3_HW_CONFIG_BASE') else ''}" EXTRA_OEMAKE:append:ti-falcon = " PRELOADED_BL33_BASE=0x82000000 K3_HW_CONFIG_BASE=0x88000000" diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc index 3d6769bfd..7f14b7a78 100644 --- a/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc @@ -28,6 +28,15 @@ SRC_URI = "${UBOOT_GIT_URI};protocol=${UBOOT_GIT_PROTOCOL};${UBOOT_GIT_BRANCH};n SRC_URI:append:bsp-ti-6_12 = " file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch" SRC_URI:append:bsp-ti-6_18 = " file://0001-pylibfdt-Replace-removed-SWIG-Python-2-compatibility.patch" +# Match the meta-ti trusted-firmware-a specific changes to memory locations +# for bl33 and k3 hardware. +TI_K3_TFA_CFG_FILES = "\ + file://k3_tfa.cfg \ + file://0001-env-Make-the-env-based-on-KConfig-instead-of-hardcod.patch \ +" + +SRC_URI:append:k3 = " ${@ '${TI_K3_TFA_CFG_FILES}' if d.getVar('BSP_TI_K3_TFA_MOVE') else ''}" + SRCREV_FORMAT = "uboot" PV:append = "+git" diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot/0001-env-Make-the-env-based-on-KConfig-instead-of-hardcod.patch b/meta-ti-bsp/recipes-bsp/u-boot/u-boot/0001-env-Make-the-env-based-on-KConfig-instead-of-hardcod.patch new file mode 100644 index 000000000..091324b5f --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot/0001-env-Make-the-env-based-on-KConfig-instead-of-hardcod.patch @@ -0,0 +1,32 @@ +From 25569d2b31a4dcb73bb55cffe13c95afd9441987 Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon +Date: Wed, 4 Feb 2026 14:07:39 -0600 +Subject: [PATCH] env: Make the env based on KConfig instead of hardcoded + +testing... + +Upstream-Status: Pending + +Signed-off-by: Ryan Eatmon +--- + include/env/ti/k3_dfu.env | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/env/ti/k3_dfu.env b/include/env/ti/k3_dfu.env +index 2ea8554d413..3a3eb959b94 100644 +--- a/include/env/ti/k3_dfu.env ++++ b/include/env/ti/k3_dfu.env +@@ -25,8 +25,8 @@ dfu_alt_info_ospi= + rootfs raw 0x800000 0x3800000 + + dfu_alt_info_ram= +- tispl.bin ram 0x80080000 0x200000; +- u-boot.img ram 0x81000000 0x400000 ++ tispl.bin ram CONFIG_SPL_TEXT_BASE 0x200000; ++ u-boot.img ram CONFIG_TEXT_BASE 0x400000 + + dfu_alt_info_ospi_nand= + ospi.tiboot3 part 1; +-- +2.43.0 + diff --git a/meta-ti-bsp/recipes-bsp/u-boot/u-boot/k3_tfa.cfg b/meta-ti-bsp/recipes-bsp/u-boot/u-boot/k3_tfa.cfg new file mode 100644 index 000000000..d0cf4367e --- /dev/null +++ b/meta-ti-bsp/recipes-bsp/u-boot/u-boot/k3_tfa.cfg @@ -0,0 +1,7 @@ +CONFIG_TEXT_BASE=0x82f80000 +CONFIG_BLOBLIST_ADDR=0x82c80000 +CONFIG_SPL_TEXT_BASE=0x82000000 +CONFIG_SPL_STACK_R_ADDR=0x83f80000 +CONFIG_SPL_BSS_START_ADDR=0x82c00000 +CONFIG_SPL_LOAD_FIT_ADDRESS=0x82f80000 +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x82b00000