add support for falcon mode builds
v3 cover add support for falcon mode builds
Falcon mode[1] in u-boot enables us to bypass proper u-boot when booting hence reducing boot time.
This patch set adds support for falcon mode on am62 evms depending on the ti-falcon distro override which can be added by appending to local.conf with the follows:
DISTROOVERRIDES:append = ":ti-falcon"
Build process remains un-changed if the override is not present.
The override enables the usage of the falcon config fragment during r5 build process as well as deploying the associated tispl_falcon.bin to rootfs's boot directory.
For secure boot since the R5 core is slower compared to A53 cores, authenticating as well as decompressing the signed fitImage from oe-core takes multiple seconds, therefore we opt for using legacyhs-fitimage instead which allows the authentication to be deferred to tifs.
[1]:
https://docs.u-boot.org/en/latest/develop/falcon.html
---
Changes in v3:
* Better handling of u-boot-ti-staging-falcon package for non ti-falcon builds
* Add TFA build commands since upstream changes were rejected:
https://lore.kernel.org/u-boot/20250417113013.mrlhl65farooaiq2@extradite/
v2:
https://lore.kernel.org/yocto-meta-ti/[email protected]/
Changes in v2:
* Add cover letter describing the patch set
* Add default empty string for 'FALCON_INCLUDE' preventing recipie parsing error when ti-falcon is not set
v1:
https://lore.kernel.org/yocto-meta-ti/[email protected]/
Anshul Dalal (4):
am62: apply u-boot config fragment on ti-falcon
bsp: conf: machine: add ti-falcon.inc
bsp: u-boot: deploy tispl_falcon.bin to rootfs
bsp: tfa: add build flags for ti-falcon
meta-ti-bsp/conf/machine/am62axx-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/am62pxx-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/am62xx-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/am62xx-lp-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/include/k3.inc | 5 +++++ meta-ti-bsp/conf/machine/include/ti-falcon.inc | 6 ++++++ .../trusted-firmware-a/trusted-firmware-a-ti.inc | 1 + meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 14 ++++++++++++++ 8 files changed, 34 insertions(+) create mode 100644 meta-ti-bsp/conf/machine/include/ti-falcon.inc
PATCH v3 1/4 am62: apply u-boot config fragment on ti-falcon
The am62x_r5_falcon.config fragment in u-boot enables falcon boot support for R5 SPL, this patch enables the config fragment for am62a, 62p, 62x and 62lp evms based on ti-falcon distro override.
--- meta-ti-bsp/conf/machine/am62axx-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/am62pxx-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/am62xx-evm-k3r5.conf | 2 ++ meta-ti-bsp/conf/machine/am62xx-lp-evm-k3r5.conf | 2 ++ 4 files changed, 8 insertions(+)
meta-ti-bsp/conf/machine/am62axx-evm-k3r5.conf +2 -0
@@ -9,3 +9,5 @@ SYSFW_CONFIG = "evm" SYSFW_SUFFIX = "hs-fs" UBOOT_MACHINE = "am62ax_evm_r5_defconfig" + +UBOOT_CONFIG_FRAGMENTS:ti-falcon = "am62x_r5_falcon.config"
meta-ti-bsp/conf/machine/am62pxx-evm-k3r5.conf +2 -0
@@ -10,3 +10,5 @@ SYSFW_CONFIG = "evm" SYSFW_SUFFIX = "hs-fs" UBOOT_MACHINE = "am62px_evm_r5_defconfig" + +UBOOT_CONFIG_FRAGMENTS:ti-falcon = "am62x_r5_falcon.config"
meta-ti-bsp/conf/machine/am62xx-evm-k3r5.conf +2 -0
@@ -10,3 +10,5 @@ SYSFW_CONFIG = "evm" SYSFW_SUFFIX = "hs-fs" UBOOT_MACHINE = "am62x_evm_r5_defconfig" + +UBOOT_CONFIG_FRAGMENTS:ti-falcon = "am62x_r5_falcon.config"
meta-ti-bsp/conf/machine/am62xx-lp-evm-k3r5.conf +2 -0
@@ -10,3 +10,5 @@ SYSFW_CONFIG = "evm" SYSFW_SUFFIX = "hs-fs" UBOOT_MACHINE = "am62x_lpsk_r5_defconfig" + +UBOOT_CONFIG_FRAGMENTS:ti-falcon = "am62x_r5_falcon.config"
PATCH v3 2/4 bsp: conf: machine: add ti-falcon.inc
In reply to Anshul Dalalti-falcon.inc configures the following things for enabling falcon boot:
1. Change fitImage class to kernel-fitimage-legacyhs
2. Update kernel and dtb address for falcon boot
3. Disable kernel compression
--- meta-ti-bsp/conf/machine/include/k3.inc | 5 +++++ meta-ti-bsp/conf/machine/include/ti-falcon.inc | 5 +++++ meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 12 ++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 meta-ti-bsp/conf/machine/include/ti-falcon.inc
meta-ti-bsp/conf/machine/include/k3.inc +5 -0
@@ -56,3 +56,8 @@ TI_WKS_BOOTLOADER_APPEND ?= "" do_image_wic[depends] += "virtual/bootloader:do_deploy" SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS2" + +FALCON_INCLUDE = "" +FALCON_INCLUDE:ti-falcon = "conf/machine/include/ti-falcon.inc" + +require ${FALCON_INCLUDE}
meta-ti-bsp/conf/machine/include/ti-falcon.inc new file +5 -0
@@ -0,0 +1,5 @@ +KERNEL_CLASSES:remove = "kernel-fitimage" +KERNEL_CLASSES += "kernel-fitimage-legacyhs" +UBOOT_DTB_LOADADDRESS = "0x88000000" +UBOOT_LOADADDRESS = "0x82000000" +FIT_KERNEL_COMP_ALG = "none"
meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc +12 -0
@@ -373,4 +373,16 @@ do_deploy:append:am62pxx() { install -m 0644 ${S}/tools/logos/ti_logo_414x97_32bpp.bmp.gz ${DEPLOYDIR} } +do_install:append:ti-falcon() { + install -m 0644 ${B}/tispl_falcon.bin ${D}/boot +} + +FALCON_PKG = "" +FALCON_PKG:ti-falcon = "${PN}-falcon " + +PACKAGES:prepend:am62xx-evm = "${FALCON_PKG} " +PACKAGES:prepend:am62axx-evm = "${FALCON_PKG} " +PACKAGES:prepend:am62pxx-evm = "${FALCON_PKG} " +PACKAGES:prepend:am62xx-lp-evm = "${FALCON_PKG} " + TOOLCHAIN = "gcc"
PATCH v3 3/4 bsp: u-boot: deploy tispl_falcon.bin to rootfs
In reply to Anshul DalalFalcon boot requires tispl_falcon.bin to be on the same filesystem partition as the fitImage.
This patch creates a new u-boot package called 'u-boot-ti-staging-falcon' that is included in IMAGE_INSTALL when ti-falcon is enabled which allows us to deploy the required files to rootfs.
--- meta-ti-bsp/conf/machine/include/ti-falcon.inc | 1 + meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc | 2 ++ 2 files changed, 3 insertions(+)
meta-ti-bsp/conf/machine/include/ti-falcon.inc +1 -0
@@ -1,3 +1,4 @@ +IMAGE_INSTALL:append = " u-boot-ti-staging-falcon" KERNEL_CLASSES:remove = "kernel-fitimage" KERNEL_CLASSES += "kernel-fitimage-legacyhs" UBOOT_DTB_LOADADDRESS = "0x88000000"
meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc +2 -0
@@ -14,6 +14,8 @@ require u-boot-mergeconfig.inc FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:" +FILES:${PN}-falcon = "boot/tispl_falcon.bin" + SUMMARY = "u-boot bootloader for TI devices" LICENSE = "GPL-2.0-or-later"
PATCH v3 4/4 bsp: tfa: add build flags for ti-falcon
In reply to Anshul DalalIn falcon mode, ATF jumps straight to the linux kernel which requires a 2MiB aligned load address. Hence this patch changes the ATF jump address (PRELOADED_BL33_BASE) to a 2MiB aligned value 0x82000000 and the DTB address (K3_HW_CONFIG_BASE) to 0x88000000.
These values are chosen to be consistent with the addresses used by u-boot when booting in the normal flow.
--- .../recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc | 1 + 1 file changed, 1 insertion(+)
meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-ti.inc +1 -0
@@ -19,3 +19,4 @@ TFA_SPD:am62lxx = "" EXTRA_OEMAKE += "${@ 'K3_USART=' + d.getVar('TFA_K3_USART') if d.getVar('TFA_K3_USART') else ''}" EXTRA_OEMAKE += "${@ 'K3_PM_SYSTEM_SUSPEND=' + d.getVar('TFA_K3_SYSTEM_SUSPEND') if d.getVar('TFA_K3_SYSTEM_SUSPEND') else ''}" +EXTRA_OEMAKE:append:ti-falcon = " PRELOADED_BL33_BASE=0x82000000 K3_HW_CONFIG_BASE=0x88000000"