Skip to contentSkip to conversation

Add falcon support for am62a, 62p and 62x

PATCH Superseded Anshul Dalal 3 participants 20 messages Apr 28, 2025 – May 30, 2025

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add falcon support for am62a, 62p and 62x

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 flow 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 non std 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.

---
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]/

Andreas Dannenberg (1):
arch: arm: mach-k3: r5: am62ax: Update SoC auto-gen data to enable
CPSW boot

Anshul Dalal (1):
spl: Kconfig: allow K3 devices to use falcon mode

Daniel Schultz (1):
arch: arm: dts: k3-am62a7-phyboard-lyra-rdk-u-boot: Disable Ethernet2

Nathan Morrisson (2):
arch: arm: mach-k3: am62a7: Probe CPSW NUSS in board_init_f()
board: phytec: phycore_am62ax: Share ethernet resources with boot r5
core

Wadim Egorov (4):
arm: dts: k3-am625-phyboard-lyra-rdk: Add boot phase tag to
phy_gmii_sel
configs: Add phycore_am62x_r5_ethboot_defconfig
configs: phycore_am62x_a53_defconfig: Update for ethernet boot
configs: Add phycore_am62ax_r5_ethboot_defconfig

Signature · 1 line
2.49.0
#1 lore raw

PATCH v6 1/9 spl: Kconfig: allow K3 devices to use falcon mode

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

For secure boot, the kernel with x509 headers can be packaged in a fit container (fitImage) signed with TIFS keys for authentication.

---
 common/spl/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/Kconfig +1 -1
index c08045f9c8d..68e900e9b91 100644
@@ -1165,7 +1165,7 @@ config SPL_ONENAND_SUPPORT
 
 config SPL_OS_BOOT
 	bool "Activate Falcon Mode"
-	depends on !TI_SECURE_DEVICE
+	depends on !TI_SECURE_DEVICE || ARCH_K3
 	help
 	  Enable booting directly to an OS from SPL.
 	  for more info read doc/README.falcon
Signature · 1 line
2.49.0
#2 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 5 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Andrew

Quoted 20 lines

container (fitImage) signed with TIFS keys for authentication.

---
  common/spl/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/Kconfig +1 -1
index c08045f9c8d..68e900e9b91 100644
@@ -1165,7 +1165,7 @@ config SPL_ONENAND_SUPPORT
 
  config SPL_OS_BOOT
  	bool "Activate Falcon Mode"
-	depends on !TI_SECURE_DEVICE
+	depends on !TI_SECURE_DEVICE || ARCH_K3
  	help
  	  Enable booting directly to an OS from SPL.
  	  for more info read doc/README.falcon
#3 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 9 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage respectively. Following that, authentication is enforced during FIT loading by the call to board_fit_image_post_process in load_simple_fit.

So even if the fitImage was modified, boot would fail without valid signatures on HS-SE devices.

- Anshul

Quoted 20 lines
Quoted 20 lines

container (fitImage) signed with TIFS keys for authentication.

---
  common/spl/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/Kconfig +1 -1
index c08045f9c8d..68e900e9b91 100644
@@ -1165,7 +1165,7 @@ config SPL_ONENAND_SUPPORT
 
  config SPL_OS_BOOT
  	bool "Activate Falcon Mode"
-	depends on !TI_SECURE_DEVICE
+	depends on !TI_SECURE_DEVICE || ARCH_K3
  	help
  	  Enable booting directly to an OS from SPL.
  	  for more info read doc/README.falcon
#4 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 16 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 9 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Andrew

Quoted 29 lines

respectively. Following that, authentication is enforced during FIT loading by the call to board_fit_image_post_process in load_simple_fit.

So even if the fitImage was modified, boot would fail without valid signatures on HS-SE devices.

- Anshul

Quoted 20 lines
Quoted 20 lines

container (fitImage) signed with TIFS keys for authentication.

---
   common/spl/Kconfig | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/Kconfig +1 -1
index c08045f9c8d..68e900e9b91 100644
@@ -1165,7 +1165,7 @@ config SPL_ONENAND_SUPPORT
 
   config SPL_OS_BOOT
   	bool "Activate Falcon Mode"
-	depends on !TI_SECURE_DEVICE
+	depends on !TI_SECURE_DEVICE || ARCH_K3
   	help
   	  Enable booting directly to an OS from SPL.
   	  for more info read doc/README.falcon
#5 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 25 lines · Andrew Davis
Quoted 16 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 9 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

Quoted 6 lines

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Regards,
Anshul

Quoted 30 lines
Quoted 30 lines

respectively. Following that, authentication is enforced during FIT loading by the call to board_fit_image_post_process in load_simple_fit.

So even if the fitImage was modified, boot would fail without valid signatures on HS-SE devices.

- Anshul

Quoted 20 lines
Quoted 20 lines

container (fitImage) signed with TIFS keys for authentication.

---
   common/spl/Kconfig | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
common/spl/Kconfig +1 -1
index c08045f9c8d..68e900e9b91 100644
@@ -1165,7 +1165,7 @@ config SPL_ONENAND_SUPPORT
 
   config SPL_OS_BOOT
   	bool "Activate Falcon Mode"
-	depends on !TI_SECURE_DEVICE
+	depends on !TI_SECURE_DEVICE || ARCH_K3
   	help
   	  Enable booting directly to an OS from SPL.
   	  for more info read doc/README.falcon
#6 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 28 lines · Anshul Dalal
Quoted 27 lines · Andrew Davis
Quoted 14 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 8 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Quoted 8 lines
Quoted 1 line

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Is there any path where R5 SPL can be tricked to load and jump to arbitrary binary? zImage, Image, elf, bin whatever?

IOW, does SPL_OS_BOOT always check for some sort of header for the image that it loads and the only type of header we have enabled here is fitImage?

Regards
Vignesh

#7 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 40 lines · Vignesh Raghavendra
Quoted 28 lines · Anshul Dalal
Quoted 27 lines · Andrew Davis
Quoted 14 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 8 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Quoted 8 lines
Quoted 1 line

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Quoted 5 lines

Is there any path where R5 SPL can be tricked to load and jump to arbitrary binary? zImage, Image, elf, bin whatever?

IOW, does SPL_OS_BOOT always check for some sort of header for the image that it loads and the only type of header we have enabled here is fitImage?

It does check for the header and proceeds only with the desired security enforced execution flow if the loaded image is FIT. For all other image types, they are guarded by config symbols that are set unset in our case except for spl_parse_legacy_header which could be triggered but would just lead to a boot failure as we don't override the default weak definition.

Regards,
Anshul

#8 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 44 lines · Anshul Dalal
Quoted 43 lines · Vignesh Raghavendra
Quoted 28 lines · Anshul Dalal
Quoted 27 lines · Andrew Davis
Quoted 14 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 8 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Quoted 8 lines
Quoted 1 line

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Is there any path where R5 SPL can be tricked to load and jump to arbitrary binary? zImage, Image, elf, bin whatever?

Quoted 6 lines
Quoted 2 lines

IOW, does SPL_OS_BOOT always check for some sort of header for the image that it loads and the only type of header we have enabled here is fitImage?

It does check for the header and proceeds only with the desired security enforced execution flow if the loaded image is FIT. For all other image types, they are guarded by config symbols that are set unset in our case

Are you sure?

The only thing preventing this from continuing in spl_parse_image_header() is a check for CONFIG_SPL_PANIC_ON_RAW_IMAGE. Which is not set for us.

After that we check if OS_BOOT is enabled and if so allow for kernel images to also pass[0]. What stops this from functioning?

Andrew

[0] https://github.com/u-boot/u-boot/blob/master/common/spl/spl.c#L338

Quoted 7 lines

except for spl_parse_legacy_header which could be triggered but would just lead to a boot failure as we don't override the default weak definition.

Regards,
Anshul

#9 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 57 lines · Andrew Davis
Quoted 44 lines · Anshul Dalal
Quoted 43 lines · Vignesh Raghavendra
Quoted 28 lines · Anshul Dalal
Quoted 27 lines · Andrew Davis
Quoted 14 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 8 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Quoted 8 lines
Quoted 1 line

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Is there any path where R5 SPL can be tricked to load and jump to arbitrary binary? zImage, Image, elf, bin whatever?

Quoted 6 lines
Quoted 2 lines

IOW, does SPL_OS_BOOT always check for some sort of header for the image that it loads and the only type of header we have enabled here is fitImage?

It does check for the header and proceeds only with the desired security enforced execution flow if the loaded image is FIT. For all other image types, they are guarded by config symbols that are set unset in our case

Are you sure?

The only thing preventing this from continuing in spl_parse_image_header() is a check for CONFIG_SPL_PANIC_ON_RAW_IMAGE. Which is not set for us.

Quoted 7 lines

After that we check if OS_BOOT is enabled and if so allow for kernel images to also pass[0]. What stops this from functioning?

Andrew

[0] https://github.com/u-boot/u-boot/blob/master/common/spl/spl.c#L338

It would not function because of the unset CONFIG_CMD_BOOTI which can only be set on 64 bit platforms anyway[1]. Hence the following check would fail in spl_parse_image_header:

if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTI))

And as I said previously in the thread[2]; worst case is we load a 32-bit zImage, support for which would have to be explicitly enabled at build time as the respective config CMD_BOOTZ is kept unset currently.

~ Anshul

[1] https://github.com/u-boot/u-boot/blob/e04d137231f2e9e14708a32448c879125b8e308f/cmd/Kconfig#L359
[2] https://lore.kernel.org/u-boot/[email protected]/

#10 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 63 lines · Anshul Dalal
Quoted 62 lines · Andrew Davis
Quoted 44 lines · Anshul Dalal
Quoted 43 lines · Vignesh Raghavendra
Quoted 28 lines · Anshul Dalal
Quoted 27 lines · Andrew Davis
Quoted 14 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 8 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Quoted 8 lines
Quoted 1 line

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Is there any path where R5 SPL can be tricked to load and jump to arbitrary binary? zImage, Image, elf, bin whatever?

Quoted 6 lines
Quoted 2 lines

IOW, does SPL_OS_BOOT always check for some sort of header for the image that it loads and the only type of header we have enabled here is fitImage?

It does check for the header and proceeds only with the desired security enforced execution flow if the loaded image is FIT. For all other image types, they are guarded by config symbols that are set unset in our case

Are you sure?

The only thing preventing this from continuing in spl_parse_image_header() is a check for CONFIG_SPL_PANIC_ON_RAW_IMAGE. Which is not set for us.

After that we check if OS_BOOT is enabled and if so allow for kernel images to also pass[0]. What stops this from functioning?

Andrew

Quoted 9 lines
Quoted 2 lines

[0] https://github.com/u-boot/u-boot/blob/master/common/spl/spl.c#L338

It would not function because of the unset CONFIG_CMD_BOOTI which can only be set on 64 bit platforms anyway[1]. Hence the following check would fail in spl_parse_image_header:

if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTI))

I linked the wrong line, the line a couple below for CONFIG_CMD_BOOTZ is the one that concerns me.

Quoted 4 lines

And as I said previously in the thread[2]; worst case is we load a 32-bit zImage, support for which would have to be explicitly enabled at build time as the respective config CMD_BOOTZ is kept unset currently.

What forces CMD_BOOTZ to not be set? Can it be enabled in SPL at all? If it can you should make it "depends on !TI_SECURE_DEVICE" like other dangerous to the secure chain of trust configs.

Andrew

Quoted 4 lines

~ Anshul

[1] https://github.com/u-boot/u-boot/blob/e04d137231f2e9e14708a32448c879125b8e308f/cmd/Kconfig#L359
[2] https://lore.kernel.org/u-boot/[email protected]/

#11 lore raw

Re: [PATCH v6 1/9] spl: Kconfig: allow K3 devices to use falcon mode

Quoted 77 lines · Andrew Davis
Quoted 63 lines · Anshul Dalal
Quoted 62 lines · Andrew Davis
Quoted 44 lines · Anshul Dalal
Quoted 43 lines · Vignesh Raghavendra
Quoted 28 lines · Anshul Dalal
Quoted 27 lines · Andrew Davis
Quoted 14 lines · Anshul Dalal
Quoted 5 lines · Andrew Davis
Quoted 4 lines · Anshul Dalal

Falcon mode was disabled for TI_SECURE_DEVICE at commit e95b9b4437bc ("ti_armv7_common: Disable Falcon Mode on HS devices") for older 32-bit HS devices and can be enabled on K3 devices.

Quoted 8 lines
Quoted 1 line

For secure boot, the kernel with x509 headers can be packaged in a fit

"can be", this is the issue. Security is not just allowing methods that are security checked, but forcing the use of such methods. Setting OS_BOOT opens up several paths that look for non-FIT images. These images do not enforce authentication like FIT does. This means one can bypass secure boot when OS_BOOT is enabled by simply placing a non-FIT boot image on the boot media.

Quoted 7 lines

As per spl_load_image_ext_os, the SPL first tries to load the file set in falcon_args_file env variable but since it's not set in our case. And the only way to set them is by rebuilding u-boot as uEnv.txt is not supported at SPL stage.

This means the SPL only loads CONFIG_SPL_FS_LOAD_ARGS_NAME and CONFIG_SPL_FS_LOAD_KERNEL_NAME which are set as the DTB and fitImage

What is stopping me from replacing the content of the file "fitImage" with a normal kernel image? When loading that image the file type will be detected as a normal kernel image and all FIT logic bypassed, including authentication, breaking our secure chain of trust.

Quoted 8 lines
Quoted 1 line

Andrew

That would require booti_setup to be executed in spl_parse_image_header, which is not possible on the R5 SPL since the required config symbol CMD_BOOTI is only available for ARM64 platforms.

In the worst case we end up loading a 32-bit zImage which wouldn't boot on the Cortex-A cores anyway and would additionally require enabling CMD_BOOTZ (currently disabled) at build time.

Is there any path where R5 SPL can be tricked to load and jump to arbitrary binary? zImage, Image, elf, bin whatever?

Quoted 6 lines
Quoted 2 lines

IOW, does SPL_OS_BOOT always check for some sort of header for the image that it loads and the only type of header we have enabled here is fitImage?

It does check for the header and proceeds only with the desired security enforced execution flow if the loaded image is FIT. For all other image types, they are guarded by config symbols that are set unset in our case

Are you sure?

The only thing preventing this from continuing in spl_parse_image_header() is a check for CONFIG_SPL_PANIC_ON_RAW_IMAGE. Which is not set for us.

After that we check if OS_BOOT is enabled and if so allow for kernel images to also pass[0]. What stops this from functioning?

Andrew

Quoted 9 lines
Quoted 2 lines

[0] https://github.com/u-boot/u-boot/blob/master/common/spl/spl.c#L338

It would not function because of the unset CONFIG_CMD_BOOTI which can only be set on 64 bit platforms anyway[1]. Hence the following check would fail in spl_parse_image_header:

if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTI))

I linked the wrong line, the line a couple below for CONFIG_CMD_BOOTZ is the one that concerns me.

Quoted 9 lines
Quoted 4 lines

And as I said previously in the thread[2]; worst case is we load a 32-bit zImage, support for which would have to be explicitly enabled at build time as the respective config CMD_BOOTZ is kept unset currently.

What forces CMD_BOOTZ to not be set? Can it be enabled in SPL at all? If it can you should make it "depends on !TI_SECURE_DEVICE" like other dangerous to the secure chain of trust configs.

Sure, I'll update Kconfig to make CMD_BOOTZ and TI_SECURE_DEVICE mutually exclusive in the next revision just like SPL_RAW_IMAGE_SUPPORT.

Thanks for the review!

~ Anshul

#12 lore raw

PATCH v6 2/9 mach-k3: fix reading size and addr from fdt on R5

In reply to Anshul Dalal

fdtdec_get_addr_size uses architecture dependent datatypes which causes the 32-bit R5 to fail when reading the 64-bit size and addr fields of reg nodes from the fdt.

This changes it to a common api for both 64 and 32 bit platforms. Now fdt fixups can be applied to the fdt from R5.

---
 arch/arm/mach-k3/common_fdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-k3/common_fdt.c +3 -1
index 361b0c0b31b..c227743f9f8 100644
@@ -137,7 +137,9 @@ int fdt_fixup_reserved(void *blob, const char *name,
 			return -EINVAL;
 		if (!strncmp(node_name, name, strlen(name))) {
 			/* Read out old size first */
-			addr = fdtdec_get_addr_size(blob, subnode, "reg", &size);
+			addr = fdtdec_get_addr_size_fixed(
+				blob, subnode, "reg", 0, 8 / sizeof(fdt32_t),
+				8 / sizeof(fdt32_t), &size, false);
 			if (addr == FDT_ADDR_T_NONE)
 				return -EINVAL;
 			new_size = size;
Signature · 1 line
2.49.0
#13 lore raw

PATCH v6 3/9 arch: arm: k3-binman: add fit for falcon boot

In reply to Anshul Dalal

This adds creation of tispl_falcon.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 falcon boot.

This reduces boot time since the payload size is smaller and we also aren't authenticating the spl and fdt in secure boot.

---
 arch/arm/dts/k3-am625-sk-binman.dtsi | 64 ++++++++++++++++++++++++++++
 arch/arm/dts/k3-am62a-sk-binman.dtsi | 64 ++++++++++++++++++++++++++++
 arch/arm/dts/k3-am62p-sk-binman.dtsi | 51 ++++++++++++++++++++++
 arch/arm/dts/k3-binman.dtsi          | 54 +++++++++++++++++++++++
 4 files changed, 233 insertions(+)
arch/arm/dts/k3-am625-sk-binman.dtsi +64 -0
index 534eb14795b..5ca1a4b28e8 100644
@@ -219,6 +219,70 @@
 		};
 	};
 
+	ti-falcon {
+		insert-template = <&ti_falcon_template>;
+
+		fit {
+			images {
+				tifsstub-hs {
+					description = "TIFSSTUB";
+					type = "firmware";
+					arch = "arm32";
+					compression = "none";
+					os = "tifsstub-hs";
+					load = <0x9dc00000>;
+					entry = <0x9dc00000>;
+					blob-ext {
+						filename = "tifsstub.bin_hs";
+					};
+				};
+				tifsstub-fs {
+					description = "TIFSSTUB";
+					type = "firmware";
+					arch = "arm32";
+					compression = "none";
+					os = "tifsstub-fs";
+					load = <0x9dc00000>;
+					entry = <0x9dc00000>;
+					blob-ext {
+						filename = "tifsstub.bin_fs";
+					};
+				};
+				tifsstub-gp {
+					description = "TIFSSTUB";
+					type = "firmware";
+					arch = "arm32";
+					compression = "none";
+					os = "tifsstub-gp";
+					load = <0x9dc00000>;
+					entry = <0x9dc00000>;
+					blob-ext {
+						filename = "tifsstub.bin_gp";
+					};
+				};
+				dm {
+					ti-secure {
+						content = <&dm_falcon>;
+						keyfile = "custMpk.pem";
+					};
+					dm_falcon: ti-dm {
+						filename = "ti-dm.bin";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf-0";
+				conf-0 {
+					description = "k3-am625-sk-falcon";
+					firmware = "atf";
+					loadables = "tee", "tifsstub-hs", "tifsstub-fs",
+					"tifsstub-gp", "dm";
+				};
+			};
+		};
+	};
+
 	ti-spl {
 		insert-template = <&ti_spl_template>;
 
arch/arm/dts/k3-am62a-sk-binman.dtsi +64 -0

70 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.49.0
#14 lore raw

PATCH v6 4/9 mach-k3: sysfw-loader: update img_hdr for falcon

In reply to Anshul Dalal

The returned legacy_img_hdr is used by booti_setup to compute the load address for the kernel image.

This change ensures the kernel load address is CONFIG_SYS_LOAD_ADDR in falcon boot.

---
 arch/arm/mach-k3/r5/sysfw-loader.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-k3/r5/sysfw-loader.c +5 -1
index 188731e673d..19607606965 100644
@@ -89,7 +89,11 @@ static void *sysfw_load_address;
 struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
 {
 	if (sysfw_loaded)
-		return (struct legacy_img_hdr *)(CONFIG_TEXT_BASE + offset);
+		if (IS_ENABLED(CONFIG_SPL_OS_BOOT))
+			return (struct legacy_img_hdr *)CONFIG_SYS_LOAD_ADDR;
+		else
+			return (struct legacy_img_hdr *)(CONFIG_TEXT_BASE +
+							 offset);
 	else if (sysfw_load_address)
 		return sysfw_load_address;
 	else
Signature · 1 line
2.49.0
#15 lore raw

PATCH v6 5/9 config: add falcon boot config fragment for am62x

In reply to Anshul Dalal

This fragment enables falcon boot for the am62x, 62a and 62p.

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 ATF has to also be updated to 0x82000000 since the kernel requires to be loaded at 2MiB aligned address along with change changing 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 | ATF reserved memory space | CONFIG_K3_ATF_LOAD_ADDR*
0x80080000 +-------------------------------+
31.5MiB | Unused |
0x82000000 +-------------------------------+ PRELOADED_BL33_BASE* in ATF

           |                               | 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 ATF
   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 ATF
24MiB | OPTEE |
0xa0000000 +-------------------------------+ End of DDR (512MiB)

---
 configs/am62x_r5_falcon.config | 38 ++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 configs/am62x_r5_falcon.config
configs/am62x_r5_falcon.config new file +38 -0
new file mode 100644
index 00000000000..c9bb8d68505
@@ -0,0 +1,38 @@
+# Enable falcon mode
+CONFIG_SPL_OS_BOOT=y
+
+# We use envs for setting bootargs and optionally for `falcon_(image|args)_file`
+CONFIG_SPL_ENV_SUPPORT=y
+
+# Perform FDT fixups from SPL
+CONFIG_OF_SYSTEM_SETUP=y
+
+# Enabling this causes issues with EMMC FS boot,
+# When enabled the SPL tries to detect FS on boot[01] hw partition which fails
+# since we need the raw tiboot3.bin there for the board to boot instead
+CONFIG_SUPPORT_EMMC_BOOT=n
+
+# Used as the 2MiB aligned load address for kernel
+CONFIG_SYS_LOAD_ADDR=0x82000000
+CONFIG_SPL_PAYLOAD_ARGS_ADDR=0x88000000
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x82000000
+CONFIG_SPL_STACK_R_ADDR=0x88000000
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2700000
+
+# We use the rootfs (i.e partition 2) for booting which is ext4 not FAT
+CONFIG_SYS_MMCSD_FS_BOOT_PARTITION=2
+CONFIG_SPL_FS_EXT4=y
+CONFIG_SPL_FS_FAT=n
+
+# Loading tispl_falcon instead of tispl which has fdt and A53 spl saves time
+CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="boot/tispl_falcon.bin"
+CONFIG_SPL_FS_LOAD_KERNEL_NAME="boot/fitImage"
+
+# Disabled to save space on the spl
+CONFIG_TI_K3_NAVSS_UDMA=n
+
+# During SPI boot, kernel and args are loaded from the eMMC or SD and not SPI,
+# therefore we don't actually make use of these config values.
+CONFIG_SYS_SPI_KERNEL_OFFS=0
+CONFIG_SYS_SPI_ARGS_OFFS=0
+CONFIG_SYS_SPI_ARGS_SIZE=0
Signature · 1 line
2.49.0
#16 lore raw

PATCH v6 6/9 board: ti: add default dtb for am62 in falcon mode

In reply to Anshul Dalal

The SPL_FS_LOAD_ARGS_NAME config is used for the arguments to the kernel (dtb in our case) in falcon boot.

Setting it in board specific Kconfig allows us to reuse the same config fragment 'am62x_r5_falcon.config' for all 3 platforms for enabling falcon boot.

---
 board/ti/am62ax/Kconfig | 3 +++
 board/ti/am62px/Kconfig | 3 +++
 board/ti/am62x/Kconfig  | 3 +++
 3 files changed, 9 insertions(+)
board/ti/am62ax/Kconfig +3 -0
index 51e7b3e0eab..187e9e5c9cd 100644
@@ -23,4 +23,7 @@ if TARGET_AM62A7_R5_EVM
 config SPL_LDSCRIPT
 	default "arch/arm/mach-omap2/u-boot-spl.lds"
 
+config SPL_FS_LOAD_ARGS_NAME
+	default "boot/dtb/ti/k3-am62a7-sk.dtb"
+
 endif
board/ti/am62px/Kconfig +3 -0
index 9d95ffd9b29..5f7252d7b19 100644
@@ -23,4 +23,7 @@ if TARGET_AM62P5_R5_EVM
 config SPL_LDSCRIPT
 	default "arch/arm/mach-omap2/u-boot-spl.lds"
 
+config SPL_FS_LOAD_ARGS_NAME
+	default "boot/dtb/ti/k3-am62p5-sk.dtb"
+
 endif
board/ti/am62x/Kconfig +3 -0
index 610dacfdc08..1564913096c 100644
@@ -32,6 +32,9 @@ config SYS_CONFIG_NAME
 config SPL_LDSCRIPT
 	default "arch/arm/mach-omap2/u-boot-spl.lds"
 
+config SPL_FS_LOAD_ARGS_NAME
+	default "boot/dtb/ti/k3-am625-sk.dtb"
+
 source "board/ti/common/Kconfig"
 
 endif
Signature · 1 line
2.49.0
#17 lore raw

PATCH v6 7/9 mach-k3: common: enable falcon mode for 62 platform

In reply to Anshul Dalal

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

In here, we find the boot media and load the image just as std falcon flow (since spl_start_uboot returns 0 now). Once the kernel and args are loaded, we perform fdt fixups on the fdt accompanying the kernel (if loaded as FIT) or the loaded up args and return.

Now when the flow goes to jump_to_image, we do the regular pre-jump procedure and jump to ATF 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).

---
 arch/arm/mach-k3/common.c | 107 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)
arch/arm/mach-k3/common.c +107 -0
index fa8cd93d664..ad5ed92eb03 100644
@@ -263,8 +263,115 @@ static __maybe_unused void k3_dma_remove(void)
 		pr_warn("DMA Device not found (err=%d)\n", rc);
 }
 
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT) && !IS_ENABLED(CONFIG_ARM64)
+static bool tispl_loaded;
+
+int spl_start_uboot(void)
+{
+	if (!tispl_loaded)
+		return 1;
+	return 0;
+}
+
+static int k3_falcon_fdt_fixup(void *fdt)
+{
+	struct disk_partition info;
+	struct blk_desc *dev_desc;
+	char bootmedia[32];
+	char bootpart[32];
+	char str[256];
+	int ret;
+
+	strcpy(bootmedia, env_get("boot"));
+	strcpy(bootpart, env_get("bootpart"));
+	ret = blk_get_device_part_str(bootmedia, bootpart, &dev_desc, &info, 0);
+	if (ret < 0)
+		printf("Failed to get part details for %s %s [%d]\n", bootmedia,
+		       bootpart, ret);
+	sprintf(str, "console=%s root=PARTUUID=%s rootwait", env_get("console"),
+		info.uuid);
+
+	fdt_set_totalsize(fdt, fdt_totalsize(fdt) + CONFIG_SYS_FDT_PAD);
+	ret = fdt_find_and_setprop(fdt, "/chosen", "bootargs", str,
+				   strlen(str) + 1, 1);
+	if (ret) {
+		printf("Could not set bootargs: %s\n", fdt_strerror(ret));
+		return ret;
+	}
+	debug("Set bootargs to: %s\n", str);
+
+#ifdef CONFIG_OF_BOARD_SETUP
+	ret = ft_board_setup(fdt, gd->bd);
+	if (ret) {
+		printf("Failed in board fdt fixups: %s\n", fdt_strerror(ret));
+		return ret;
+	}
+#endif
+
+#ifdef CONFIG_OF_SYSTEM_SETUP
+	ret = ft_system_setup(fdt, gd->bd);
+	if (ret) {
+		printf("Failed in system fdt fixups: %s\n", fdt_strerror(ret));
+		return ret;
+	}
+#endif
+
+	return 0;
+}
+
+static int k3_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;
+
+	tispl_loaded = true;
+	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();
+	if (bootdev.boot_device == BOOT_DEVICE_SPI) {
+		if (strcmp(env_get("mmcdev"), "1") == 0)
+			bootdev.boot_device = BOOT_DEVICE_MMC;
+		else
+			bootdev.boot_device = BOOT_DEVICE_EMMC;
+	}
+	bootdev.boot_device_name = NULL;
+
+	for (loader = drv; loader != drv + n_ents; loader++) {
+		if (bootdev.boot_device != loader->boot_device)
+			continue;
+		if (loader) {
+			printf("Loading falcon payload from %s\n",
+			       spl_loader_name(loader));
+			ret = loader->load_image(&kernel_image, &bootdev);
+			if (ret)
+				continue;
+
+			fdt = spl_image_fdt_addr(&kernel_image);
+			if (!fdt)
+				fdt = (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR;
+			ret = k3_falcon_fdt_fixup(fdt);
+			if (ret) {
+				printf("Failed performing fdt fixups in falcon flow: [%d]\n",
+				       ret);
+				return ret;
+			}
+			return 0;
+		}
+	}
+
+	return ret;
+}
+#endif
+
 void spl_board_prepare_for_boot(void)
 {
+#if IS_ENABLED(CONFIG_SPL_OS_BOOT) && !IS_ENABLED(CONFIG_ARM64)
+	k3_falcon_prep();
+#endif
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
 	dcache_disable();
 #endif
Signature · 1 line
2.49.0
#18 lore raw

PATCH v6 8/9 Makefile: update tispl regex to also clean falcon spl

In reply to Anshul Dalal

Build for A53 on am62 platforms now generates tispl_falcon.bin alongside tispl.bin, edit the regex for make clean so that both files are removed.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e83672b1823..1d8fa759141 100644
@@ -2225,7 +2225,7 @@ CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \
 	       include/config.h include/generated/env.* drivers/video/u_boot_logo.S \
 	       tools/version.h u-boot* MLO* SPL System.map fit-dtb.blob* \
 	       u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log \
-	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl.bin* \
+	       lpc32xx-* bl31.c bl31.elf bl31_*.bin image.map tispl*.bin* \
 	       idbloader.img flash.bin flash.log defconfig keep-syms-lto.c \
 	       mkimage-out.spl.mkimage mkimage.spl.mkimage imx-boot.map \
 	       itb.fit.fit itb.fit.itb itb.map spl.map mkimage-out.rom.mkimage \
Signature · 1 line
2.49.0
#19 lore raw

PATCH v6 9/9 doc: ti: am62: add falcon mode documentation

In reply to Anshul Dalal

This patch adds user documentation for falcon boot for am62 platforms. The main section is added to am62x_sk.rst and other documents just include the section. 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 tispl_falcon.bin and other for the falcon specific fitImage format.

---
 doc/board/ti/am62ax_sk.rst                    |   7 +
 doc/board/ti/am62px_sk.rst                    |   7 +
 doc/board/ti/am62x_sk.rst                     | 290 ++++++++++++++++++
 doc/board/ti/img/fitImage_falcon.svg          | 180 +++++++++++
 .../ti/img/tifsstub_dm_tispl_falcon.bin.svg   | 285 +++++++++++++++++
 5 files changed, 769 insertions(+)
 create mode 100644 doc/board/ti/img/fitImage_falcon.svg
 create mode 100644 doc/board/ti/img/tifsstub_dm_tispl_falcon.bin.svg
doc/board/ti/am62ax_sk.rst +7 -0
index 262340ef59a..9830916e3e0 100644
@@ -192,6 +192,13 @@ 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
+-----------
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_mode_start
+    :end-before: .. am62x_evm_falcon_mode_end
+
 Debugging U-Boot
 ----------------
 
doc/board/ti/am62px_sk.rst +7 -0
index 99bdc034869..74f6dafa238 100644
@@ -290,6 +290,13 @@ 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
+-----------
+
+.. include:: am62x_sk.rst
+    :start-after: .. am62x_evm_falcon_mode_start
+    :end-before: .. am62x_evm_falcon_mode_end
+
 Debugging U-Boot
 ----------------
 
doc/board/ti/am62x_sk.rst +290 -0

296 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_tispl_falcon.bin.svg new file +285 -0

285 lines not on this page · raw message

Signature · 1 line
2.49.0