diff mbox series

[12/21] boot/ti-k3-boot-firmware: introduce BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_{AM62AX, AM62X, AM64X, AM65X}

Message ID 20240213172817.2872849-13-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
ti-k3-image-gen tool is deprecated an replaced by binman [1].

But BR2_TARGET_TI_K3_IMAGE_GEN_SOC_{AM62AX,AM62X} is used by u-boot
package to select which Device Manager (DM) firmware to use for the
U-Boot build.

In order to remove ti-k3-image-gen package, introduce
BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_{AM62AX,AM62X,AM64X,AM65X} to
replace BR2_TARGET_TI_K3_IMAGE_GEN_SOC_{AM62AX,AM62X,AM64X,AM65X}.

In order to avoid breaking existing defconfig still using
ti-k3-image-gen tool (ti_am62x_sk_defconfig, ti_am64x_sk_defconfig)
select BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC symbol from ti-k3-image-gen
package.

While at it, only install required firmware to BINARIES_DIR based
on the selected TI K3 SoC variant.

This requires two intall step:
  - ti-sysfw installation based on the SoC variant.
  - ti-dm installation only for SoC using split firmware boot flow
    (eg: am62, j721e)

[1] https://git.yoctoproject.org/meta-ti/commit/?id=835811cf8586926cf78a961d090f4e6150432235

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 boot/ti-k3-boot-firmware/Config.in            | 34 +++++++++++++++++++
 .../ti-k3-boot-firmware.mk                    | 12 +++++--
 boot/ti-k3-image-gen/Config.in                |  4 +++
 3 files changed, 48 insertions(+), 2 deletions(-)

Comments

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

On Tue, 2024-02-13 at 18:28 +0100, Romain Naour wrote:
> ti-k3-image-gen tool is deprecated an replaced by binman [1].
> 
> But BR2_TARGET_TI_K3_IMAGE_GEN_SOC_{AM62AX,AM62X} is used by u-boot
> package to select which Device Manager (DM) firmware to use for the
> U-Boot build.
> 
> In order to remove ti-k3-image-gen package, introduce
> BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_{AM62AX,AM62X,AM64X,AM65X} to
> replace BR2_TARGET_TI_K3_IMAGE_GEN_SOC_{AM62AX,AM62X,AM64X,AM65X}.
> 
> In order to avoid breaking existing defconfig still using
> ti-k3-image-gen tool (ti_am62x_sk_defconfig, ti_am64x_sk_defconfig)
> select BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC symbol from ti-k3-image-gen
> package.
> 
> While at it, only install required firmware to BINARIES_DIR based
> on the selected TI K3 SoC variant.
> 
> This requires two intall step:
>   - ti-sysfw installation based on the SoC variant.
>   - ti-dm installation only for SoC using split firmware boot flow
>     (eg: am62, j721e)
> 
> [1] https://git.yoctoproject.org/meta-ti/commit/?id=835811cf8586926cf78a961d090f4e6150432235
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>

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

> ---
>  boot/ti-k3-boot-firmware/Config.in            | 34 +++++++++++++++++++
>  .../ti-k3-boot-firmware.mk                    | 12 +++++--
>  boot/ti-k3-image-gen/Config.in                |  4 +++
>  3 files changed, 48 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/boot/ti-k3-boot-firmware/Config.in b/boot/ti-k3-boot-firmware/Config.in
index d80bb4bdb3..8393699998 100644
--- a/boot/ti-k3-boot-firmware/Config.in
+++ b/boot/ti-k3-boot-firmware/Config.in
@@ -5,3 +5,37 @@  config BR2_TARGET_TI_K3_BOOT_FIRMWARE
 	  This package downloads and installs the TI-specific ti-sysfw
 	  and ti-dm firmware needed to boot TI K3 platforms (which
 	  include AM62x, AM64x, AM65x and more).
+
+if BR2_TARGET_TI_K3_BOOT_FIRMWARE
+choice
+	prompt "SoC family"
+
+config BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62AX
+	bool "am62ax"
+
+config BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62X
+	bool "am62x"
+
+config BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM64X
+	bool "am64x"
+
+config BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM65X
+	bool "am65x"
+
+endchoice
+
+config BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC
+	string
+	default "am62ax" if BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62AX
+	default "am62x"  if BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62X
+	default "am64x"  if BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM64X
+	default "am65x"  if BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM65X
+
+# Only devices with a split firmware boot flow requires a DM firmware (eg: am62, j721e)
+config BR2_TARGET_TI_K3_BOOT_FIRMWARE_DM
+	string
+	default "am62axx" if BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62AX
+	default "am62xx"  if BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62X
+	default ""
+
+endif
diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk b/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
index 1f8ade207c..c7c5eb0818 100644
--- a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
+++ b/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
@@ -13,9 +13,17 @@  TI_K3_BOOT_FIRMWARE_INSTALL_IMAGES = YES
 TI_K3_BOOT_FIRMWARE_LICENSE = TI Proprietary
 TI_K3_BOOT_FIRMWARE_LICENSE_FILES = LICENSE.ti
 
+ifneq ($(BR2_TARGET_TI_K3_BOOT_FIRMWARE_DM),)
+define TI_K3_BOOT_FIRMWARE_INSTALL_DM_FILES
+	mkdir -p $(BINARIES_DIR)/ti-dm
+	cp -dpfr $(@D)/ti-dm/$(BR2_TARGET_TI_K3_BOOT_FIRMWARE_DM) $(BINARIES_DIR)/ti-dm
+endef
+endif
+
 define TI_K3_BOOT_FIRMWARE_INSTALL_IMAGES_CMDS
-	cp -dpfr $(@D)/ti-sysfw $(BINARIES_DIR)/
-	cp -dpfr $(@D)/ti-dm $(BINARIES_DIR)/
+	mkdir -p $(BINARIES_DIR)/ti-sysfw
+	cp -dpfr $(@D)/ti-sysfw/*$(BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC)* $(BINARIES_DIR)/ti-sysfw
+	$(TI_K3_BOOT_FIRMWARE_INSTALL_DM_FILES)
 endef
 
 $(eval $(generic-package))
diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
index d76cef82e9..e54f5ec992 100644
--- a/boot/ti-k3-image-gen/Config.in
+++ b/boot/ti-k3-image-gen/Config.in
@@ -18,15 +18,19 @@  choice
 
 config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
 	bool "am62ax"
+	select BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62AX
 
 config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
 	bool "am62x"
+	select BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM62X
 
 config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
 	bool "am64x"
+	select BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM64X
 
 config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
 	bool "am65x"
+	select BR2_TARGET_TI_K3_BOOT_FIRMWARE_SOC_AM65X
 
 endchoice