diff mbox series

[11/21] boot/ti-k3-r5-loader: install tiboot3.bin and sysfw.itb to BINARIES_DIR

Message ID 20240213172817.2872849-12-romain.naour@smile.fr
State Superseded
Headers show
Series Add ti_j721e_sk_defconfig | expand

Commit Message

Romain Naour Feb. 13, 2024, 5:28 p.m. UTC
U-boot for k3 r5 core (ti-k3-r5-loader) can install different target
image (tiboot3*.bin) depending on the k3 SoC variant using different
boot flow [1]:

- Split binary with a combined firmware: (eg: AM65)
- Combined binary with a combined firmware: (eg: AM64)
- Split binary with a split firmware: (eg: J721E)
- Combined binary with a split firmware: (eg: AM62)

K3 SoC using Split Binary Boot Flow also requires sysfw-*.itb file
to boot (eg: am65, j721e). Only tiboot3*.bin is needed for other
boot flow.

From [1]:
"It's important to rename the generated tiboot3.bin and sysfw.itb
to match exactly tiboot3.bin and sysfw.itb as ROM and the wakeup
UBoot SPL will only look for and load the files with these names."

So boards using HS (High Secure) K3 SoC variant must update the
tiboot3.bin (and sysfw.itb) in their post-build script.

ti-k3-r5-loader must install any tiboot3*.bin (and sysfw*.itb)
to BINARIES_DIR let the user which one should be used in a
post-build script.

See the list of all tiboot3*.bin and sysfw*.itb file variant found in meta-ti:

  meta-ti-bsp/conf/machine/beaglebone-ai64-k3r5.conf:UBOOT_IMAGE = "tiboot3-${MAINMACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
  meta-ti-bsp/conf/machine/beaglebone-ai64-k3r5.conf:UBOOT_SYMLINK = "tiboot3-${MAINMACHINE}.${UBOOT_SUFFIX}"
  meta-ti-bsp/conf/machine/include/am62axx.inc:IMAGE_BOOT_FILES += "tiboot3-am62ax-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62axx.inc:IMAGE_BOOT_FILES += "tiboot3-am62ax-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am62axx.inc:IMAGE_BOOT_FILES += "tiboot3-am62ax-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62pxx.inc:IMAGE_BOOT_FILES += "tiboot3-am62px-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62xx.inc:IMAGE_BOOT_FILES += "tiboot3-am62x-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am62xx.inc:IMAGE_BOOT_FILES += "tiboot3-am62x-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am62xx.inc:IMAGE_BOOT_FILES += "tiboot3-am62x-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/am64xx.inc:IMAGE_BOOT_FILES += "tiboot3-am64x_sr2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/am64xx.inc:IMAGE_BOOT_FILES += "tiboot3-am64x-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am64xx.inc:IMAGE_BOOT_FILES += "tiboot3-am64x_sr2-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "tiboot3-am65x_sr2-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "tiboot3-am65x_sr2-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/j7200.inc:IMAGE_BOOT_FILES += "tiboot3-j7200-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j7200.inc:IMAGE_BOOT_FILES += "tiboot3-j7200_sr2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j7200.inc:IMAGE_BOOT_FILES += "tiboot3-j7200_sr2-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "tiboot3-j721e-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "tiboot3-j721e_sr2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "tiboot3-j721e_sr1_1-hs-evm.bin"
  meta-ti-bsp/conf/machine/include/j721s2.inc:IMAGE_BOOT_FILES += "tiboot3-j721s2-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j721s2.inc:IMAGE_BOOT_FILES += "tiboot3-j721s2-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j722s.inc:IMAGE_BOOT_FILES += "tiboot3-j722s-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/j784s4.inc:IMAGE_BOOT_FILES += "tiboot3-j784s4-gp-evm.bin"
  meta-ti-bsp/conf/machine/include/j784s4.inc:IMAGE_BOOT_FILES += "tiboot3-j784s4-hs-fs-evm.bin"
  meta-ti-bsp/conf/machine/include/k3r5.inc:SPL_BINARY = "tiboot3-${SYSFW_SOC}-${SYSFW_SUFFIX}-${SYSFW_CONFIG}.${SPL_SUFFIX}"

  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "sysfw.itb"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "sysfw-am65x_sr2-gp-evm.itb"
  meta-ti-bsp/conf/machine/include/am65xx.inc:IMAGE_BOOT_FILES += "sysfw-am65x_sr2-hs-evm.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw-j721e-gp-evm.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw-j721e_sr2-hs-fs-evm.itb"
  meta-ti-bsp/conf/machine/include/j721e.inc:IMAGE_BOOT_FILES += "sysfw-j721e_sr1_1-hs-evm.itb"

[1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/doc/board/ti/k3.rst

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Alexander Sverdlin Feb. 14, 2024, 10:58 a.m. UTC | #1
Hi Romain,

On Tue, 2024-02-13 at 18:28 +0100, Romain Naour wrote:
> U-boot for k3 r5 core (ti-k3-r5-loader) can install different target
> image (tiboot3*.bin) depending on the k3 SoC variant using different
> boot flow [1]:
> 
> - Split binary with a combined firmware: (eg: AM65)
> - Combined binary with a combined firmware: (eg: AM64)
> - Split binary with a split firmware: (eg: J721E)
> - Combined binary with a split firmware: (eg: AM62)
> 
> K3 SoC using Split Binary Boot Flow also requires sysfw-*.itb file
> to boot (eg: am65, j721e). Only tiboot3*.bin is needed for other
> boot flow.
> 
> From [1]:
> "It's important to rename the generated tiboot3.bin and sysfw.itb
> to match exactly tiboot3.bin and sysfw.itb as ROM and the wakeup
> UBoot SPL will only look for and load the files with these names."
> 
> So boards using HS (High Secure) K3 SoC variant must update the
> tiboot3.bin (and sysfw.itb) in their post-build script.
> 
> ti-k3-r5-loader must install any tiboot3*.bin (and sysfw*.itb)
> to BINARIES_DIR let the user which one should be used in a
> post-build script.
> 
> See the list of all tiboot3*.bin and sysfw*.itb file variant found in meta-ti:


[]

> [1] https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/doc/board/ti/k3.rst
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> index 8f86e0fb07..b3c756dc47 100644
> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -78,8 +78,17 @@ define TI_K3_R5_LOADER_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
>  endef
>  
> +# sysfw*.itb are only generated for Split binary based Boot Flow (eg: am65, j721e)
>  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
>  	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> +	for f in $(@D)/tiboot3*.bin ; do \
> +		$(INSTALL) -D -m 0644 $$f $(BINARIES_DIR)/`basename $$f` || exit 1; \
> +	done
> +	for f in $(@D)/sysfw*.itb ; do \
> +		if test -e $$f ; then \
> +			$(INSTALL) -D -m 0644 $$f $(BINARIES_DIR)/`basename $$f` || exit 1; \
> +		fi ; \
> +	done
>  endef
>  
>  $(eval $(kconfig-package))
diff mbox series

Patch

diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
index 8f86e0fb07..b3c756dc47 100644
--- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
@@ -78,8 +78,17 @@  define TI_K3_R5_LOADER_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
 endef
 
+# sysfw*.itb are only generated for Split binary based Boot Flow (eg: am65, j721e)
 define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
 	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
+	for f in $(@D)/tiboot3*.bin ; do \
+		$(INSTALL) -D -m 0644 $$f $(BINARIES_DIR)/`basename $$f` || exit 1; \
+	done
+	for f in $(@D)/sysfw*.itb ; do \
+		if test -e $$f ; then \
+			$(INSTALL) -D -m 0644 $$f $(BINARIES_DIR)/`basename $$f` || exit 1; \
+		fi ; \
+	done
 endef
 
 $(eval $(kconfig-package))