diff mbox series

[v12,03/16] boot/uboot: rename TI_K3_DM option to cover further TI K3 SoCs support

Message ID 20240407103512.1112712-4-romain.naour@smile.fr
State Accepted
Headers show
Series Add support for AM62x-SK HS-FS devices | expand

Commit Message

Romain Naour April 7, 2024, 10:34 a.m. UTC
BR2_TARGET_UBOOT_NEEDS_TI_K3_DM option has been introduced initially to
support certain TI K3 devices such as AM62x and AM62Ax that require a
Device Manager (DM) firmware.

This option needs to be renamed to use a more generic name in order
to cover further TI K3 SoCs support along with the new u-boot binman
tool that will be added in followup patch. With binman enabled in
u-boot on TI K3 SoC, ti-k3-boot-firmware is needed at buildtime to
provide ti-sysfw (System Firmware) for all TI K3 SoC along with Device
Manager (DM) firmware for AM62x and AM62Ax devices.

With binman support enabled, we don't need to provide the path of the
Device Manager firmware anymore (see [2]).
We can remove DM="<DM firmware>.xer5f" from UBOOT_MAKE_OPTS.
It also means that we can also remove BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
used to define DM path.

  DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f

For now, keep BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME and DM only when
ti-k3-image-gen is used. We need to update ti_am62x_sk_defconfig
to use binman before removing them along with ti-k3-image-gen.

[1] 52ce606c05ee3ac869f8087292bc3dbb0d25b79b
[2] https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 Config.in.legacy              |  8 ++++++++
 boot/uboot/Config.in          | 23 ++++++++++++++---------
 boot/uboot/uboot.mk           |  4 +++-
 configs/ti_am62x_sk_defconfig |  2 +-
 4 files changed, 26 insertions(+), 11 deletions(-)

Comments

Arnout Vandecappelle April 7, 2024, 8:01 p.m. UTC | #1
On 07/04/2024 12:34, Romain Naour wrote:
> BR2_TARGET_UBOOT_NEEDS_TI_K3_DM option has been introduced initially to
> support certain TI K3 devices such as AM62x and AM62Ax that require a
> Device Manager (DM) firmware.
> 
> This option needs to be renamed to use a more generic name in order
> to cover further TI K3 SoCs support along with the new u-boot binman
> tool that will be added in followup patch. With binman enabled in
> u-boot on TI K3 SoC, ti-k3-boot-firmware is needed at buildtime to
> provide ti-sysfw (System Firmware) for all TI K3 SoC along with Device
> Manager (DM) firmware for AM62x and AM62Ax devices.
> 
> With binman support enabled, we don't need to provide the path of the
> Device Manager firmware anymore (see [2]).
> We can remove DM="<DM firmware>.xer5f" from UBOOT_MAKE_OPTS.
> It also means that we can also remove BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
> used to define DM path.
> 
>    DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
> 
> For now, keep BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME and DM only when
> ti-k3-image-gen is used. We need to update ti_am62x_sk_defconfig
> to use binman before removing them along with ti-k3-image-gen.
> 
> [1] 52ce606c05ee3ac869f8087292bc3dbb0d25b79b
> [2] https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> ---
>   Config.in.legacy              |  8 ++++++++
>   boot/uboot/Config.in          | 23 ++++++++++++++---------
>   boot/uboot/uboot.mk           |  4 +++-
>   configs/ti_am62x_sk_defconfig |  2 +-
>   4 files changed, 26 insertions(+), 11 deletions(-)
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index d00196e08b..4084ffa516 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -146,6 +146,14 @@ endif
>   
>   comment "Legacy options removed in 2024.05"
>   
> +config BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> +	bool "u-boot TI K3 DM option has been renamed."
> +	select BR2_LEGACY
> +	select BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
> +	help
> +	  The TI K3 Device Manager is already included in
> +	  ti-k3-boot-firmware.
> +
>   config BR2_PACKAGE_FLUTTER_GALLERY
>   	bool "flutter-gallery removed"
>   	select BR2_LEGACY
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 39b3f2c81b..e310c09217 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -240,18 +240,23 @@ config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE
>   	  U-Boot, and that the TEE variable pointing to OPTEE's
>   	  tee.elf, is passed during the Buildroot build.
>   
> -config BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> -	bool "U-Boot needs TI K3 Device Manager (DM)"
> -	# We use the SoC selection defined for the ti-k3-image-gen
> -	# package
> -	depends on BR2_TARGET_TI_K3_IMAGE_GEN
> -	depends on BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX || BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> +config BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
> +	bool "U-Boot needs ti-k3-boot-firmware"
> +	depends on BR2_TARGET_TI_K3_BOOT_FIRMWARE

  I guess that if ti-k3-boot-firmware is selected, we can pretty much assume 
that U-Boot needs it, no? So I think this entire config option can be removed, 
so it gets enabled automatically if ti-k3-boot-firmware is enabled.

>   	help
> -	  Some TI K3 devices need the Device Manager (DM) firmware to
> -	  be available for the U-Boot build.
> +	  TI K3 devices needs at least ti-sysfw (System Firmware) when
> +	  built with u-boot's binman tool.
>   
> -if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> +	  Some TI K3 devices using a split firmware boot flow (AM62,
> +	  j721e) also need the Device Manager (DM) firmware to be
> +	  available for the U-Boot build.
>   
> +if BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE

  I.e. this could just be

if BR2_TARGET_TI_K3_BOOT_FIRMWARE


  Regards,
  Arnout

> +
> +# TI_K3_DM_SOCNAME is only needed when ti-k3-image-gen is used for
> +# TI K3 devices using the Device Manager (DM) firmware.
> +# We use the SoC selection defined for the ti-k3-image-gen
> +# package.
>   config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>   	string
>   	default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index 491f654cec..47fb419e92 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -194,11 +194,13 @@ UBOOT_DEPENDENCIES += optee-os
>   UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee.elf
>   endif
>   
> -ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE),y)
>   UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
>   UBOOT_DEPENDENCIES += ti-k3-boot-firmware
> +ifneq ($(UBOOT_TI_K3_DM_SOCNAME),)
>   UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
>   endif
> +endif
>   
>   ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
>   UBOOT_DEPENDENCIES += opensbi
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index 37df7a93f7..b2814526bb 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -37,7 +37,7 @@ BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_evm_a53"
>   BR2_TARGET_UBOOT_NEEDS_DTC=y
>   BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
>   BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> -BR2_TARGET_UBOOT_NEEDS_TI_K3_DM=y
> +BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE=y
>   # BR2_TARGET_UBOOT_FORMAT_BIN is not set
>   BR2_TARGET_UBOOT_FORMAT_IMG=y
>   BR2_TARGET_UBOOT_SPL=y
Romain Naour April 9, 2024, 11:36 a.m. UTC | #2
Hello Arnout,

Le 07/04/2024 à 22:01, Arnout Vandecappelle a écrit :
> 
> 
> On 07/04/2024 12:34, Romain Naour wrote:
>> BR2_TARGET_UBOOT_NEEDS_TI_K3_DM option has been introduced initially to
>> support certain TI K3 devices such as AM62x and AM62Ax that require a
>> Device Manager (DM) firmware.
>>
>> This option needs to be renamed to use a more generic name in order
>> to cover further TI K3 SoCs support along with the new u-boot binman
>> tool that will be added in followup patch. With binman enabled in
>> u-boot on TI K3 SoC, ti-k3-boot-firmware is needed at buildtime to
>> provide ti-sysfw (System Firmware) for all TI K3 SoC along with Device
>> Manager (DM) firmware for AM62x and AM62Ax devices.
>>
>> With binman support enabled, we don't need to provide the path of the
>> Device Manager firmware anymore (see [2]).
>> We can remove DM="<DM firmware>.xer5f" from UBOOT_MAKE_OPTS.
>> It also means that we can also remove BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>> used to define DM path.
>>
>>   
>> DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
>>
>> For now, keep BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME and DM only when
>> ti-k3-image-gen is used. We need to update ti_am62x_sk_defconfig
>> to use binman before removing them along with ti-k3-image-gen.
>>
>> [1] 52ce606c05ee3ac869f8087292bc3dbb0d25b79b
>> [2]
>> https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html
>>
>> Signed-off-by: Romain Naour <romain.naour@smile.fr>
>> ---
>>   Config.in.legacy              |  8 ++++++++
>>   boot/uboot/Config.in          | 23 ++++++++++++++---------
>>   boot/uboot/uboot.mk           |  4 +++-
>>   configs/ti_am62x_sk_defconfig |  2 +-
>>   4 files changed, 26 insertions(+), 11 deletions(-)
>>
>> diff --git a/Config.in.legacy b/Config.in.legacy
>> index d00196e08b..4084ffa516 100644
>> --- a/Config.in.legacy
>> +++ b/Config.in.legacy
>> @@ -146,6 +146,14 @@ endif
>>     comment "Legacy options removed in 2024.05"
>>   +config BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>> +    bool "u-boot TI K3 DM option has been renamed."
>> +    select BR2_LEGACY
>> +    select BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
>> +    help
>> +      The TI K3 Device Manager is already included in
>> +      ti-k3-boot-firmware.
>> +
>>   config BR2_PACKAGE_FLUTTER_GALLERY
>>       bool "flutter-gallery removed"
>>       select BR2_LEGACY
>> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
>> index 39b3f2c81b..e310c09217 100644
>> --- a/boot/uboot/Config.in
>> +++ b/boot/uboot/Config.in
>> @@ -240,18 +240,23 @@ config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE
>>         U-Boot, and that the TEE variable pointing to OPTEE's
>>         tee.elf, is passed during the Buildroot build.
>>   -config BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>> -    bool "U-Boot needs TI K3 Device Manager (DM)"
>> -    # We use the SoC selection defined for the ti-k3-image-gen
>> -    # package
>> -    depends on BR2_TARGET_TI_K3_IMAGE_GEN
>> -    depends on BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX ||
>> BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>> +config BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
>> +    bool "U-Boot needs ti-k3-boot-firmware"
>> +    depends on BR2_TARGET_TI_K3_BOOT_FIRMWARE
> 
>  I guess that if ti-k3-boot-firmware is selected, we can pretty much assume that
> U-Boot needs it, no? So I think this entire config option can be removed, so it
> gets enabled automatically if ti-k3-boot-firmware is enabled.
> 
>>       help
>> -      Some TI K3 devices need the Device Manager (DM) firmware to
>> -      be available for the U-Boot build.
>> +      TI K3 devices needs at least ti-sysfw (System Firmware) when
>> +      built with u-boot's binman tool.
>>   -if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>> +      Some TI K3 devices using a split firmware boot flow (AM62,
>> +      j721e) also need the Device Manager (DM) firmware to be
>> +      available for the U-Boot build.
>>   +if BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
> 
>  I.e. this could just be
> 
> if BR2_TARGET_TI_K3_BOOT_FIRMWARE

Indeed, I was distracted by BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME that is still used
until the AM6x defconfig are updated to use binman.

I'll post a followup patch to complete the rework.

Best regards,
Romain


> 
> 
>  Regards,
>  Arnout
> 
>> +
>> +# TI_K3_DM_SOCNAME is only needed when ti-k3-image-gen is used for
>> +# TI K3 devices using the Device Manager (DM) firmware.
>> +# We use the SoC selection defined for the ti-k3-image-gen
>> +# package.
>>   config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>>       string
>>       default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
>> index 491f654cec..47fb419e92 100644
>> --- a/boot/uboot/uboot.mk
>> +++ b/boot/uboot/uboot.mk
>> @@ -194,11 +194,13 @@ UBOOT_DEPENDENCIES += optee-os
>>   UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee.elf
>>   endif
>>   -ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
>> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE),y)
>>   UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
>>   UBOOT_DEPENDENCIES += ti-k3-boot-firmware
>> +ifneq ($(UBOOT_TI_K3_DM_SOCNAME),)
>>   UBOOT_MAKE_OPTS +=
>> DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
>>   endif
>> +endif
>>     ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
>>   UBOOT_DEPENDENCIES += opensbi
>> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
>> index 37df7a93f7..b2814526bb 100644
>> --- a/configs/ti_am62x_sk_defconfig
>> +++ b/configs/ti_am62x_sk_defconfig
>> @@ -37,7 +37,7 @@ BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_evm_a53"
>>   BR2_TARGET_UBOOT_NEEDS_DTC=y
>>   BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
>>   BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
>> -BR2_TARGET_UBOOT_NEEDS_TI_K3_DM=y
>> +BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE=y
>>   # BR2_TARGET_UBOOT_FORMAT_BIN is not set
>>   BR2_TARGET_UBOOT_FORMAT_IMG=y
>>   BR2_TARGET_UBOOT_SPL=y
diff mbox series

Patch

diff --git a/Config.in.legacy b/Config.in.legacy
index d00196e08b..4084ffa516 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -146,6 +146,14 @@  endif
 
 comment "Legacy options removed in 2024.05"
 
+config BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
+	bool "u-boot TI K3 DM option has been renamed."
+	select BR2_LEGACY
+	select BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
+	help
+	  The TI K3 Device Manager is already included in
+	  ti-k3-boot-firmware.
+
 config BR2_PACKAGE_FLUTTER_GALLERY
 	bool "flutter-gallery removed"
 	select BR2_LEGACY
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 39b3f2c81b..e310c09217 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -240,18 +240,23 @@  config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE
 	  U-Boot, and that the TEE variable pointing to OPTEE's
 	  tee.elf, is passed during the Buildroot build.
 
-config BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
-	bool "U-Boot needs TI K3 Device Manager (DM)"
-	# We use the SoC selection defined for the ti-k3-image-gen
-	# package
-	depends on BR2_TARGET_TI_K3_IMAGE_GEN
-	depends on BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX || BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
+config BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
+	bool "U-Boot needs ti-k3-boot-firmware"
+	depends on BR2_TARGET_TI_K3_BOOT_FIRMWARE
 	help
-	  Some TI K3 devices need the Device Manager (DM) firmware to
-	  be available for the U-Boot build.
+	  TI K3 devices needs at least ti-sysfw (System Firmware) when
+	  built with u-boot's binman tool.
 
-if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
+	  Some TI K3 devices using a split firmware boot flow (AM62,
+	  j721e) also need the Device Manager (DM) firmware to be
+	  available for the U-Boot build.
 
+if BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE
+
+# TI_K3_DM_SOCNAME is only needed when ti-k3-image-gen is used for
+# TI K3 devices using the Device Manager (DM) firmware.
+# We use the SoC selection defined for the ti-k3-image-gen
+# package.
 config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
 	string
 	default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index 491f654cec..47fb419e92 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -194,11 +194,13 @@  UBOOT_DEPENDENCIES += optee-os
 UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee.elf
 endif
 
-ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE),y)
 UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
 UBOOT_DEPENDENCIES += ti-k3-boot-firmware
+ifneq ($(UBOOT_TI_K3_DM_SOCNAME),)
 UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
 endif
+endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
 UBOOT_DEPENDENCIES += opensbi
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index 37df7a93f7..b2814526bb 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -37,7 +37,7 @@  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_evm_a53"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
-BR2_TARGET_UBOOT_NEEDS_TI_K3_DM=y
+BR2_TARGET_UBOOT_NEEDS_TI_K3_BOOT_FIRMWARE=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y