Skip to contentSkip to conversation

Allow falcon boot from R5 SPL on TI's AM62 devices

PATCH In review Anshul Dalal 2 participants 9 messages Oct 31, 2025 – Nov 7, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v10 cover Allow falcon boot from R5 SPL on TI's AM62 devices

Hi all,

This patch set adds support for falcon boot on AM62a, 62p and 62x by bypassing A53 SPL and U-boot.

Existing Boot flow:
R5 SPL -> ATF -> A53 SPL -> U-Boot -> Linux Kernel

Updated flow:
R5 SPL -> ATF -> Linux Kernel

U-Boot's falcon mode expects the jump from SPL to kernel to happen on the same core which is not directly applicable for our heterogeneous platforms since ATF, OPTEE and other non SPL binaries from tispl.bin should be loaded before the kernel by the R5 SPL.

So we have to use a different flow to bypass A53 SPL and U-Boot, we first load the newly added tispl_falcon.bin instead of tispl.bin which lacks u-boot-spl.bin (A53's SPL) and the corresponding fdt. This sets up dm, tifs, optee and atf. Once loaded, we load the kernel and the dtb (with fixups) at ATF's PRELOADED_BL33_BASE and K3_HW_CONFIG_BASE.

NOTE:

Since we're now using the SPL to load the kernel and kernel expects a 2MiB aligned load address, the existing PRELOADED_BL33_BASE has to be changed for ATF to 0x82000000 with K3_HW_CONFIG_BASE set to 0x88000000 for the DTB.

Depends on:
[PATCH v3 0/4] Allow falcon boot from A-core SPL on K3 devices
https://lore.kernel.org/u-boot/[email protected]/

---
Changes in v10:
* Fixed null check for loader
* Expanded commit messages
* Merge [8/8] of last series to [1/8]
* Restructure falcon mode fragment for clarity
v9: https://lore.kernel.org/u-boot/[email protected]/
Changes in v9:
* Update the boot flow diagram in documentation
* Refactor the documentation diagram into am62x_sk.rst
v8: https://lore.kernel.org/u-boot/[email protected]/
Changes in v8:
* Base the series on the recently added support for secure falcon mode
* Split the [8/10] patch of previous series to multiple commits
* Move R5 falcon mode logic from k3/common.c to k3/r5/common.c
* Load tifalcon.bin from rootfs even in raw eMMC boot to simplify usage
* Drop the section on 'SPI usage' in the documentation
v7: https://lore.kernel.org/u-boot/[email protected]/
Changes in v7:
* Replaced AM62a/p documentation with a hyperlink to AM62x's docs
* Made CMD_BOOTZ disabled for TI_SECURE_DEVICE
v6: https://lore.kernel.org/u-boot/[email protected]/
Changes in v6:
* Added A53 build steps in docs
* Had git add SVGs as text instead of blob
* Added memory map for standard boot flow
v5: https://lore.kernel.org/u-boot/[email protected]/
Changes in v5:
* Added documentation
* Moved address for kernel and dtb to 0x82000000 and 0x88000000 respectively
v4: https://lore.kernel.org/u-boot/[email protected]/
Changes in v4:
* Move emmc boot fixes to saperate patch
* Update load address for kernel to 0x82200000
* Add jump_stub config
v3: https://lore.kernel.org/u-boot/[email protected]/
Changes in v3:
* Make tifs load and entry address consistent with tispl for am62a and 62p
* Update loadables order to be same as tispl.bin
* Use rootfs for boot instead of boot partition
* Disable SPL_HAS_BOOTZ to save space
* Add default dtbs for each board in Kconfig
* Fix fdt totalsize in the header before applying fixups
* Update Makefile to clean tispl_falcon.bin on make clean
v2: https://lore.kernel.org/u-boot/[email protected]/
Changes in v2:
* Move to CONFIG_SYS_SPI_*
* Remove the need for CMD_BOOTI
v1: https://lore.kernel.org/u-boot/[email protected]/
---
Anshul Dalal (7):
arm: k3-binman: add tifalcon.bin for falcon mode
configs: add falcon mode fragment for k3 devices
mach-k3: common: enable falcon mode from R5 SPL
mach-k3: common: support only MMC in R5 falcon mode
mach-k3: r5: common: add fdt fixups for falcon mode
mach-k3: r5: common: add bootargs to kernel's dtb
doc: ti: document R5 falcon mode for AM62 platforms

 Makefile                                      |   2 +-
 arch/arm/dts/k3-am625-sk-binman.dtsi          |  64 ++++
 arch/arm/dts/k3-am62a-sk-binman.dtsi          |  51 +++
 arch/arm/dts/k3-am62p-sk-binman.dtsi          |  51 +++
 arch/arm/dts/k3-binman.dtsi                   |  54 +++
 arch/arm/mach-k3/am62ax/am62a7_init.c         |   4 +
 arch/arm/mach-k3/am62px/am62p5_init.c         |   4 +
 arch/arm/mach-k3/am62x/am625_init.c           |   4 +
 arch/arm/mach-k3/common.c                     |   8 +
 arch/arm/mach-k3/common.h                     |   5 +
 arch/arm/mach-k3/r5/common.c                  | 146 ++++++++
 configs/k3_r5_falcon.config                   |  39 +++
 doc/board/ti/am62ax_sk.rst                    |  31 ++
 doc/board/ti/am62px_sk.rst                    |  31 ++
 doc/board/ti/am62x_sk.rst                     | 319 ++++++++++++++++++
 doc/board/ti/img/fitImage_falcon.svg          | 180 ++++++++++
 doc/board/ti/img/tifsstub_dm_tifalcon.bin.svg | 285 ++++++++++++++++
 17 files changed, 1277 insertions(+), 1 deletion(-)
 create mode 100644 configs/k3_r5_falcon.config
 create mode 100644 doc/board/ti/img/fitImage_falcon.svg
 create mode 100644 doc/board/ti/img/tifsstub_dm_tifalcon.bin.svg
Signature · 1 line
2.51.0
#1 lore raw

PATCH v10 1/7 arm: k3-binman: add tifalcon.bin for falcon mode

This patch adds creation of tifalcon.bin for the AM62a, 62p and 62x.

The contents are the same as the existing tispl.bin but A53's SPL and the FDT have been removed as they are not needed in R5 falcon mode.

This reduces boot time since the payload size is smaller compared to the regular tispl.bin.

tispl.bin = TFA + TEE + TIFS-STUB + A53 SPL + FDT
tifalcon.bin = TFA + TEE + TIFS-STUB

---
 Makefile                             |  2 +-
 arch/arm/dts/k3-am625-sk-binman.dtsi | 64 ++++++++++++++++++++++++++++
 arch/arm/dts/k3-am62a-sk-binman.dtsi | 51 ++++++++++++++++++++++
 arch/arm/dts/k3-am62p-sk-binman.dtsi | 51 ++++++++++++++++++++++
 arch/arm/dts/k3-binman.dtsi          | 54 +++++++++++++++++++++++
 5 files changed, 221 insertions(+), 1 deletion(-)
Makefile +1 -1
index 750f8a84b1f..d01cbce8b7a 100644
@@ -2470,7 +2470,7 @@ CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \
 	       idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \
 	       Test* capsule*.*.efi-capsule capsule*.map mkimage.imx-boot.spl \
 	       mkimage.imx-boot.u-boot mkimage-out.imx-boot.spl mkimage-out.imx-boot.u-boot \
-	       imx9image* m33-oei-ddrfw*
+	       imx9image* m33-oei-ddrfw* tifalcon.bin
 
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config include/generated spl tpl vpl \
arch/arm/dts/k3-am625-sk-binman.dtsi +64 -0

70 lines not on this page · raw message

arch/arm/dts/k3-am62a-sk-binman.dtsi +51 -0

57 lines not on this page · raw message

arch/arm/dts/k3-am62p-sk-binman.dtsi +51 -0

57 lines not on this page · raw message

arch/arm/dts/k3-binman.dtsi +54 -0

60 lines not on this page · raw message

Signature · 1 line
2.51.0
#2 lore raw

PATCH v10 2/7 configs: add falcon mode fragment for k3 devices

In reply to Anshul Dalal

This fragment enables falcon mode for K3 platforms and modifies the memory map.

To have enough stack and heap space for loading kernel image as FIT the memory map was modified by expanding stack + heap size, the PRELOADED_BL33_BASE in TFA has to also be updated to 0x82000000 since the kernel needs to be loaded at 2MiB aligned address along with updating K3_HW_CONFIG_BASE to 0x88000000 for the DT passed to kernel.

Modified memory map for R5 SPL (modified addresses marked with *):

0x80000000 +-------------------------------+ Start of DDR
512KiB | TFA reserved memory space | CONFIG_K3_ATF_LOAD_ADDR*
0x80080000 +-------------------------------+
31.5MiB | Unused |
0x82000000 +-------------------------------+ PRELOADED_BL33_BASE* in TFA

           |                               | CONFIG_SYS_LOAD_ADDR*
   57MiB   |   Kernel + initramfs Image    | CONFIG_SPL_LOAD_FIT_ADDRESS*
           |                               |
0x85900000 +-------------------------------+
           |                               |
           |  R5 U-Boot SPL Stack + Heap   |
   39MiB   |       (size defined by        |
           |SPL_STACK_R_MALLOC_SIMPLE_LEN*)|
           |                               |
0x88000000 +-------------------------------+ CONFIG_SPL_STACK_R_ADDR*
           |                               | K3_HW_CONFIG_BASE* in TFA
   16MiB   |          Kernel DTB           | CONFIG_SPL_PAYLOAD_ARGS_ADDR*
           |                               |

0x89000000 +-------------------------------+
331MiB | Device Manager (DM) Load Addr |
0x9db00000 +-------------------------------+
12MiB | DM Reserved |
0x9e700000 +-------------------------------+
1MiB | Unused |
0x9e800000 +-------------------------------+ BL32_BASE in TFA
24MiB | OPTEE |
0xa0000000 +-------------------------------+ End of DDR (512MiB)

---
 configs/k3_r5_falcon.config | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 configs/k3_r5_falcon.config
configs/k3_r5_falcon.config new file +39 -0
new file mode 100644
index 00000000000..b6762b35f74
@@ -0,0 +1,39 @@
+# Enable falcon mode
+CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_OS_BOOT_SECURE=y
+
+# We use envs for setting bootargs
+CONFIG_SPL_ENV_SUPPORT=y
+
+# Allows for the SPL to detect UUID for kernel's rootfs
+CONFIG_SPL_PARTITION_UUIDS=y
+
+# Perform FDT fixups from SPL
+CONFIG_OF_SYSTEM_SETUP=y
+
+# We use the rootfs (i.e partition 2) for booting which is ext4 not FAT
+CONFIG_SYS_MMCSD_FS_BOOT=y
+CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=2
+CONFIG_SPL_FS_EXT4=y
+
+# Loading tifalcon instead of tispl which has FDT and A53 SPL saves time
+CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="boot/tifalcon.bin"
+CONFIG_SPL_FS_LOAD_KERNEL_NAME="boot/fitImage"
+CONFIG_SPL_LOAD_FIT=y
+
+# Used as the 2MiB aligned load address for kernel
+CONFIG_SYS_LOAD_ADDR=0x82000000
+CONFIG_SPL_STACK_R_ADDR=0x88000000
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x82000000
+CONFIG_SPL_PAYLOAD_ARGS_ADDR=0x88000000
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2700000
+
+# Disable all unsupported boot media to save space
+# CONFIG_SPL_SYS_MMCSD_RAW_MODE is not set
+# CONFIG_SPL_SPI_FLASH_SUPPORT is not set
+# CONFIG_SPL_YMODEM_SUPPORT is not set
+# CONFIG_SUPPORT_EMMC_BOOT is not set
+# CONFIG_SPL_NAND_SUPPORT is not set
+# CONFIG_SPL_NOR_SUPPORT is not set
+# CONFIG_SPL_RAM_DEVICE is not set
+# CONFIG_SPL_FS_FAT is not set
Signature · 1 line
2.51.0
#3 lore raw

PATCH v10 3/7 mach-k3: common: enable falcon mode from R5 SPL

In reply to Anshul Dalal

We use the spl_board_prepare_for_boot hook to call k3_r5_falcon_prep which is ran after tispl is loaded but before jump_to_image.

In k3_r5_falcon_prep, we find the boot media and load the kernel FIT just as standard secure falcon mode (since spl_start_uboot returns 0 now). Once the kernel and args are loaded.

Now when the flow goes to jump_to_image, we do the regular pre-jump procedure and jump to TFA which jumps to the kernel directly since we have already loaded the kernel and dtb at their respective addresses (PRELOADED_BL33_BASE and K3_HW_CONFIG_BASE).

Overall execution for the R5 SPL after this patch:

board_init_r

  |-> boot_from_devices
  |   +-> load_image (we load tifalcon.bin here since spl_start_uboot
  |                   returns 1)
  |
  +-> spl_prepare_for_boot
  |   +-> k3_falcon_prep
  |       +-> load_image (we load fitImage here since spl_start_uboot
  |                       returns 0 now)
  |
  +-> jump_to_image
---
 arch/arm/mach-k3/common.c    |  8 +++++++
 arch/arm/mach-k3/common.h    |  4 ++++
 arch/arm/mach-k3/r5/common.c | 46 ++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)
arch/arm/mach-k3/common.c +8 -0
index 04a0f232d84..c446d1c47fd 100644
@@ -360,6 +360,14 @@ void spl_perform_arch_fixups(struct spl_image_info *spl_image)
 
 void spl_board_prepare_for_boot(void)
 {
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT_SECURE) && !IS_ENABLED(CONFIG_ARM64)
+	int ret;
+
+	ret = k3_r5_falcon_prep();
+	if (ret)
+		panic("%s: Failed to boot in falcon mode: %d\n", __func__, ret);
+#endif /* falcon mode on R5 SPL */
+
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 	dcache_disable();
 #endif
arch/arm/mach-k3/common.h +4 -0
index 52d3faaab5c..5807d358464 100644
@@ -52,6 +52,10 @@ void do_board_detect(void);
 void ti_secure_image_check_binary(void **p_image, size_t *p_size);
 int shutdown_mcu_r5_core1(void);
 
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT_SECURE) && !IS_ENABLED(CONFIG_ARM64)
+int k3_r5_falcon_bootmode(void);
+#endif
+
 #if (IS_ENABLED(CONFIG_K3_QOS))
 void setup_qos(void);
 #else
arch/arm/mach-k3/r5/common.c +46 -0

49 lines not on this page · raw message

Signature · 1 line
2.51.0
#4 lore raw

PATCH v10 4/7 mach-k3: common: support only MMC in R5 falcon mode

In reply to Anshul Dalal

To simplify the boot process and prevent the R5 SPL size from growing, this patch restricts the boot media to load the next stage payload (tifalcon.bin and kernel FIT) to MMC only.

We select between eMMC/SD by checking "mmcdev" in env to conform with how U-Boot proper handles loading binaries from MMC1 or MMC2.

Note that tiboot3.bin (the initial bootloader) can be loaded from any boot mode supported by the ROM since the restriction only applies to tifalcon.bin and fitImage.

---
 arch/arm/mach-k3/am62ax/am62a7_init.c |  4 ++++
 arch/arm/mach-k3/am62px/am62p5_init.c |  4 ++++
 arch/arm/mach-k3/am62x/am625_init.c   |  4 ++++
 arch/arm/mach-k3/common.h             |  1 +
 arch/arm/mach-k3/r5/common.c          | 17 ++++++++++++++++-
 5 files changed, 29 insertions(+), 1 deletion(-)
arch/arm/mach-k3/am62ax/am62a7_init.c +4 -0
index 48d578e7d6f..7de23461163 100644
@@ -240,5 +240,9 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
 
 u32 spl_boot_device(void)
 {
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT_SECURE) && !IS_ENABLED(CONFIG_ARM64)
+	return k3_r5_falcon_bootmode();
+#else
 	return get_boot_device();
+#endif
 }
arch/arm/mach-k3/am62px/am62p5_init.c +4 -0
index aebd5200b0d..4c215d5cebe 100644
@@ -375,6 +375,10 @@ u32 spl_boot_device(void)
 	u32 devstat = readl(CTRLMMR_MAIN_DEVSTAT);
 	u32 bootmedia;
 
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT_SECURE) && !IS_ENABLED(CONFIG_ARM64)
+	return k3_r5_falcon_bootmode();
+#endif
+
 	if (bootindex == K3_PRIMARY_BOOTMODE)
 		bootmedia = __get_primary_bootmedia(devstat);
 	else
arch/arm/mach-k3/am62x/am625_init.c +4 -0
index 14f93ac998f..02b7414e21c 100644
@@ -327,5 +327,9 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
 
 u32 spl_boot_device(void)
 {
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT_SECURE) && !IS_ENABLED(CONFIG_ARM64)
+	return k3_r5_falcon_bootmode();
+#else
 	return get_boot_device();
+#endif
 }
arch/arm/mach-k3/common.h +1 -0
index 5807d358464..cd3e19374dc 100644
@@ -54,6 +54,7 @@ int shutdown_mcu_r5_core1(void);
 
 #if IS_ENABLED(CONFIG_SPL_OS_BOOT_SECURE) && !IS_ENABLED(CONFIG_ARM64)
 int k3_r5_falcon_bootmode(void);
+int k3_r5_falcon_prep(void);
 #endif
 
 #if (IS_ENABLED(CONFIG_K3_QOS))
arch/arm/mach-k3/r5/common.c +16 -1
index f0654102737..bf5e7903dcb 100644
@@ -391,6 +391,21 @@ int spl_start_uboot(void)
 	return 0;
 }
 
+int k3_r5_falcon_bootmode(void)
+{
+	char *mmcdev = env_get("mmcdev");
+
+	if (!mmcdev)
+		return BOOT_DEVICE_NOBOOT;
+
+	if (strncmp(mmcdev, "0", sizeof("0")) == 0)
+		return BOOT_DEVICE_MMC1;
+	else if (strncmp(mmcdev, "1", sizeof("1")) == 0)
+		return BOOT_DEVICE_MMC2;
+	else
+		return BOOT_DEVICE_NOBOOT;
+}
+
 int k3_r5_falcon_prep(void)
 {
 	struct spl_image_loader *loader, *drv;
@@ -402,7 +417,7 @@ int k3_r5_falcon_prep(void)
 	memset(&kernel_image, '\0', sizeof(kernel_image));
 	drv = ll_entry_start(struct spl_image_loader, spl_image_loader);
 	n_ents = ll_entry_count(struct spl_image_loader, spl_image_loader);
-	bootdev.boot_device = spl_boot_device();
+	bootdev.boot_device = k3_r5_falcon_bootmode();
 
 	for (loader = drv; loader != drv + n_ents; loader++) {
 		if (loader && bootdev.boot_device != loader->boot_device)
Signature · 1 line
2.51.0
#5 lore raw

PATCH v10 5/7 mach-k3: r5: common: add fdt fixups for falcon mode

In reply to Anshul Dalal

This patch adds fdt fixups to the kernel device-tree in R5 falcon mode, these fixups include fixing up the core-count, reserved-memory etc.

The users can opt out by disabling the respective CONFIG_OF_*_SETUP config options.

---
 arch/arm/mach-k3/r5/common.c | 38 ++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
arch/arm/mach-k3/r5/common.c +38 -0
index bf5e7903dcb..8e002504897 100644
@@ -406,12 +406,43 @@ int k3_r5_falcon_bootmode(void)
 		return BOOT_DEVICE_NOBOOT;
 }
 
+static int k3_falcon_fdt_fixup(void *fdt)
+{
+	int ret;
+
+	if (!fdt)
+		return -EINVAL;
+
+	fdt_set_totalsize(fdt, fdt_totalsize(fdt) + CONFIG_SYS_FDT_PAD);
+
+	if (IS_ENABLED(CONFIG_OF_BOARD_SETUP)) {
+		ret = ft_board_setup(fdt, gd->bd);
+		if (ret) {
+			printf("%s: Failed in board setup: %s\n", __func__,
+			       fdt_strerror(ret));
+			return ret;
+		}
+	}
+
+	if (IS_ENABLED(CONFIG_OF_SYSTEM_SETUP)) {
+		ret = ft_system_setup(fdt, gd->bd);
+		if (ret) {
+			printf("%s: Failed in system setup: %s\n", __func__,
+			       fdt_strerror(ret));
+			return ret;
+		}
+	}
+
+	return 0;
+}
+
 int k3_r5_falcon_prep(void)
 {
 	struct spl_image_loader *loader, *drv;
 	struct spl_image_info kernel_image;
 	struct spl_boot_device bootdev;
 	int ret = -ENXIO, n_ents;
+	void *fdt;
 
 	tifalcon_loaded = true;
 	memset(&kernel_image, '\0', sizeof(kernel_image));
@@ -428,6 +459,13 @@ int k3_r5_falcon_prep(void)
 		if (ret)
 			continue;
 
+		fdt = spl_image_fdt_addr(&kernel_image);
+		ret = k3_falcon_fdt_fixup(fdt);
+		if (ret) {
+			printf("Failed to fixup fdt in falcon mode: %d\n", ret);
+			return ret;
+		}
+
 		return 0;
 	}
 
Signature · 1 line
2.51.0
#6 lore raw

PATCH v10 6/7 mach-k3: r5: common: add bootargs to kernel's dtb

In reply to Anshul Dalal

The bootargs are passed to the kernel in the chosen node, this patch adds support for populating bootargs in the dtb if missing.

The values for kernel boot params is taken from the env, with 'boot' and 'bootpart' specifying the rootfs for the kernel similar to the non-falcon boot flow.

---
 arch/arm/mach-k3/r5/common.c | 47 ++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
arch/arm/mach-k3/r5/common.c +47 -0
index 8e002504897..03638366046 100644
@@ -406,6 +406,46 @@ int k3_r5_falcon_bootmode(void)
 		return BOOT_DEVICE_NOBOOT;
 }
 
+static int k3_falcon_fdt_add_bootargs(void *fdt)
+{
+	struct disk_partition info;
+	struct blk_desc *dev_desc;
+	char bootmedia[32];
+	char bootpart[32];
+	char str[256];
+	int ret;
+
+	strlcpy(bootmedia, env_get("boot"), sizeof(bootmedia));
+	strlcpy(bootpart, env_get("bootpart"), sizeof(bootpart));
+	ret = blk_get_device_part_str(bootmedia, bootpart, &dev_desc, &info, 0);
+	if (ret < 0) {
+		printf("%s: Failed to get part details for %s %s [%d]\n",
+		       __func__, bootmedia, bootpart, ret);
+		return ret;
+	}
+
+	if (!CONFIG_IS_ENABLED(PARTITION_UUIDS)) {
+		printf("ERROR: Failed to find rootfs PARTUUID\n");
+		printf("%s: CONFIG_SPL_PARTITION_UUIDS not enabled\n",
+		       __func__);
+		return -EOPNOTSUPP;
+	}
+
+	snprintf(str, sizeof(str), "console=%s root=PARTUUID=%s rootwait",
+		 env_get("console"), disk_partition_uuid(&info));
+
+	ret = fdt_find_and_setprop(fdt, "/chosen", "bootargs", str,
+				   strlen(str) + 1, 1);
+	if (ret) {
+		printf("%s: Could not set bootargs: %s\n", __func__,
+		       fdt_strerror(ret));
+		return ret;
+	}
+
+	debug("%s: Set bootargs to: %s\n", __func__, str);
+	return 0;
+}
+
 static int k3_falcon_fdt_fixup(void *fdt)
 {
 	int ret;
@@ -415,6 +455,13 @@ static int k3_falcon_fdt_fixup(void *fdt)
 
 	fdt_set_totalsize(fdt, fdt_totalsize(fdt) + CONFIG_SYS_FDT_PAD);
 
+	if (fdt_path_offset(fdt, "/chosen/bootargs") < 0) {
+		ret = k3_falcon_fdt_add_bootargs(fdt);
+
+		if (ret)
+			return ret;
+	}
+
 	if (IS_ENABLED(CONFIG_OF_BOARD_SETUP)) {
 		ret = ft_board_setup(fdt, gd->bd);
 		if (ret) {
Signature · 1 line
2.51.0
#7 lore raw

PATCH v10 7/7 doc: ti: document R5 falcon mode for AM62 platforms

In reply to Anshul Dalal

This patch adds user documentation for R5 falcon mode for AM62 platforms. The main section is added to am62x_sk.rst and other documents just include the relevant sections. Steps to build falcon support, usage and the modified R5 memory map have been documented.

Two svg images have also been added for reference, one for the modified tifalcon.bin and other for the fitImage format specific to R5 falcon mode.

---
 doc/board/ti/am62ax_sk.rst                    |  31 ++
 doc/board/ti/am62px_sk.rst                    |  31 ++
 doc/board/ti/am62x_sk.rst                     | 319 ++++++++++++++++++
 doc/board/ti/img/fitImage_falcon.svg          | 180 ++++++++++
 doc/board/ti/img/tifsstub_dm_tifalcon.bin.svg | 285 ++++++++++++++++
 5 files changed, 846 insertions(+)
 create mode 100644 doc/board/ti/img/fitImage_falcon.svg
 create mode 100644 doc/board/ti/img/tifsstub_dm_tifalcon.bin.svg
doc/board/ti/am62ax_sk.rst +31 -0
index 4dd998bcce9..8eeb90a271b 100644
@@ -187,6 +187,37 @@ https://www.ti.com/lit/pdf/spruj16 under the `Boot Mode Pins` section.
 
 For SW2 and SW1, the switch state in the "ON" position = 1.
 
+Falcon Mode
+-----------
+
+Falcon Mode on AM62ax platforms bypasses the A53 SPL and U-Boot with the overall
+boot flow as below:
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_boot_flow
+    :end-before: .. am62x_evm_falcon_end_boot_flow
+
+Build Process
+^^^^^^^^^^^^^
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_build_process
+    :end-before: .. am62x_evm_falcon_end_build_process
+
+Usage
+^^^^^
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_usage
+    :end-before: .. am62x_evm_falcon_end_usage
+
+R5 SPL Memory Map
+^^^^^^^^^^^^^^^^^
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_r5_memory_map
+    :end-before: .. am62x_evm_falcon_end_r5_memory_map
+
 Debugging U-Boot
 ----------------
 
doc/board/ti/am62px_sk.rst +31 -0
index a07d6a4da45..da70cd58095 100644
@@ -290,6 +290,37 @@ https://www.ti.com/lit/pdf/spruj83 under the `Boot Mode Pins` section.
 
 For SW2 and SW1, the switch state in the "ON" position = 1.
 
+Falcon Mode
+-----------
+
+Falcon Mode on AM62px platforms bypasses the A53 SPL and U-Boot with the overall
+boot flow as below:
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_boot_flow
+    :end-before: .. am62x_evm_falcon_end_boot_flow
+
+Build Process
+^^^^^^^^^^^^^
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_build_process
+    :end-before: .. am62x_evm_falcon_end_build_process
+
+Usage
+^^^^^
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_usage
+    :end-before: .. am62x_evm_falcon_end_usage
+
+R5 SPL Memory Map
+^^^^^^^^^^^^^^^^^
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_start_r5_memory_map
+    :end-before: .. am62x_evm_falcon_end_r5_memory_map
+
 Debugging U-Boot
 ----------------
 
doc/board/ti/am62x_sk.rst +319 -0

325 lines not on this page · raw message

doc/board/ti/img/fitImage_falcon.svg new file +180 -0

180 lines not on this page · raw message

doc/board/ti/img/tifsstub_dm_tifalcon.bin.svg new file +285 -0

285 lines not on this page · raw message

Signature · 1 line
2.51.0
#8 lore raw
In reply to Anshul Dalal
Quoted 10 lines · Anshul Dalal

This patch set adds support for falcon boot on AM62a, 62p and 62x by bypassing A53 SPL and U-boot.

Existing Boot flow:
R5 SPL -> ATF -> A53 SPL -> U-Boot -> Linux Kernel

Updated flow:
R5 SPL -> ATF -> Linux Kernel

[...]

Applied to u-boot/master, thanks!

[1/7] arm: k3-binman: add tifalcon.bin for falcon mode

      commit: 4f9765d943437c9139399c03dfdd7864d8c3488b
[2/7] configs: add falcon mode fragment for k3 devices
      commit: 197459d198c710e9cdab203270be68137ee90955
[3/7] mach-k3: common: enable falcon mode from R5 SPL
      commit: e40c406914aeadbb82cd84fe4d9f48efbcb1c68b
[4/7] mach-k3: common: support only MMC in R5 falcon mode
      commit: 18a3a7a9b82a8f01ca22f5c1979145a28805ad46
[5/7] mach-k3: r5: common: add fdt fixups for falcon mode
      commit: 518d8c1bec4cd78d3dc2ef574ae99f0918913175
[6/7] mach-k3: r5: common: add bootargs to kernel's dtb
      commit: 2da694254df2f061b4f5c7cecbc8a32ce77c6e68
[7/7] doc: ti: document R5 falcon mode for AM62 platforms
      commit: 489ec1ee14a87afa6c8a1a996878c5ac58b6827c
Signature · 1 line
Tom