All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
@ 2024-02-17 16:02 Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting Dario Binacchi
                   ` (22 more replies)
  0 siblings, 23 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

The SK-AM62B-P1 is the newest version of SK-AM62 which includes
high-security field-securable (HS-FS) silicon to optionally customize keys
and encryption for security applications.
This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
which, however, was buggy. This series fixes the errors and bumps the Linux
kernel and U-Boot required for such a new device.

This series, which in my humble opinion, should have been immediately
considered to correct the compilation errors in case of HS-FS devcies, has
seen an increase in patches in version 4 to remove the ti-k3-image-gen
package thanks to Binman. Additionally, it shares some modifications and
views on how to implement certain changes with the series
https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
Therefore, I think it is necessary not to run them in parallel but to decide
whether to merge one before the other or to consider a single series where
the patches can be coherent with each other. I am available for both solutions.
Let me know.

Dario Binacchi (20):
  configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
    setting
  configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
    setting
  configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader
    version
  configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader
    version
  boot/ti-k3-r5-loader: bump to version 2024.01
  boot/ti-k3-core-secdev: new package
  boot/ti-k3-image-gen: manage HS hardware
  package/python-jsonschema: add host variant
  package/python-attrs: add host variant
  package/python-referencing: add host variant
  package/python-rpds-py: add host variant
  package/python-jsonschema-specifications: add host variant
  boot/ti-k3-r5-loader: set binman environment
  boot/uboot: set BINMAN_INDIRS for TI K3 DM
  configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
  configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
  boot: move ti-k3-* packages to 'ti-k3' directory
  boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
  boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore

 DEVELOPERS                                    |  1 +
 board/ti/am62x-sk/genimage.cfg                |  7 +-
 board/ti/am62x-sk/post-build.sh               | 49 ++++++++++++
 board/ti/am62x-sk/post-image.sh               |  5 ++
 boot/Config.in                                |  4 +-
 boot/ti-k3-image-gen/Config.in                | 77 -------------------
 boot/ti-k3/Config.in                          | 59 ++++++++++++++
 boot/ti-k3/common.mk                          |  1 +
 .../{ => ti-k3}/ti-k3-boot-firmware/Config.in |  0
 .../ti-k3-boot-firmware.hash                  |  0
 .../ti-k3-boot-firmware.mk                    |  0
 boot/ti-k3/ti-k3-core-secdev/Config.in        |  9 +++
 .../ti-k3-core-secdev/ti-k3-core-secdev.hash  |  3 +
 .../ti-k3-core-secdev/ti-k3-core-secdev.mk    | 22 ++++++
 boot/ti-k3/ti-k3-image-gen/Config.in          | 25 ++++++
 .../ti-k3-image-gen/ti-k3-image-gen.hash      |  0
 .../ti-k3-image-gen/ti-k3-image-gen.mk        | 20 ++++-
 boot/{ => ti-k3}/ti-k3-r5-loader/Config.in    |  4 +-
 .../ti-k3-r5-loader/ti-k3-r5-loader.hash      |  2 +-
 .../ti-k3-r5-loader/ti-k3-r5-loader.mk        | 16 +++-
 boot/uboot/Config.in                          |  7 +-
 boot/uboot/uboot.mk                           |  3 +-
 configs/ti_am62x_sk_defconfig                 | 23 +++---
 configs/ti_am64x_sk_defconfig                 |  8 +-
 package/python-attrs/python-attrs.mk          |  6 ++
 .../python-jsonschema-specifications.mk       |  5 ++
 .../python-jsonschema/python-jsonschema.mk    |  6 ++
 .../python-referencing/python-referencing.mk  |  5 ++
 package/python-rpds-py/python-rpds-py.mk      |  1 +
 29 files changed, 263 insertions(+), 105 deletions(-)
 create mode 100755 board/ti/am62x-sk/post-build.sh
 create mode 100755 board/ti/am62x-sk/post-image.sh
 delete mode 100644 boot/ti-k3-image-gen/Config.in
 create mode 100644 boot/ti-k3/Config.in
 create mode 100644 boot/ti-k3/common.mk
 rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
 rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
 rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
 create mode 100644 boot/ti-k3/ti-k3-core-secdev/Config.in
 create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
 create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
 create mode 100644 boot/ti-k3/ti-k3-image-gen/Config.in
 rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
 rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (67%)
 rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (97%)
 rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (54%)
 rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (85%)

-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:06   ` Alexander Sverdlin
  2024-02-19  9:36   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 02/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
                   ` (21 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Checking the output of the command `git grep PLATFORM | grep k3`, we can
found the proper settings for the optee-os package:

.github/workflows/ci.yml:          _make PLATFORM=k3-am62x
.github/workflows/ci.yml:          _make PLATFORM=k3-am62x CFG_ARM64_core=y
...
core/arch/arm/plat-k3/conf.mk:ifneq (,$(filter ${PLATFORM_FLAVOR},am65x j721e j784s4 am64x am62x))

Suggested-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 configs/ti_am62x_sk_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index f88252a89c68..fde6f8f5636a 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -21,7 +21,8 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
 BR2_TARGET_OPTEE_OS=y
-BR2_TARGET_OPTEE_OS_PLATFORM="k3"
+BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
+BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
 BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 02/20] configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:08   ` Alexander Sverdlin
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 03/20] configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader version Dario Binacchi
                   ` (20 subsequent siblings)
  22 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Checking the output of the command `git grep PLATFORM | grep k3`, we can
found the proper settings for the optee-os package:

.github/workflows/ci.yml:          _make PLATFORM=k3-am64x
.github/workflows/ci.yml:          _make PLATFORM=k3-am64x CFG_ARM64_core=y
...
core/arch/arm/plat-k3/conf.mk:ifneq (,$(filter ${PLATFORM_FLAVOR},am65x j721e j784s4 am64x am62x))

Suggested-by: Romain Naour <romain.naour@smile.fr>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 configs/ti_am64x_sk_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
index 4bfd31f0c8d3..98476c88626b 100644
--- a/configs/ti_am64x_sk_defconfig
+++ b/configs/ti_am64x_sk_defconfig
@@ -21,7 +21,8 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
 BR2_TARGET_OPTEE_OS=y
-BR2_TARGET_OPTEE_OS_PLATFORM="k3"
+BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
+BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
 BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 03/20] configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader version
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 02/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 04/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Commit 4b8fddb060fb ("configs/ti_am62x_sk: new defconfig") forgot to
specify the ti-k3-r5-loader, so do that now.

When the defconfig was added, the default version was 2022.10, so use it.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 configs/ti_am62x_sk_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index fde6f8f5636a..a4cffe09ce72 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -26,6 +26,8 @@ BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
 BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
+BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
+BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
 BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG="am62x_evm_r5"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 04/20] configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader version
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (2 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 03/20] configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader version Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 05/20] boot/ti-k3-r5-loader: bump to version 2024.01 Dario Binacchi
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Commit 6b2329bb80 ("configs/ti_am64x_sk: new defconfig") forgot to
specify the ti-k3-r5-loader, so do that now.

When the defconfig was added, the default version was 2022.10, so use it.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 configs/ti_am64x_sk_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
index 98476c88626b..5fd9653b5b8f 100644
--- a/configs/ti_am64x_sk_defconfig
+++ b/configs/ti_am64x_sk_defconfig
@@ -26,6 +26,8 @@ BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
 BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
+BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
+BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
 BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG="am64x_evm_r5"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 05/20] boot/ti-k3-r5-loader: bump to version 2024.01
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (3 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 04/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package Dario Binacchi
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

All in-tree configs with the ti-k3-r5 bootloader use a custom version,
so this patch is mostly for the menuconfig default version

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/ti-k3-r5-loader/Config.in            | 4 ++--
 boot/ti-k3-r5-loader/ti-k3-r5-loader.hash | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3-r5-loader/Config.in
index 8c8368a1a5a8..5f86c045c99f 100644
--- a/boot/ti-k3-r5-loader/Config.in
+++ b/boot/ti-k3-r5-loader/Config.in
@@ -16,7 +16,7 @@ choice
 	  here as it is used to build the main U-Boot package.
 
 config BR2_TARGET_TI_K3_R5_LOADER_LATEST_VERSION
-	bool "2022.10"
+	bool "2024.01"
 
 config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION
 	bool "Custom version"
@@ -60,7 +60,7 @@ endif
 
 config BR2_TARGET_TI_K3_R5_LOADER_VERSION
 	string
-	default "2022.10"	if BR2_TARGET_TI_K3_R5_LOADER_LATEST_VERSION
+	default "2024.01"	if BR2_TARGET_TI_K3_R5_LOADER_LATEST_VERSION
 	default BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE \
 		if BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION
 	default "custom"	if BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL
diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash b/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
index c5d1cb8e09f0..fbe5d215409d 100644
--- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
@@ -1,3 +1,3 @@
 # Locally computed:
-sha256  50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8  u-boot-2022.10.tar.bz2
+sha256  b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3  u-boot-2024.01.tar.bz2
 sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  Licenses/gpl-2.0.txt
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (4 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 05/20] boot/ti-k3-r5-loader: bump to version 2024.01 Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 17:06   ` Alexander Sverdlin
  2024-02-19  9:48   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware Dario Binacchi
                   ` (16 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

This is a security development package containing tools for
High-Security(HS) TI K3 platform devices.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v4:
- Remove the trailing '/' at the end of the url in the help of
  Config.in
- Fixed license issues
- Use $(BINARIES_DIR)/ti-k3-core-secdev as the directory where to
  install files.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS                                    |  1 +
 boot/Config.in                                |  1 +
 boot/ti-k3-core-secdev/Config.in              |  9 ++++++++
 boot/ti-k3-core-secdev/ti-k3-core-secdev.hash |  3 +++
 boot/ti-k3-core-secdev/ti-k3-core-secdev.mk   | 22 +++++++++++++++++++
 5 files changed, 36 insertions(+)
 create mode 100644 boot/ti-k3-core-secdev/Config.in
 create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
 create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 0d12c3abcb11..33d99ab2440f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -753,6 +753,7 @@ F:	package/xinetd/
 N:	Dario Binacchi <dario.binacchi@amarulasolutions.com>
 F:	board/bsh/
 F:	board/stmicroelectronics/stm32f769-disco/
+F:	boot/ti-k3-core-secdev/
 F:	configs/imx8mn_bsh_smm_s2_defconfig
 F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
 F:	configs/stm32f769_disco_sd_defconfig
diff --git a/boot/Config.in b/boot/Config.in
index e5fdf7ad439e..18a7d268f95a 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -20,6 +20,7 @@ source "boot/s500-bootloader/Config.in"
 source "boot/shim/Config.in"
 source "boot/syslinux/Config.in"
 source "boot/ti-k3-boot-firmware/Config.in"
+source "boot/ti-k3-core-secdev/Config.in"
 source "boot/ti-k3-image-gen/Config.in"
 source "boot/ti-k3-r5-loader/Config.in"
 source "boot/uboot/Config.in"
diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3-core-secdev/Config.in
new file mode 100644
index 000000000000..f7b4e2962042
--- /dev/null
+++ b/boot/ti-k3-core-secdev/Config.in
@@ -0,0 +1,9 @@
+config BR2_TARGET_TI_K3_CORE_SECDEV
+	bool "ti-k3-core-secdev"
+	depends on BR2_aarch64
+	help
+	  This package downloads and installs development tools for
+	  High-Security(HS) TI K3 platforms (which include AM62x,
+	  AM64x, AM65x and more).
+
+	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
new file mode 100644
index 000000000000..e3074a398d62
--- /dev/null
+++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  b6d3bca0d561d055c6869c5564b06f2fb1b9f67e4ef180c2baf8a14a6a6afa06  core-secdev-k3-08.06.00.007.tar.xz
+sha256  3e5cf4f5ab9f0333f46cd68fabede3f21e55de1a9e3c6ad673f241f4514d8369  manifest/k3-secdev-0.2-manifest.html
diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
new file mode 100644
index 000000000000..f7655a0fefc8
--- /dev/null
+++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# ti-k3-core-secdev
+#
+################################################################################
+
+TI_K3_CORE_SECDEV_VERSION = 08.06.00.007
+TI_K3_CORE_SECDEV_SITE = https://git.ti.com/cgit/security-development-tools/core-secdev-k3/snapshot
+TI_K3_CORE_SECDEV_SOURCE = core-secdev-k3-$(TI_K3_CORE_SECDEV_VERSION).tar.xz
+TI_K3_CORE_SECDEV_INSTALL_IMAGES = YES
+TI_K3_CORE_SECDEV_LICENSE = BSD-3-Clause
+TI_K3_CORE_SECDEV_LICENSE_FILES = manifest/k3-secdev-0.2-manifest.html
+
+TI_K3_CORE_SECDEV_INSTALL_DIR = $(BINARIES_DIR)/ti-k3-core-secdev
+
+define TI_K3_CORE_SECDEV_INSTALL_IMAGES_CMDS
+	mkdir -p $(TI_K3_CORE_SECDEV_INSTALL_DIR)
+	cp -dpfr $(@D)/keys $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
+	cp -dpfr $(@D)/scripts $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
+endef
+
+$(eval $(generic-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (5 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 23:45   ` Alexander Sverdlin
  2024-02-19  9:58   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 08/20] package/python-jsonschema: add host variant Dario Binacchi
                   ` (15 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

The patch sets the configurations required by TI HS systems. Some of these
configurations (i. e. HS SYSFW image signing key, HS Software Revision)
are provided by the ti-k3-core-secdev package in the binaries directory.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

no changes since v3:

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/ti-k3-image-gen/Config.in          |  1 +
 boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
index d76cef82e911..38d1598d9fc0 100644
--- a/boot/ti-k3-image-gen/Config.in
+++ b/boot/ti-k3-image-gen/Config.in
@@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
 	bool "ti-k3-image-gen"
 	depends on BR2_TARGET_TI_K3_R5_LOADER
 	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
+	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
 	# We need FIT support in uboot-tools, which is why we select a
 	# host package
 	select BR2_PACKAGE_HOST_UBOOT_TOOLS
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
index 64be9a18f2c4..74b4fcb4bf89 100644
--- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
+++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
@@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
 TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
 TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
 
-TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
+ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
+TI_K3_IMAGE_GEN_SYSFW = \
+	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
+else
+TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev
+
+TI_K3_IMAGE_GEN_SYSFW = \
+	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
+	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
+endif
 
 define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
-	cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
+	$(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
+		cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
+	)
 endef
 
 define TI_K3_IMAGE_GEN_BUILD_CMDS
@@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
 	$(BR2_MAKE) -C $(@D) \
 		SOC=$(TI_K3_IMAGE_GEN_SOC) \
 		SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
+		TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \
 		CONFIG=evm \
 		CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
 		SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 08/20] package/python-jsonschema: add host variant
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (6 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-19 10:03   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 09/20] package/python-attrs: " Dario Binacchi
                   ` (14 subsequent siblings)
  22 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts. This package is required by binman.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

no changes since v3

Changes in v3:
- Drop Config.in.host

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/python-jsonschema/python-jsonschema.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/python-jsonschema/python-jsonschema.mk b/package/python-jsonschema/python-jsonschema.mk
index 512c92aa7752..85fef7ad22ac 100644
--- a/package/python-jsonschema/python-jsonschema.mk
+++ b/package/python-jsonschema/python-jsonschema.mk
@@ -15,4 +15,10 @@ PYTHON_JSONSCHEMA_DEPENDENCIES = \
 	host-python-hatch-fancy-pypi-readme \
 	host-python-hatch-vcs
 
+HOST_PYTHON_JSONSCHEMA_DEPENDENCIES = \
+	host-python-hatchling \
+	host-python-hatch-fancy-pypi-readme \
+	host-python-hatch-vcs
+
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 09/20] package/python-attrs: add host variant
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (7 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 08/20] package/python-jsonschema: add host variant Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 10/20] package/python-referencing: " Dario Binacchi
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts. This package is required by binman.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

no changes since v3

Changes in v3:
- Drop Config.in.host

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/python-attrs/python-attrs.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/python-attrs/python-attrs.mk b/package/python-attrs/python-attrs.mk
index 8a1236cc4402..fb1729e62fa2 100644
--- a/package/python-attrs/python-attrs.mk
+++ b/package/python-attrs/python-attrs.mk
@@ -15,4 +15,10 @@ PYTHON_ATTRS_DEPENDENCIES = \
 	host-python-hatch-fancy-pypi-readme \
 	host-python-hatch-vcs
 
+HOST_PYTHON_ATTRS_DEPENDENCIES = \
+	host-python-hatchling \
+	host-python-hatch-fancy-pypi-readme \
+	host-python-hatch-vcs
+
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 10/20] package/python-referencing: add host variant
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (8 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 09/20] package/python-attrs: " Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 11/20] package/python-rpds-py: " Dario Binacchi
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts. This package is required by binman.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v4:
- Drop host-python-attrs from PYTHON_REFERENCING_DEPENDENCIES

Changes in v3:
- Drop Config.in.host

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/python-referencing/python-referencing.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/python-referencing/python-referencing.mk b/package/python-referencing/python-referencing.mk
index 27d1452e913a..f00a0efe73e8 100644
--- a/package/python-referencing/python-referencing.mk
+++ b/package/python-referencing/python-referencing.mk
@@ -14,4 +14,9 @@ PYTHON_REFERENCING_DEPENDENCIES = \
 	host-python-hatchling \
 	host-python-hatch-vcs
 
+HOST_PYTHON_REFERENCING_DEPENDENCIES = \
+	host-python-hatchling \
+	host-python-hatch-vcs
+
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 11/20] package/python-rpds-py: add host variant
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (9 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 10/20] package/python-referencing: " Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 12/20] package/python-jsonschema-specifications: " Dario Binacchi
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts. This package is required by binman

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

no changes since v3

Changes in v3:
- Drop Config.in.host

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 package/python-rpds-py/python-rpds-py.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/python-rpds-py/python-rpds-py.mk b/package/python-rpds-py/python-rpds-py.mk
index 80670f2e4fde..cee2ff290a4e 100644
--- a/package/python-rpds-py/python-rpds-py.mk
+++ b/package/python-rpds-py/python-rpds-py.mk
@@ -12,3 +12,4 @@ PYTHON_RPDS_PY_LICENSE = MIT
 PYTHON_RPDS_PY_LICENSE_FILES = LICENSE
 
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 12/20] package/python-jsonschema-specifications: add host variant
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (10 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 11/20] package/python-rpds-py: " Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment Dario Binacchi
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts. This package is required by binman.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

no changes since v3

Changes in v3:
- Drop Config.in.host

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 .../python-jsonschema-specifications.mk                      | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/python-jsonschema-specifications/python-jsonschema-specifications.mk b/package/python-jsonschema-specifications/python-jsonschema-specifications.mk
index 40879898c9d4..b6e309ab2bc9 100644
--- a/package/python-jsonschema-specifications/python-jsonschema-specifications.mk
+++ b/package/python-jsonschema-specifications/python-jsonschema-specifications.mk
@@ -14,4 +14,9 @@ PYTHON_JSONSCHEMA_SPECIFICATIONS_DEPENDENCIES = \
 	host-python-hatchling \
 	host-python-hatch-vcs
 
+HOST_PYTHON_JSONSCHEMA_SPECIFICATIONS_DEPENDENCIES = \
+	host-python-hatchling \
+	host-python-hatch-vcs
+
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (11 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 12/20] package/python-jsonschema-specifications: " Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:38   ` Alexander Sverdlin
  2024-02-19 10:15   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM Dario Binacchi
                   ` (9 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent version of U-Boot use binman to provide a mechanism for building
images, from simple SPL + U-Boot combinations, to more complex
arrangements with many parts.

The patch set the BINMAN_INDIRS environment variable to provide the
directory to search for binary blobs and select the packages required by
binman.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v4:
- Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option

Changes in v2:
- Change commit message
- Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
- Select packages required by binman if
  BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

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 0ffcb8235f2e..2a10024aedaa 100644
--- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
+++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
@@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
 	host-pkgconf \
 	$(BR2_MAKE_HOST_DEPENDENCY) \
 	host-arm-gnu-toolchain \
-	host-openssl
+	host-openssl \
+	host-python-attrs \
+	host-python-jsonschema \
+	host-python-jsonschema-specifications \
+	host-python-pyyaml \
+	host-python-referencing \
+	host-python-rpds-py
 
 TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
 TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
@@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
 	$(BR2_BISON_HOST_DEPENDENCY) \
 	$(BR2_FLEX_HOST_DEPENDENCY)
 
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
+TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
+endif
+
 ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
 TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
 else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
@@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
 	CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
 	ARCH=arm \
 	HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
+	BINMAN_INDIRS=$(BINARIES_DIR) \
 	HOSTLDFLAGS="$(HOST_LDFLAGS)"
 
 define TI_K3_R5_LOADER_BUILD_CMDS
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (12 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:44   ` Alexander Sverdlin
  2024-02-19 10:19   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01 Dario Binacchi
                   ` (8 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

As explained in [1], adding support for AM62x LP SK in U-Boot, requires
binman for building bootloader images. The BINMAN_INDIRS environment
variable is used to provide a space-separated list of directories to
search for binary blobs.

[1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

no changes since v1:

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/uboot/uboot.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index dda606a88059..cf70f86a4132 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -189,7 +189,8 @@ endif
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
 UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
 UBOOT_DEPENDENCIES += ti-k3-boot-firmware
-UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
+UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \
+	BINMAN_INDIRS=$(BINARIES_DIR)
 endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (13 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:20   ` Alexander Sverdlin
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1 Dario Binacchi
                   ` (7 subsequent siblings)
  22 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

The 2024.01 version of U-Boot for the am62x-sk board has introduced two
major changes:
- The device tree k3-am625-sk.dtb is no longer searched in /boot, but in
  /boot/dtb/ti. Hence, the disabling of BR2_LINUX_KERNEL_INSTALL_TARGET
  and the use of extlinux.conf for the proper loading of the device tree.
  Furthermore, the parameter BR2_ROOTFS_POST_SCRIPT_ARGS was used to
  auto-generate the extlinux.conf file so that developers can change the
  kernel loading options by modifying the .config.
- The use of binman for building images.

Tested on SK-AM62B-P1.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v4:
- bump to 204.01 instead of 2023.10
- Update the commit message
- Replace 'PARTUUID=00000000-02' with '/dev/mmcblk1p2' where to get rootfs
  in the BR2_ROOTFS_POST_SCRIPT_ARGS insided the ti_am62x_sk_defconfig.

Changes in v2:
- Update the commit message
- Drop Python options required by binman.
- Enable BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN. This option automatically
  selects the Python modules required by binman.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 board/ti/am62x-sk/genimage.cfg  |  7 ++++-
 board/ti/am62x-sk/post-build.sh | 49 +++++++++++++++++++++++++++++++++
 board/ti/am62x-sk/post-image.sh |  5 ++++
 configs/ti_am62x_sk_defconfig   | 11 ++++----
 4 files changed, 66 insertions(+), 6 deletions(-)
 create mode 100755 board/ti/am62x-sk/post-build.sh
 create mode 100755 board/ti/am62x-sk/post-image.sh

diff --git a/board/ti/am62x-sk/genimage.cfg b/board/ti/am62x-sk/genimage.cfg
index 26304fe98f99..398209f4d831 100644
--- a/board/ti/am62x-sk/genimage.cfg
+++ b/board/ti/am62x-sk/genimage.cfg
@@ -4,10 +4,15 @@ image boot.vfat {
 			"tiboot3.bin",
 			"tispl.bin",
 			"u-boot.img",
+			"k3-am625-sk.dtb",
+			"Image"
+		}
+		file extlinux/extlinux.conf {
+			image = extlinux.conf
 		}
 	}
 
-	size = 16M
+	size = 64M
 }
 
 image sdcard.img {
diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/am62x-sk/post-build.sh
new file mode 100755
index 000000000000..0f1f98ef217a
--- /dev/null
+++ b/board/ti/am62x-sk/post-build.sh
@@ -0,0 +1,49 @@
+#!/bin/sh -x
+
+# genimage will need to find the extlinux.conf
+# in the binaries directory
+
+die() {
+  cat <<EOF >&2
+Error: $@
+
+Usage: ${0} -c <console> -r <root> [-x <extra-args>]
+EOF
+  exit 1
+}
+
+o='c:r:x:'
+O='console:,root:,extra-args:'
+opts="$(getopt -n "${0##*/}" -o "${o}" -l "${O}" -- "${@}")"
+eval set -- "${opts}"
+while [ ${#} -gt 0 ]; do
+    case "${1}" in
+    (-c|--console)
+        CONSOLE="${2}"; shift 2
+        ;;
+    (-r|--root)
+        ROOT="${2}"; shift 2
+        ;;
+    (-x|--extra-args)
+        EXTRA_ARGS="${2}"; shift 2
+        ;;
+    (--)
+        shift 1; break
+        ;;
+    esac
+done
+
+[ -n "${CONSOLE}" ] || die "Missing argument"
+[ -n "${ROOT}" ] || die "Missing argument"
+append="console=${CONSOLE} root=${ROOT} rw rootfstype=ext4 rootwait"
+if [ -n "${EXTRA_ARGS}" ]; then
+    append="${append} ${EXTRA_ARGS}"
+fi
+
+mkdir -p "${BINARIES_DIR}"
+cat <<-__HEADER_EOF > "${BINARIES_DIR}/extlinux.conf"
+	label am62x-sk-buildroot
+	  kernel /Image
+	  fdtdir /
+	  append ${append}
+	__HEADER_EOF
diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh
new file mode 100755
index 000000000000..34f732c091ad
--- /dev/null
+++ b/board/ti/am62x-sk/post-image.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -x
+
+BOARD_DIR="$(dirname "$0")"
+
+support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index a4cffe09ce72..193301c8b941 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -1,14 +1,14 @@
 BR2_aarch64=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/ti/am62x-sk/genimage.cfg"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.16"
 BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am625-sk"
-BR2_LINUX_KERNEL_INSTALL_TARGET=y
 BR2_PACKAGE_LINUX_FIRMWARE=y
 BR2_PACKAGE_LINUX_FIRMWARE_TI_WL18XX=y
 BR2_TARGET_ROOTFS_EXT2=y
@@ -27,14 +27,15 @@ BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
-BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
+BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
 BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG="am62x_evm_r5"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.10"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.01"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_evm_a53"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
 BR2_TARGET_UBOOT_NEEDS_TI_K3_DM=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (14 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01 Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:27   ` Alexander Sverdlin
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory Dario Binacchi
                   ` (6 subsequent siblings)
  22 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Tested on SK-AM62B-P1.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Changes in v4
- Add BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6 to ti_am62x_sk_defconfig.

no changes since v1

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 configs/ti_am62x_sk_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index 193301c8b941..4de39fb897fd 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -1,11 +1,11 @@
 BR2_aarch64=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.16"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.1"
 BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am625-sk"
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (15 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1 Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 21:05   ` François Perrad
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope Dario Binacchi
                   ` (5 subsequent siblings)
  22 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Move all TI K3 packages to the directory ti-k3.
This patch is preparatory for future developments.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/Config.in                                      |  5 +----
 boot/ti-k3/Config.in                                | 13 +++++++++++++
 boot/ti-k3/common.mk                                |  1 +
 boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in      |  0
 .../ti-k3-boot-firmware/ti-k3-boot-firmware.hash    |  0
 .../ti-k3-boot-firmware/ti-k3-boot-firmware.mk      |  0
 boot/{ => ti-k3}/ti-k3-core-secdev/Config.in        |  0
 .../ti-k3-core-secdev/ti-k3-core-secdev.hash        |  0
 .../ti-k3-core-secdev/ti-k3-core-secdev.mk          |  0
 boot/{ => ti-k3}/ti-k3-image-gen/Config.in          |  0
 .../ti-k3-image-gen/ti-k3-image-gen.hash            |  0
 boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk |  0
 boot/{ => ti-k3}/ti-k3-r5-loader/Config.in          |  0
 .../ti-k3-r5-loader/ti-k3-r5-loader.hash            |  0
 boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk |  0
 configs/ti_am62x_sk_defconfig                       |  1 +
 configs/ti_am64x_sk_defconfig                       |  1 +
 17 files changed, 17 insertions(+), 4 deletions(-)
 create mode 100644 boot/ti-k3/Config.in
 create mode 100644 boot/ti-k3/common.mk
 rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
 rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
 rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
 rename boot/{ => ti-k3}/ti-k3-core-secdev/Config.in (100%)
 rename boot/{ => ti-k3}/ti-k3-core-secdev/ti-k3-core-secdev.hash (100%)
 rename boot/{ => ti-k3}/ti-k3-core-secdev/ti-k3-core-secdev.mk (100%)
 rename boot/{ => ti-k3}/ti-k3-image-gen/Config.in (100%)
 rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
 rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (100%)
 rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (100%)
 rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (100%)
 rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (100%)

diff --git a/boot/Config.in b/boot/Config.in
index 18a7d268f95a..74a64a096afc 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -19,10 +19,7 @@ source "boot/opensbi/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/shim/Config.in"
 source "boot/syslinux/Config.in"
-source "boot/ti-k3-boot-firmware/Config.in"
-source "boot/ti-k3-core-secdev/Config.in"
-source "boot/ti-k3-image-gen/Config.in"
-source "boot/ti-k3-r5-loader/Config.in"
+source "boot/ti-k3/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
 
diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
new file mode 100644
index 000000000000..06dda2f156a9
--- /dev/null
+++ b/boot/ti-k3/Config.in
@@ -0,0 +1,13 @@
+config BR2_TARGET_TI_K3
+	bool "TI K3"
+	help
+	  The TI K3 bootloaders and tools.
+
+if BR2_TARGET_TI_K3
+
+source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
+source "boot/ti-k3/ti-k3-core-secdev/Config.in"
+source "boot/ti-k3/ti-k3-image-gen/Config.in"
+source "boot/ti-k3/ti-k3-r5-loader/Config.in"
+
+endif
diff --git a/boot/ti-k3/common.mk b/boot/ti-k3/common.mk
new file mode 100644
index 000000000000..18a1329baa4c
--- /dev/null
+++ b/boot/ti-k3/common.mk
@@ -0,0 +1 @@
+include $(sort $(wildcard boot/ti-k3/*/*.mk))
diff --git a/boot/ti-k3-boot-firmware/Config.in b/boot/ti-k3/ti-k3-boot-firmware/Config.in
similarity index 100%
rename from boot/ti-k3-boot-firmware/Config.in
rename to boot/ti-k3/ti-k3-boot-firmware/Config.in
diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.hash b/boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
similarity index 100%
rename from boot/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
rename to boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk b/boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
similarity index 100%
rename from boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
rename to boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3/ti-k3-core-secdev/Config.in
similarity index 100%
rename from boot/ti-k3-core-secdev/Config.in
rename to boot/ti-k3/ti-k3-core-secdev/Config.in
diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
similarity index 100%
rename from boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
rename to boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
similarity index 100%
rename from boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
rename to boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
similarity index 100%
rename from boot/ti-k3-image-gen/Config.in
rename to boot/ti-k3/ti-k3-image-gen/Config.in
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.hash
similarity index 100%
rename from boot/ti-k3-image-gen/ti-k3-image-gen.hash
rename to boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.hash
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
similarity index 100%
rename from boot/ti-k3-image-gen/ti-k3-image-gen.mk
rename to boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3/ti-k3-r5-loader/Config.in
similarity index 100%
rename from boot/ti-k3-r5-loader/Config.in
rename to boot/ti-k3/ti-k3-r5-loader/Config.in
diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.hash
similarity index 100%
rename from boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
rename to boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.hash
diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
similarity index 100%
rename from boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
rename to boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index 4de39fb897fd..cd26235342e4 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -23,6 +23,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
 BR2_TARGET_OPTEE_OS=y
 BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
 BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
+BR2_TARGET_TI_K3=y
 BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
index 5fd9653b5b8f..1befeb4ab96c 100644
--- a/configs/ti_am64x_sk_defconfig
+++ b/configs/ti_am64x_sk_defconfig
@@ -23,6 +23,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
 BR2_TARGET_OPTEE_OS=y
 BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
 BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
+BR2_TARGET_TI_K3=y
 BR2_TARGET_TI_K3_IMAGE_GEN=y
 BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (16 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 20:33   ` Alexander Sverdlin
  2024-02-19 10:28   ` Romain Naour
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin Dario Binacchi
                   ` (4 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent versions of U-Boot can use Binman to compile and sign the generated
binaries, thus making the use of custom tools like ti-k3-image-gen no
longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
configured and used outside of it. This patch allows setting such options
even if the package is not enabled.

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/ti-k3/Config.in                          | 46 ++++++++++++++
 boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
 boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
 boot/uboot/Config.in                          |  7 +--
 configs/ti_am62x_sk_defconfig                 |  2 +-
 configs/ti_am64x_sk_defconfig                 |  2 +-
 6 files changed, 59 insertions(+), 67 deletions(-)

diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
index 06dda2f156a9..9e508326c9c8 100644
--- a/boot/ti-k3/Config.in
+++ b/boot/ti-k3/Config.in
@@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
 
 if BR2_TARGET_TI_K3
 
+choice
+	prompt "SoC family"
+
+config BR2_TARGET_TI_K3_SOC_AM62AX
+	bool "am62ax"
+
+config BR2_TARGET_TI_K3_SOC_AM62X
+	bool "am62x"
+
+config BR2_TARGET_TI_K3_SOC_AM64X
+	bool "am64x"
+
+config BR2_TARGET_TI_K3_SOC_AM65X
+	bool "am65x"
+
+endchoice
+
+choice
+	prompt "Security type"
+	help
+	  The target SoC security type option.
+
+config BR2_TARGET_TI_K3_SECTYPE_GP
+	bool "gp"
+
+config BR2_TARGET_TI_K3_SECTYPE_HS_FS
+	bool "hs-fs"
+
+config BR2_TARGET_TI_K3_SECTYPE_HS
+	bool "hs"
+
+endchoice
+
+config BR2_TARGET_TI_K3_SOC
+	string
+	default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
+	default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
+	default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
+	default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
+
+config BR2_TARGET_TI_K3_SECTYPE
+	string
+	default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
+	default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
+	default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
+
 source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
 source "boot/ti-k3/ti-k3-core-secdev/Config.in"
 source "boot/ti-k3/ti-k3-image-gen/Config.in"
diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
index 38d1598d9fc0..2d53d62dd4ee 100644
--- a/boot/ti-k3/ti-k3-image-gen/Config.in
+++ b/boot/ti-k3/ti-k3-image-gen/Config.in
@@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
 	bool "ti-k3-image-gen"
 	depends on BR2_TARGET_TI_K3_R5_LOADER
 	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
-	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
+	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
 	# We need FIT support in uboot-tools, which is why we select a
 	# host package
 	select BR2_PACKAGE_HOST_UBOOT_TOOLS
@@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
 	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
 
 if BR2_TARGET_TI_K3_IMAGE_GEN
-choice
-	prompt "SoC family"
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
-	bool "am62ax"
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
-	bool "am62x"
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
-	bool "am64x"
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
-	bool "am65x"
-
-endchoice
-
-choice
-	prompt "Security type"
-	help
-	  The target SoC security type option for image gen.  Valid
-	  options are "gp" for General Purpose devices, "hs-fs" for
-	  High Security - Field Securable devices, or "hs" for High
-	  Security - Security Enforcing devices.  Note for all High
-	  Security device variants the TI_SECURE_DEV_PKG environmental
-	  variable must be defined at build time pointing to a valid
-	  core-secdev-k3 folder location, otherwise the build will
-	  fail, see
-	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
-	bool "gp"
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
-	bool "hs-fs"
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
-	bool "hs"
-
-endchoice
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
-	string
-	default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
-	default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
-	default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
-	default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
 
 config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
 	string
-	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
-	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
-	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
-	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
-
-config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
-	string
-	default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
-	default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
-	default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
+	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
+	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
+	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
+	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
 
 endif
diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
index 74b4fcb4bf89..834d8f7d5cd5 100644
--- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
+++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
@@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
 	$(BR2_MAKE_HOST_DEPENDENCY)
 
 TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
-TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
-TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
+TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
+TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
 
-ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
+ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
 TI_K3_IMAGE_GEN_SYSFW = \
 	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
 else
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index beafb38930db..1a9d21e7c6d1 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -244,8 +244,7 @@ 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
+	depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
 	help
 	  Some TI K3 devices need the Device Manager (DM) firmware to
 	  be available for the U-Boot build.
@@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
 
 config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
 	string
-	default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
-	default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
+	default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
+	default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
 
 endif
 
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index cd26235342e4..cfefce0a77a4 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
 BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
 BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
 BR2_TARGET_TI_K3=y
+BR2_TARGET_TI_K3_SOC_AM62X=y
 BR2_TARGET_TI_K3_IMAGE_GEN=y
-BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
index 1befeb4ab96c..daf78dbffff8 100644
--- a/configs/ti_am64x_sk_defconfig
+++ b/configs/ti_am64x_sk_defconfig
@@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
 BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
 BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
 BR2_TARGET_TI_K3=y
+BR2_TARGET_TI_K3_SOC_AM64X=y
 BR2_TARGET_TI_K3_IMAGE_GEN=y
-BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
 BR2_TARGET_TI_K3_R5_LOADER=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (17 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-17 17:28   ` Alexander Sverdlin
  2024-02-20 22:34   ` Andreas Dannenberg via buildroot
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 20/20] configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore Dario Binacchi
                   ` (3 subsequent siblings)
  22 siblings, 2 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent versions of U-Boot are capable of building tiboot3.bin using
Binman. In this case, let's copy it to the binaries directory.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
index 2a10024aedaa..643298a1e70a 100644
--- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
+++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
@@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
 endef
 
+TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
+
 define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
 	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
+	find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
 endef
 
 $(eval $(kconfig-package))
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [Buildroot] [PATCH v4 20/20] configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (18 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin Dario Binacchi
@ 2024-02-17 16:02 ` Dario Binacchi
  2024-02-19 10:31   ` Romain Naour
  2024-02-17 17:40 ` [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Alexander Sverdlin
                   ` (2 subsequent siblings)
  22 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-17 16:02 UTC (permalink / raw)
  To: buildroot
  Cc: Dario Binacchi, michael, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, Romain Naour,
	Andreas Dannenberg, Alexander Sverdlin, bryce, Anand Gadiyar

Recent versions of U-Boot are capable of building tiboot3.bin using
Binman. So it's no longer necessary to use custom tools like
ti-k3-image-gen.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

---

Added in v4

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 configs/ti_am62x_sk_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index cfefce0a77a4..6259dec5985d 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -25,7 +25,7 @@ BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
 BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
 BR2_TARGET_TI_K3=y
 BR2_TARGET_TI_K3_SOC_AM62X=y
-BR2_TARGET_TI_K3_IMAGE_GEN=y
+BR2_TARGET_TI_K3_BOOT_FIRMWARE=y
 BR2_TARGET_TI_K3_R5_LOADER=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
 BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package Dario Binacchi
@ 2024-02-17 17:06   ` Alexander Sverdlin
  2024-02-18 13:20     ` Dario Binacchi
  2024-02-19  9:48   ` Romain Naour
  1 sibling, 1 reply; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 17:06 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hello Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> This is a security development package containing tools for
> High-Security(HS) TI K3 platform devices.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

as I understand secdev package is not required for binman-based
U-Boot deployments starting from v2023.10.

So what is the point of introducing the package now if you update
U-Boot to v2024.01?

I belive it's as legacy as ti-k3-image-gen (which you are fixing)
but Romain's patchset removed the package and, quite successfully,
from the perspective of building for HS variants.

> ---
> 
> Changes in v4:
> - Remove the trailing '/' at the end of the url in the help of
>   Config.in
> - Fixed license issues
> - Use $(BINARIES_DIR)/ti-k3-core-secdev as the directory where to
>   install files.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  DEVELOPERS                                    |  1 +
>  boot/Config.in                                |  1 +
>  boot/ti-k3-core-secdev/Config.in              |  9 ++++++++
>  boot/ti-k3-core-secdev/ti-k3-core-secdev.hash |  3 +++
>  boot/ti-k3-core-secdev/ti-k3-core-secdev.mk   | 22 +++++++++++++++++++
>  5 files changed, 36 insertions(+)
>  create mode 100644 boot/ti-k3-core-secdev/Config.in
>  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
>  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 0d12c3abcb11..33d99ab2440f 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -753,6 +753,7 @@ F:	package/xinetd/
>  N:	Dario Binacchi <dario.binacchi@amarulasolutions.com>
>  F:	board/bsh/
>  F:	board/stmicroelectronics/stm32f769-disco/
> +F:	boot/ti-k3-core-secdev/
>  F:	configs/imx8mn_bsh_smm_s2_defconfig
>  F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
>  F:	configs/stm32f769_disco_sd_defconfig
> diff --git a/boot/Config.in b/boot/Config.in
> index e5fdf7ad439e..18a7d268f95a 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -20,6 +20,7 @@ source "boot/s500-bootloader/Config.in"
>  source "boot/shim/Config.in"
>  source "boot/syslinux/Config.in"
>  source "boot/ti-k3-boot-firmware/Config.in"
> +source "boot/ti-k3-core-secdev/Config.in"
>  source "boot/ti-k3-image-gen/Config.in"
>  source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
> diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3-core-secdev/Config.in
> new file mode 100644
> index 000000000000..f7b4e2962042
> --- /dev/null
> +++ b/boot/ti-k3-core-secdev/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_TARGET_TI_K3_CORE_SECDEV
> +	bool "ti-k3-core-secdev"
> +	depends on BR2_aarch64
> +	help
> +	  This package downloads and installs development tools for
> +	  High-Security(HS) TI K3 platforms (which include AM62x,
> +	  AM64x, AM65x and more).
> +
> +	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> new file mode 100644
> index 000000000000..e3074a398d62
> --- /dev/null
> +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256  b6d3bca0d561d055c6869c5564b06f2fb1b9f67e4ef180c2baf8a14a6a6afa06  core-secdev-k3-08.06.00.007.tar.xz
> +sha256  3e5cf4f5ab9f0333f46cd68fabede3f21e55de1a9e3c6ad673f241f4514d8369  manifest/k3-secdev-0.2-manifest.html
> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> new file mode 100644
> index 000000000000..f7655a0fefc8
> --- /dev/null
> +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# ti-k3-core-secdev
> +#
> +################################################################################
> +
> +TI_K3_CORE_SECDEV_VERSION = 08.06.00.007
> +TI_K3_CORE_SECDEV_SITE = https://git.ti.com/cgit/security-development-tools/core-secdev-k3/snapshot
> +TI_K3_CORE_SECDEV_SOURCE = core-secdev-k3-$(TI_K3_CORE_SECDEV_VERSION).tar.xz
> +TI_K3_CORE_SECDEV_INSTALL_IMAGES = YES
> +TI_K3_CORE_SECDEV_LICENSE = BSD-3-Clause
> +TI_K3_CORE_SECDEV_LICENSE_FILES = manifest/k3-secdev-0.2-manifest.html
> +
> +TI_K3_CORE_SECDEV_INSTALL_DIR = $(BINARIES_DIR)/ti-k3-core-secdev
> +
> +define TI_K3_CORE_SECDEV_INSTALL_IMAGES_CMDS
> +	mkdir -p $(TI_K3_CORE_SECDEV_INSTALL_DIR)
> +	cp -dpfr $(@D)/keys $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> +	cp -dpfr $(@D)/scripts $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> +endef
> +
> +$(eval $(generic-package))

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin Dario Binacchi
@ 2024-02-17 17:28   ` Alexander Sverdlin
  2024-02-18 13:30     ` Dario Binacchi
  2024-02-18 13:38     ` Dario Binacchi
  2024-02-20 22:34   ` Andreas Dannenberg via buildroot
  1 sibling, 2 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 17:28 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> Recent versions of U-Boot are capable of building tiboot3.bin using
> Binman. In this case, let's copy it to the binaries directory.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-12-romain.naour@smile.fr/

looks more complete with sysfw.itb?

> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> index 2a10024aedaa..643298a1e70a 100644
> --- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> +++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
>  endef
>  
> +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> +
>  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
>  	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> +	find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
>  endef
>  
>  $(eval $(kconfig-package))

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (19 preceding siblings ...)
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 20/20] configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore Dario Binacchi
@ 2024-02-17 17:40 ` Alexander Sverdlin
  2024-02-19 10:35   ` Romain Naour
  2024-02-19 22:42   ` Patrick Oppenlander
  2024-02-17 21:14 ` Alexander Sverdlin
  2024-02-19  9:30 ` Romain Naour
  22 siblings, 2 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 17:40 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario!

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> This series, which in my humble opinion, should have been immediately
> considered to correct the compilation errors in case of HS-FS devcies, has
> seen an increase in patches in version 4 to remove the ti-k3-image-gen

I wasn't aware of the preceeding versions, but...

> package thanks to Binman. Additionally, it shares some modifications and
> views on how to implement certain changes with the series
> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> Therefore, I think it is necessary not to run them in parallel but to decide
> whether to merge one before the other or to consider a single series where
> the patches can be coherent with each other. I am available for both solutions.
> Let me know.

... as the broken HS-FS went unnoticed, seems there is no rush to fix the
build now? I'd vote for a combined series, because yours and Romains do
overlap here and there, but I personally would pick different parts from
different series. I'd not introduce secdev package unless absolutely
necessary, and I actually build HS-FS images with yocto with custom keys
and using upstream U-Boot binman alone, so maybe I miss something, but
I don't see the package as required.

From my side I can offer testing on SK-AM62x variants, both GP and HS-FS.
I will definitely test your v4 because in contrast to Romain's U-Boot
v2024.01 bump yours may actually boot...

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting Dario Binacchi
@ 2024-02-17 20:06   ` Alexander Sverdlin
  2024-02-19  9:36   ` Romain Naour
  1 sibling, 0 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:06 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> Checking the output of the command `git grep PLATFORM | grep k3`, we can
> found the proper settings for the optee-os package:
> 
> .github/workflows/ci.yml:          _make PLATFORM=k3-am62x
> .github/workflows/ci.yml:          _make PLATFORM=k3-am62x CFG_ARM64_core=y
> ...
> core/arch/arm/plat-k3/conf.mk:ifneq (,$(filter ${PLATFORM_FLAVOR},am65x j721e j784s4 am64x am62x))
> 
> Suggested-by: Romain Naour <romain.naour@smile.fr>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  configs/ti_am62x_sk_defconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index f88252a89c68..fde6f8f5636a 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -21,7 +21,8 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>  BR2_TARGET_OPTEE_OS=y
> -BR2_TARGET_OPTEE_OS_PLATFORM="k3"
> +BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> +BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y

this looks even more complete than https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-3-romain.naour@smile.fr/

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

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 02/20] configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 02/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
@ 2024-02-17 20:08   ` Alexander Sverdlin
  0 siblings, 0 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:08 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> Checking the output of the command `git grep PLATFORM | grep k3`, we can
> found the proper settings for the optee-os package:
> 
> .github/workflows/ci.yml:          _make PLATFORM=k3-am64x
> .github/workflows/ci.yml:          _make PLATFORM=k3-am64x CFG_ARM64_core=y
> ...
> core/arch/arm/plat-k3/conf.mk:ifneq (,$(filter ${PLATFORM_FLAVOR},am65x j721e j784s4 am64x am62x))
> 
> Suggested-by: Romain Naour <romain.naour@smile.fr>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  configs/ti_am64x_sk_defconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> index 4bfd31f0c8d3..98476c88626b 100644
> --- a/configs/ti_am64x_sk_defconfig
> +++ b/configs/ti_am64x_sk_defconfig
> @@ -21,7 +21,8 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>  BR2_TARGET_OPTEE_OS=y
> -BR2_TARGET_OPTEE_OS_PLATFORM="k3"
> +BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
> +BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y

again, more complete than https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-4-romain.naour@smile.fr/

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

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01 Dario Binacchi
@ 2024-02-17 20:20   ` Alexander Sverdlin
  2024-02-18 13:49     ` Dario Binacchi
  0 siblings, 1 reply; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:20 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> The 2024.01 version of U-Boot for the am62x-sk board has introduced two
> major changes:
> - The device tree k3-am625-sk.dtb is no longer searched in /boot, but in
>   /boot/dtb/ti. Hence, the disabling of BR2_LINUX_KERNEL_INSTALL_TARGET
>   and the use of extlinux.conf for the proper loading of the device tree.
>   Furthermore, the parameter BR2_ROOTFS_POST_SCRIPT_ARGS was used to
>   auto-generate the extlinux.conf file so that developers can change the
>   kernel loading options by modifying the .config.
> - The use of binman for building images.
> 
> Tested on SK-AM62B-P1.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

[]

> @@ -27,14 +27,15 @@ BR2_TARGET_TI_K3_IMAGE_GEN=y
>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> -BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
> +BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"

Is patch 3/20 really required in this case?
Is custom version required if you set the same version as default in patch
5/20?

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1 Dario Binacchi
@ 2024-02-17 20:27   ` Alexander Sverdlin
  2024-02-18 13:50     ` Dario Binacchi
  0 siblings, 1 reply; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:27 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> Tested on SK-AM62B-P1.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Changes in v4
> - Add BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6 to ti_am62x_sk_defconfig.
> 
> no changes since v1
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  configs/ti_am62x_sk_defconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index 193301c8b941..4de39fb897fd 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -1,11 +1,11 @@
>  BR2_aarch64=y
> -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
>  BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh"
>  BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh"
>  BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000"
>  BR2_LINUX_KERNEL=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.16"
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.1"

Could be updated to v6.6.17 if you re-spin?

>  BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>  BR2_LINUX_KERNEL_DTS_SUPPORT=y
>  BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am625-sk"

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope Dario Binacchi
@ 2024-02-17 20:33   ` Alexander Sverdlin
  2024-02-18 13:52     ` Dario Binacchi
  2024-02-19 10:28   ` Romain Naour
  1 sibling, 1 reply; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:33 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> Recent versions of U-Boot can use Binman to compile and sign the generated
> binaries, thus making the use of custom tools like ti-k3-image-gen no
> longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> configured and used outside of it. This patch allows setting such options
> even if the package is not enabled.

Missing SoB?

The patch looks more complete to me than https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-13-romain.naour@smile.fr/
because of SECTYPE variables.

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

> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3/Config.in                          | 46 ++++++++++++++
>  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
>  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
>  boot/uboot/Config.in                          |  7 +--
>  configs/ti_am62x_sk_defconfig                 |  2 +-
>  configs/ti_am64x_sk_defconfig                 |  2 +-
>  6 files changed, 59 insertions(+), 67 deletions(-)
> 
> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> index 06dda2f156a9..9e508326c9c8 100644
> --- a/boot/ti-k3/Config.in
> +++ b/boot/ti-k3/Config.in
> @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
>  
>  if BR2_TARGET_TI_K3
>  
> +choice
> +	prompt "SoC family"
> +
> +config BR2_TARGET_TI_K3_SOC_AM62AX
> +	bool "am62ax"
> +
> +config BR2_TARGET_TI_K3_SOC_AM62X
> +	bool "am62x"
> +
> +config BR2_TARGET_TI_K3_SOC_AM64X
> +	bool "am64x"
> +
> +config BR2_TARGET_TI_K3_SOC_AM65X
> +	bool "am65x"
> +
> +endchoice
> +
> +choice
> +	prompt "Security type"
> +	help
> +	  The target SoC security type option.
> +
> +config BR2_TARGET_TI_K3_SECTYPE_GP
> +	bool "gp"
> +
> +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> +	bool "hs-fs"
> +
> +config BR2_TARGET_TI_K3_SECTYPE_HS
> +	bool "hs"
> +
> +endchoice
> +
> +config BR2_TARGET_TI_K3_SOC
> +	string
> +	default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> +	default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> +	default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> +	default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> +
> +config BR2_TARGET_TI_K3_SECTYPE
> +	string
> +	default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> +	default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> +	default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> +
>  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
>  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
>  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> index 38d1598d9fc0..2d53d62dd4ee 100644
> --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>  	bool "ti-k3-image-gen"
>  	depends on BR2_TARGET_TI_K3_R5_LOADER
>  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> -	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
>  	# We need FIT support in uboot-tools, which is why we select a
>  	# host package
>  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>  	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
>  
>  if BR2_TARGET_TI_K3_IMAGE_GEN
> -choice
> -	prompt "SoC family"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	bool "am62ax"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> -	bool "am62x"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> -	bool "am64x"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> -	bool "am65x"
> -
> -endchoice
> -
> -choice
> -	prompt "Security type"
> -	help
> -	  The target SoC security type option for image gen.  Valid
> -	  options are "gp" for General Purpose devices, "hs-fs" for
> -	  High Security - Field Securable devices, or "hs" for High
> -	  Security - Security Enforcing devices.  Note for all High
> -	  Security device variants the TI_SECURE_DEV_PKG environmental
> -	  variable must be defined at build time pointing to a valid
> -	  core-secdev-k3 folder location, otherwise the build will
> -	  fail, see
> -	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> -	bool "gp"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> -	bool "hs-fs"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> -	bool "hs"
> -
> -endchoice
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> -	string
> -	default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> -	default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> -	default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>  
>  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
>  	string
> -	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> -	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> -	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> -	string
> -	default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> -	default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> -	default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> +	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> +	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> +	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> +	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
>  
>  endif
> diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> index 74b4fcb4bf89..834d8f7d5cd5 100644
> --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
>  	$(BR2_MAKE_HOST_DEPENDENCY)
>  
>  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
>  
> -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
>  TI_K3_IMAGE_GEN_SYSFW = \
>  	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
>  else
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index beafb38930db..1a9d21e7c6d1 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -244,8 +244,7 @@ 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
> +	depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
>  	help
>  	  Some TI K3 devices need the Device Manager (DM) firmware to
>  	  be available for the U-Boot build.
> @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>  
>  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>  	string
> -	default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> +	default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> +	default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
>  
>  endif
>  
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index cd26235342e4..cfefce0a77a4 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>  BR2_TARGET_TI_K3=y
> +BR2_TARGET_TI_K3_SOC_AM62X=y
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> index 1befeb4ab96c..daf78dbffff8 100644
> --- a/configs/ti_am64x_sk_defconfig
> +++ b/configs/ti_am64x_sk_defconfig
> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
>  BR2_TARGET_TI_K3=y
> +BR2_TARGET_TI_K3_SOC_AM64X=y
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment Dario Binacchi
@ 2024-02-17 20:38   ` Alexander Sverdlin
  2024-02-19 10:40     ` Romain Naour
  2024-02-19 10:15   ` Romain Naour
  1 sibling, 1 reply; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:38 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> Recent version of U-Boot use binman to provide a mechanism for building
> images, from simple SPL + U-Boot combinations, to more complex
> arrangements with many parts.
> 
> The patch set the BINMAN_INDIRS environment variable to provide the
> directory to search for binary blobs and select the packages required by
> binman.
> 
> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

I personally do not see why binman usage should be configurable as in
https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/
your patch looks simpler,

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

> ---
> 
> Changes in v4:
> - Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> 
> Changes in v2:
> - Change commit message
> - Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> - Select packages required by binman if
>   BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> 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 0ffcb8235f2e..2a10024aedaa 100644
> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
>  	host-pkgconf \
>  	$(BR2_MAKE_HOST_DEPENDENCY) \
>  	host-arm-gnu-toolchain \
> -	host-openssl
> +	host-openssl \
> +	host-python-attrs \
> +	host-python-jsonschema \
> +	host-python-jsonschema-specifications \
> +	host-python-pyyaml \
> +	host-python-referencing \
> +	host-python-rpds-py
>  
>  TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
>  TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
> @@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
>  	$(BR2_BISON_HOST_DEPENDENCY) \
>  	$(BR2_FLEX_HOST_DEPENDENCY)
>  
> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
> +TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
> +endif
> +
>  ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
>  TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
>  else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
> @@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
>  	CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>  	ARCH=arm \
>  	HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
> +	BINMAN_INDIRS=$(BINARIES_DIR) \
>  	HOSTLDFLAGS="$(HOST_LDFLAGS)"
>  
>  define TI_K3_R5_LOADER_BUILD_CMDS

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM Dario Binacchi
@ 2024-02-17 20:44   ` Alexander Sverdlin
  2024-02-18 13:55     ` Dario Binacchi
  2024-02-19 20:51     ` Andreas Dannenberg via buildroot
  2024-02-19 10:19   ` Romain Naour
  1 sibling, 2 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 20:44 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> As explained in [1], adding support for AM62x LP SK in U-Boot, requires
> binman for building bootloader images. The BINMAN_INDIRS environment
> variable is used to provide a space-separated list of directories to
> search for binary blobs.
> 
> [1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> no changes since v1:
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/uboot/uboot.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index dda606a88059..cf70f86a4132 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -189,7 +189,8 @@ endif
>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
>  UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
>  UBOOT_DEPENDENCIES += ti-k3-boot-firmware
> -UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
> +UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \

Is the above actually still required with binman?
The names are hardcoded in U-Boot in arch/arm/dts/k3-am625-sk-binman.dtsi

> +	BINMAN_INDIRS=$(BINARIES_DIR)

This seems to be the only required part.

>  endif
>  
>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory Dario Binacchi
@ 2024-02-17 21:05   ` François Perrad
  2024-02-18 13:59     ` Dario Binacchi
  0 siblings, 1 reply; 84+ messages in thread
From: François Perrad @ 2024-02-17 21:05 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	Alexander Sverdlin, bryce, Anand Gadiyar


[-- Attachment #1.1: Type: text/plain, Size: 8029 bytes --]

Le sam. 17 févr. 2024 à 17:03, Dario Binacchi <
dario.binacchi@amarulasolutions.com> a écrit :

> Move all TI K3 packages to the directory ti-k3.
>

The Buildroot documentation states that "New subdirectories are
discouraged".
See https://buildroot.org/downloads/manual/manual.html#_package_directory

François


> This patch is preparatory for future developments.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> ---
>
> Added in v4
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/Config.in                                      |  5 +----
>  boot/ti-k3/Config.in                                | 13 +++++++++++++
>  boot/ti-k3/common.mk                                |  1 +
>  boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in      |  0
>  .../ti-k3-boot-firmware/ti-k3-boot-firmware.hash    |  0
>  .../ti-k3-boot-firmware/ti-k3-boot-firmware.mk      |  0
>  boot/{ => ti-k3}/ti-k3-core-secdev/Config.in        |  0
>  .../ti-k3-core-secdev/ti-k3-core-secdev.hash        |  0
>  .../ti-k3-core-secdev/ti-k3-core-secdev.mk          |  0
>  boot/{ => ti-k3}/ti-k3-image-gen/Config.in          |  0
>  .../ti-k3-image-gen/ti-k3-image-gen.hash            |  0
>  boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk |  0
>  boot/{ => ti-k3}/ti-k3-r5-loader/Config.in          |  0
>  .../ti-k3-r5-loader/ti-k3-r5-loader.hash            |  0
>  boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk |  0
>  configs/ti_am62x_sk_defconfig                       |  1 +
>  configs/ti_am64x_sk_defconfig                       |  1 +
>  17 files changed, 17 insertions(+), 4 deletions(-)
>  create mode 100644 boot/ti-k3/Config.in
>  create mode 100644 boot/ti-k3/common.mk
>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
> (100%)
>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
>  rename boot/{ => ti-k3}/ti-k3-core-secdev/Config.in (100%)
>  rename boot/{ => ti-k3}/ti-k3-core-secdev/ti-k3-core-secdev.hash (100%)
>  rename boot/{ => ti-k3}/ti-k3-core-secdev/ti-k3-core-secdev.mk (100%)
>  rename boot/{ => ti-k3}/ti-k3-image-gen/Config.in (100%)
>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (100%)
>  rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (100%)
>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (100%)
>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (100%)
>
> diff --git a/boot/Config.in b/boot/Config.in
> index 18a7d268f95a..74a64a096afc 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -19,10 +19,7 @@ source "boot/opensbi/Config.in"
>  source "boot/s500-bootloader/Config.in"
>  source "boot/shim/Config.in"
>  source "boot/syslinux/Config.in"
> -source "boot/ti-k3-boot-firmware/Config.in"
> -source "boot/ti-k3-core-secdev/Config.in"
> -source "boot/ti-k3-image-gen/Config.in"
> -source "boot/ti-k3-r5-loader/Config.in"
> +source "boot/ti-k3/Config.in"
>  source "boot/uboot/Config.in"
>  source "boot/vexpress-firmware/Config.in"
>
> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> new file mode 100644
> index 000000000000..06dda2f156a9
> --- /dev/null
> +++ b/boot/ti-k3/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_TARGET_TI_K3
> +       bool "TI K3"
> +       help
> +         The TI K3 bootloaders and tools.
> +
> +if BR2_TARGET_TI_K3
> +
> +source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
> +source "boot/ti-k3/ti-k3-core-secdev/Config.in"
> +source "boot/ti-k3/ti-k3-image-gen/Config.in"
> +source "boot/ti-k3/ti-k3-r5-loader/Config.in"
> +
> +endif
> diff --git a/boot/ti-k3/common.mk b/boot/ti-k3/common.mk
> new file mode 100644
> index 000000000000..18a1329baa4c
> --- /dev/null
> +++ b/boot/ti-k3/common.mk
> @@ -0,0 +1 @@
> +include $(sort $(wildcard boot/ti-k3/*/*.mk))
> diff --git a/boot/ti-k3-boot-firmware/Config.in
> b/boot/ti-k3/ti-k3-boot-firmware/Config.in
> similarity index 100%
> rename from boot/ti-k3-boot-firmware/Config.in
> rename to boot/ti-k3/ti-k3-boot-firmware/Config.in
> diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
> b/boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
> similarity index 100%
> rename from boot/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
> rename to boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
> diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
> b/boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
> similarity index 100%
> rename from boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
> rename to boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
> diff --git a/boot/ti-k3-core-secdev/Config.in
> b/boot/ti-k3/ti-k3-core-secdev/Config.in
> similarity index 100%
> rename from boot/ti-k3-core-secdev/Config.in
> rename to boot/ti-k3/ti-k3-core-secdev/Config.in
> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> b/boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
> similarity index 100%
> rename from boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> rename to boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> b/boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
> similarity index 100%
> rename from boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> rename to boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
> diff --git a/boot/ti-k3-image-gen/Config.in
> b/boot/ti-k3/ti-k3-image-gen/Config.in
> similarity index 100%
> rename from boot/ti-k3-image-gen/Config.in
> rename to boot/ti-k3/ti-k3-image-gen/Config.in
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash
> b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.hash
> similarity index 100%
> rename from boot/ti-k3-image-gen/ti-k3-image-gen.hash
> rename to boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.hash
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> similarity index 100%
> rename from boot/ti-k3-image-gen/ti-k3-image-gen.mk
> rename to boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> diff --git a/boot/ti-k3-r5-loader/Config.in
> b/boot/ti-k3/ti-k3-r5-loader/Config.in
> similarity index 100%
> rename from boot/ti-k3-r5-loader/Config.in
> rename to boot/ti-k3/ti-k3-r5-loader/Config.in
> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
> b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.hash
> similarity index 100%
> rename from boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
> rename to boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.hash
> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> similarity index 100%
> rename from boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> rename to boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index 4de39fb897fd..cd26235342e4 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -23,6 +23,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>  BR2_TARGET_OPTEE_OS=y
>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
> +BR2_TARGET_TI_K3=y
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> index 5fd9653b5b8f..1befeb4ab96c 100644
> --- a/configs/ti_am64x_sk_defconfig
> +++ b/configs/ti_am64x_sk_defconfig
> @@ -23,6 +23,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>  BR2_TARGET_OPTEE_OS=y
>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
> +BR2_TARGET_TI_K3=y
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
> --
> 2.43.0
>
>

[-- Attachment #1.2: Type: text/html, Size: 11641 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (20 preceding siblings ...)
  2024-02-17 17:40 ` [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Alexander Sverdlin
@ 2024-02-17 21:14 ` Alexander Sverdlin
  2024-02-19  9:30 ` Romain Naour
  22 siblings, 0 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 21:14 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
> high-security field-securable (HS-FS) silicon to optionally customize keys
> and encryption for security applications.
> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
> which, however, was buggy. This series fixes the errors and bumps the Linux
> kernel and U-Boot required for such a new device.
> 
> This series, which in my humble opinion, should have been immediately
> considered to correct the compilation errors in case of HS-FS devcies, has
> seen an increase in patches in version 4 to remove the ti-k3-image-gen
> package thanks to Binman. Additionally, it shares some modifications and
> views on how to implement certain changes with the series
> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> Therefore, I think it is necessary not to run them in parallel but to decide
> whether to merge one before the other or to consider a single series where
> the patches can be coherent with each other. I am available for both solutions.
> Let me know.
> 
> Dario Binacchi (20):
>   configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
>     setting
>   configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
>     setting
>   configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader
>     version
>   configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader
>     version
>   boot/ti-k3-r5-loader: bump to version 2024.01
>   boot/ti-k3-core-secdev: new package
>   boot/ti-k3-image-gen: manage HS hardware
>   package/python-jsonschema: add host variant
>   package/python-attrs: add host variant
>   package/python-referencing: add host variant
>   package/python-rpds-py: add host variant
>   package/python-jsonschema-specifications: add host variant
>   boot/ti-k3-r5-loader: set binman environment
>   boot/uboot: set BINMAN_INDIRS for TI K3 DM
>   configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
>   configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
>   boot: move ti-k3-* packages to 'ti-k3' directory
>   boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
>   boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
>   configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore

the series:
- builds and starts on SK-AM62B (HS-FS)
- builds for am62x GP

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

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware Dario Binacchi
@ 2024-02-17 23:45   ` Alexander Sverdlin
  2024-02-18 14:01     ` Dario Binacchi
                       ` (2 more replies)
  2024-02-19  9:58   ` Romain Naour
  1 sibling, 3 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-17 23:45 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Romain Naour, Andreas Dannenberg,
	linux-amarula, bryce, Anand Gadiyar

Hi Dario,

On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> The patch sets the configurations required by TI HS systems. Some of these
> configurations (i. e. HS SYSFW image signing key, HS Software Revision)
> are provided by the ti-k3-core-secdev package in the binaries directory.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

so for test I've reverted the previous "boot/ti-k3-core-secdev: new package"
commit, then...

> ---
> 
> no changes since v3:
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3-image-gen/Config.in          |  1 +
>  boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> index d76cef82e911..38d1598d9fc0 100644
> --- a/boot/ti-k3-image-gen/Config.in
> +++ b/boot/ti-k3-image-gen/Config.in
> @@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>  	bool "ti-k3-image-gen"
>  	depends on BR2_TARGET_TI_K3_R5_LOADER
>  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS

... removed this, ...

>  	# We need FIT support in uboot-tools, which is why we select a
>  	# host package
>  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> index 64be9a18f2c4..74b4fcb4bf89 100644
> --- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> @@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
>  TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
>  TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
>  
> -TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> +ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> +TI_K3_IMAGE_GEN_SYSFW = \
> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> +else
> +TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev

... the above line, ...

> +
> +TI_K3_IMAGE_GEN_SYSFW = \
> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
> +endif
>  
>  define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
> -	cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
> +	$(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
> +		cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
> +	)
>  endef
>  
>  define TI_K3_IMAGE_GEN_BUILD_CMDS
> @@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
>  	$(BR2_MAKE) -C $(@D) \
>  		SOC=$(TI_K3_IMAGE_GEN_SOC) \
>  		SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
> +		TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \

... and this line...

>  		CONFIG=evm \
>  		CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>  		SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \

... and everything still builds and boots fine on SK-AM62B (HS-FS):

U-Boot SPL 2024.01 (Feb 18 2024 - 00:02:43 +0100)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
SPL initial stack usage: 13400 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
Authentication passed
Authentication passed
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.7(release):v2.7
NOTICE:  BL31: Built : 23:57:43, Feb 17 2024
I/TC: 
I/TC: OP-TEE version: Unknown_4.0 (gcc version 12.3.0 (Buildroot 2023.11-1199-g470b2069e4)) #1 Sat Feb 17 22:57:38 UTC 2024 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
I/TC: Primary CPU switching to normal world boot

U-Boot SPL 2024.01 (Feb 18 2024 - 00:03:30 +0100)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
SPL initial stack usage: 1872 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed


U-Boot 2024.01 (Feb 18 2024 - 00:03:30 +0100)

SoC:   AM62X SR1.0 HS-FS
Model: Texas Instruments AM625 SK
DRAM:  2 GiB
Core:  56 devices, 23 uclasses, devicetree: separate
MMC:   mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from nowhere... OK
In:    serial@2800000
Out:   serial@2800000
Err:   serial@2800000
Net:   eth0: ethernet@8000000port@1
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load 'uEnv.txt'
Scanning for bootflows in all bootdevs
Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------  ----------------
Scanning global bootmeth 'efi_mgr':
No EFI system partition
No EFI system partition
Failed to persist EFI variables
Scanning bootdev 'mmc@fa00000.bootdev':
  0  extlinux     ready   mmc          1  mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
** Booting bootflow 'mmc@fa00000.bootdev.part_1' with extlinux
1:      am62x-sk-buildroot
Retrieving file: /Image
append: console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait earlycon=ns16550a,mmio32,0x02800000
Retrieving file: /k3-am62x.dtb
## Flattened Device Tree blob at ffb14700
   Booting using the fdt blob at 0xffb14700
Working FDT set to ffb14700
   Loading Device Tree to 000000008ffed000, end 000000008ffff687 ... OK
Working FDT set to 8ffed000

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 6.6.1 (...) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2023.11-1199-g470b2069e4) 12.3.0, GNU ld (GNU Binutils) 2.40) #1 SMP PREEMPT Sun Feb 18 
00:37:47 CET 2024



-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package
  2024-02-17 17:06   ` Alexander Sverdlin
@ 2024-02-18 13:20     ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:20 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hello Alexander,

On Sat, Feb 17, 2024 at 6:06 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hello Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > This is a security development package containing tools for
> > High-Security(HS) TI K3 platform devices.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> as I understand secdev package is not required for binman-based
> U-Boot deployments starting from v2023.10.
>
> So what is the point of introducing the package now if you update
> U-Boot to v2024.01?
>
> I belive it's as legacy as ti-k3-image-gen (which you are fixing)
> but Romain's patchset removed the package and, quite successfully,
> from the perspective of building for HS variants.

The series is a continuation of what I submitted for the first time at
the end of November when I still
didn't know that Binman made it possible to do without external tools.
I haven't removed it just to give
a complete overview of the patches available from then until now. In
the next version, I will remove them,
or perhaps, in the event that a single version with Romain's patches
is chosen, they will not be selected.

Thanks and regards,
Dario

>
> > ---
> >
> > Changes in v4:
> > - Remove the trailing '/' at the end of the url in the help of
> >   Config.in
> > - Fixed license issues
> > - Use $(BINARIES_DIR)/ti-k3-core-secdev as the directory where to
> >   install files.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  DEVELOPERS                                    |  1 +
> >  boot/Config.in                                |  1 +
> >  boot/ti-k3-core-secdev/Config.in              |  9 ++++++++
> >  boot/ti-k3-core-secdev/ti-k3-core-secdev.hash |  3 +++
> >  boot/ti-k3-core-secdev/ti-k3-core-secdev.mk   | 22 +++++++++++++++++++
> >  5 files changed, 36 insertions(+)
> >  create mode 100644 boot/ti-k3-core-secdev/Config.in
> >  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> >  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 0d12c3abcb11..33d99ab2440f 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -753,6 +753,7 @@ F:        package/xinetd/
> >  N:   Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >  F:   board/bsh/
> >  F:   board/stmicroelectronics/stm32f769-disco/
> > +F:   boot/ti-k3-core-secdev/
> >  F:   configs/imx8mn_bsh_smm_s2_defconfig
> >  F:   configs/imx8mn_bsh_smm_s2_pro_defconfig
> >  F:   configs/stm32f769_disco_sd_defconfig
> > diff --git a/boot/Config.in b/boot/Config.in
> > index e5fdf7ad439e..18a7d268f95a 100644
> > --- a/boot/Config.in
> > +++ b/boot/Config.in
> > @@ -20,6 +20,7 @@ source "boot/s500-bootloader/Config.in"
> >  source "boot/shim/Config.in"
> >  source "boot/syslinux/Config.in"
> >  source "boot/ti-k3-boot-firmware/Config.in"
> > +source "boot/ti-k3-core-secdev/Config.in"
> >  source "boot/ti-k3-image-gen/Config.in"
> >  source "boot/ti-k3-r5-loader/Config.in"
> >  source "boot/uboot/Config.in"
> > diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3-core-secdev/Config.in
> > new file mode 100644
> > index 000000000000..f7b4e2962042
> > --- /dev/null
> > +++ b/boot/ti-k3-core-secdev/Config.in
> > @@ -0,0 +1,9 @@
> > +config BR2_TARGET_TI_K3_CORE_SECDEV
> > +     bool "ti-k3-core-secdev"
> > +     depends on BR2_aarch64
> > +     help
> > +       This package downloads and installs development tools for
> > +       High-Security(HS) TI K3 platforms (which include AM62x,
> > +       AM64x, AM65x and more).
> > +
> > +       https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> > diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> > new file mode 100644
> > index 000000000000..e3074a398d62
> > --- /dev/null
> > +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> > @@ -0,0 +1,3 @@
> > +# Locally calculated
> > +sha256  b6d3bca0d561d055c6869c5564b06f2fb1b9f67e4ef180c2baf8a14a6a6afa06  core-secdev-k3-08.06.00.007.tar.xz
> > +sha256  3e5cf4f5ab9f0333f46cd68fabede3f21e55de1a9e3c6ad673f241f4514d8369  manifest/k3-secdev-0.2-manifest.html
> > diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> > new file mode 100644
> > index 000000000000..f7655a0fefc8
> > --- /dev/null
> > +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> > @@ -0,0 +1,22 @@
> > +################################################################################
> > +#
> > +# ti-k3-core-secdev
> > +#
> > +################################################################################
> > +
> > +TI_K3_CORE_SECDEV_VERSION = 08.06.00.007
> > +TI_K3_CORE_SECDEV_SITE = https://git.ti.com/cgit/security-development-tools/core-secdev-k3/snapshot
> > +TI_K3_CORE_SECDEV_SOURCE = core-secdev-k3-$(TI_K3_CORE_SECDEV_VERSION).tar.xz
> > +TI_K3_CORE_SECDEV_INSTALL_IMAGES = YES
> > +TI_K3_CORE_SECDEV_LICENSE = BSD-3-Clause
> > +TI_K3_CORE_SECDEV_LICENSE_FILES = manifest/k3-secdev-0.2-manifest.html
> > +
> > +TI_K3_CORE_SECDEV_INSTALL_DIR = $(BINARIES_DIR)/ti-k3-core-secdev
> > +
> > +define TI_K3_CORE_SECDEV_INSTALL_IMAGES_CMDS
> > +     mkdir -p $(TI_K3_CORE_SECDEV_INSTALL_DIR)
> > +     cp -dpfr $(@D)/keys $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> > +     cp -dpfr $(@D)/scripts $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> > +endef
> > +
> > +$(eval $(generic-package))
>
> --
> Alexander Sverdlin.
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-17 17:28   ` Alexander Sverdlin
@ 2024-02-18 13:30     ` Dario Binacchi
  2024-02-18 13:38     ` Dario Binacchi
  1 sibling, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:30 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sat, Feb 17, 2024 at 6:28 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > Recent versions of U-Boot are capable of building tiboot3.bin using
> > Binman. In this case, let's copy it to the binaries directory.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-12-romain.naour@smile.fr/
>
> looks more complete with sysfw.itb?

In my use case, there was no need as it was necessary to enable
ti-k3-boot-firmware:

define TI_K3_BOOT_FIRMWARE_INSTALL_IMAGES_CMDS
cp -dpfr $(@D)/ti-sysfw $(BINARIES_DIR)/
cp -dpfr $(@D)/ti-dm $(BINARIES_DIR)/
endef

>
> > ---
> >
> > Added in v4
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > index 2a10024aedaa..643298a1e70a 100644
> > --- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > +++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > @@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
> >       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> >  endef
> >
> > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> > +
> >  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> >       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> > +     find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
> >  endef
> >
> >  $(eval $(kconfig-package))
>
> --
> Alexander Sverdlin.
>


--

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-17 17:28   ` Alexander Sverdlin
  2024-02-18 13:30     ` Dario Binacchi
@ 2024-02-18 13:38     ` Dario Binacchi
  2024-02-19 10:47       ` Romain Naour
  1 sibling, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:38 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sat, Feb 17, 2024 at 6:28 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > Recent versions of U-Boot are capable of building tiboot3.bin using
> > Binman. In this case, let's copy it to the binaries directory.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-12-romain.naour@smile.fr/
>
> looks more complete with sysfw.itb?

In my use case, there was no need as it was necessary to enable
ti-k3-boot-firmware:

define TI_K3_BOOT_FIRMWARE_INSTALL_IMAGES_CMDS
cp -dpfr $(@D)/ti-sysfw $(BINARIES_DIR)/
cp -dpfr $(@D)/ti-dm $(BINARIES_DIR)/
endef

I also wonder whether it is necessary to remove the
cp -dpfr $(@D)/ti-sysfw $(BINARIES_DIR)/
to avoid conflicts.

Alternatively, as happened with ti-k3-hen-image, one day we may no
longer need ti-k3-boot-firmware,
and therefore we could add a copy of sysfw.itb from ti-k3-r5-loader. I
am awaiting suggestions.
However, my patch does not require modifying the genimage.cfg file. In
any case, I would try to ensure
this also for sysfw.itb.

Thanks and regards,
Dario

>
> > ---
> >
> > Added in v4
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > index 2a10024aedaa..643298a1e70a 100644
> > --- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > +++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > @@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
> >       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> >  endef
> >
> > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> > +
> >  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> >       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> > +     find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
> >  endef
> >
> >  $(eval $(kconfig-package))
>
> --
> Alexander Sverdlin.
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
  2024-02-17 20:20   ` Alexander Sverdlin
@ 2024-02-18 13:49     ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:49 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sat, Feb 17, 2024 at 9:20 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > The 2024.01 version of U-Boot for the am62x-sk board has introduced two
> > major changes:
> > - The device tree k3-am625-sk.dtb is no longer searched in /boot, but in
> >   /boot/dtb/ti. Hence, the disabling of BR2_LINUX_KERNEL_INSTALL_TARGET
> >   and the use of extlinux.conf for the proper loading of the device tree.
> >   Furthermore, the parameter BR2_ROOTFS_POST_SCRIPT_ARGS was used to
> >   auto-generate the extlinux.conf file so that developers can change the
> >   kernel loading options by modifying the .config.
> > - The use of binman for building images.
> >
> > Tested on SK-AM62B-P1.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> []
>
> > @@ -27,14 +27,15 @@ BR2_TARGET_TI_K3_IMAGE_GEN=y
> >  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
> >  BR2_TARGET_TI_K3_R5_LOADER=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> > -BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
> > +BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
>
> Is patch 3/20 really required in this case?
> Is custom version required if you set the same version as default in patch
> 5/20?
>
> --
> Alexander Sverdlin.
>

Romain asked me to update the default version for ti-k3-r5-loader to
2024.01. Therefore,
I wanted this change not to improperly advance the version for the
ti_am6{2,4}x_sk_defconfig configuration.
Additionally, I wanted to put these patches before the ones I had
already submitted in version 3, to have a
more readable separation between before and after.

Thanks and regards,
Dario

--

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
  2024-02-17 20:27   ` Alexander Sverdlin
@ 2024-02-18 13:50     ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:50 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sat, Feb 17, 2024 at 9:27 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > Tested on SK-AM62B-P1.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >
> > ---
> >
> > Changes in v4
> > - Add BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6 to ti_am62x_sk_defconfig.
> >
> > no changes since v1
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  configs/ti_am62x_sk_defconfig | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> > index 193301c8b941..4de39fb897fd 100644
> > --- a/configs/ti_am62x_sk_defconfig
> > +++ b/configs/ti_am62x_sk_defconfig
> > @@ -1,11 +1,11 @@
> >  BR2_aarch64=y
> > -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_4=y
> > +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
> >  BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh"
> >  BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh"
> >  BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000"
> >  BR2_LINUX_KERNEL=y
> >  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> > -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.4.16"
> > +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.1"
>
> Could be updated to v6.6.17 if you re-spin?

Of course.

Thanks and regards,
Dario
>
> >  BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> >  BR2_LINUX_KERNEL_DTS_SUPPORT=y
> >  BR2_LINUX_KERNEL_INTREE_DTS_NAME="ti/k3-am625-sk"
>
> --
> Alexander Sverdlin.
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-17 20:33   ` Alexander Sverdlin
@ 2024-02-18 13:52     ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:52 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sat, Feb 17, 2024 at 9:33 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > Recent versions of U-Boot can use Binman to compile and sign the generated
> > binaries, thus making the use of custom tools like ti-k3-image-gen no
> > longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> > configured and used outside of it. This patch allows setting such options
> > even if the package is not enabled.
>
> Missing SoB?

Good catch,

Thanks and regards,
Dario
>
> The patch looks more complete to me than https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-13-romain.naour@smile.fr/
> because of SECTYPE variables.
>
> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
>
> > ---
> >
> > Added in v4
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3/Config.in                          | 46 ++++++++++++++
> >  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
> >  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
> >  boot/uboot/Config.in                          |  7 +--
> >  configs/ti_am62x_sk_defconfig                 |  2 +-
> >  configs/ti_am64x_sk_defconfig                 |  2 +-
> >  6 files changed, 59 insertions(+), 67 deletions(-)
> >
> > diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> > index 06dda2f156a9..9e508326c9c8 100644
> > --- a/boot/ti-k3/Config.in
> > +++ b/boot/ti-k3/Config.in
> > @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
> >
> >  if BR2_TARGET_TI_K3
> >
> > +choice
> > +     prompt "SoC family"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM62AX
> > +     bool "am62ax"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM62X
> > +     bool "am62x"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM64X
> > +     bool "am64x"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM65X
> > +     bool "am65x"
> > +
> > +endchoice
> > +
> > +choice
> > +     prompt "Security type"
> > +     help
> > +       The target SoC security type option.
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE_GP
> > +     bool "gp"
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> > +     bool "hs-fs"
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE_HS
> > +     bool "hs"
> > +
> > +endchoice
> > +
> > +config BR2_TARGET_TI_K3_SOC
> > +     string
> > +     default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> > +     default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> > +     default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> > +     default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE
> > +     string
> > +     default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> > +     default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> > +     default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> > +
> >  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
> >  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
> >  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> > diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> > index 38d1598d9fc0..2d53d62dd4ee 100644
> > --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> > +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> > @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >       bool "ti-k3-image-gen"
> >       depends on BR2_TARGET_TI_K3_R5_LOADER
> >       select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> > -     select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > +     select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
> >       # We need FIT support in uboot-tools, which is why we select a
> >       # host package
> >       select BR2_PACKAGE_HOST_UBOOT_TOOLS
> > @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >         https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> >
> >  if BR2_TARGET_TI_K3_IMAGE_GEN
> > -choice
> > -     prompt "SoC family"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -     bool "am62ax"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > -     bool "am62x"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > -     bool "am64x"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > -     bool "am65x"
> > -
> > -endchoice
> > -
> > -choice
> > -     prompt "Security type"
> > -     help
> > -       The target SoC security type option for image gen.  Valid
> > -       options are "gp" for General Purpose devices, "hs-fs" for
> > -       High Security - Field Securable devices, or "hs" for High
> > -       Security - Security Enforcing devices.  Note for all High
> > -       Security device variants the TI_SECURE_DEV_PKG environmental
> > -       variable must be defined at build time pointing to a valid
> > -       core-secdev-k3 folder location, otherwise the build will
> > -       fail, see
> > -       https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> > -     bool "gp"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> > -     bool "hs-fs"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > -     bool "hs"
> > -
> > -endchoice
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> > -     string
> > -     default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -     default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > -     default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > -     default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >
> >  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
> >       string
> > -     default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -     default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > -     default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > -     default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> > -     string
> > -     default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> > -     default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> > -     default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > +     default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> > +     default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> > +     default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> > +     default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
> >
> >  endif
> > diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > index 74b4fcb4bf89..834d8f7d5cd5 100644
> > --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
> >       $(BR2_MAKE_HOST_DEPENDENCY)
> >
> >  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> > -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> > -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> > +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> > +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> >
> > -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> > +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
> >  TI_K3_IMAGE_GEN_SYSFW = \
> >       $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> >  else
> > diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> > index beafb38930db..1a9d21e7c6d1 100644
> > --- a/boot/uboot/Config.in
> > +++ b/boot/uboot/Config.in
> > @@ -244,8 +244,7 @@ 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
> > +     depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
> >       help
> >         Some TI K3 devices need the Device Manager (DM) firmware to
> >         be available for the U-Boot build.
> > @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> >
> >  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
> >       string
> > -     default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -     default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > +     default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> > +     default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
> >
> >  endif
> >
> > diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> > index cd26235342e4..cfefce0a77a4 100644
> > --- a/configs/ti_am62x_sk_defconfig
> > +++ b/configs/ti_am62x_sk_defconfig
> > @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> >  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
> >  BR2_TARGET_TI_K3=y
> > +BR2_TARGET_TI_K3_SOC_AM62X=y
> >  BR2_TARGET_TI_K3_IMAGE_GEN=y
> > -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
> >  BR2_TARGET_TI_K3_R5_LOADER=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> > diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> > index 1befeb4ab96c..daf78dbffff8 100644
> > --- a/configs/ti_am64x_sk_defconfig
> > +++ b/configs/ti_am64x_sk_defconfig
> > @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
> >  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
> >  BR2_TARGET_TI_K3=y
> > +BR2_TARGET_TI_K3_SOC_AM64X=y
> >  BR2_TARGET_TI_K3_IMAGE_GEN=y
> > -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
> >  BR2_TARGET_TI_K3_R5_LOADER=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
>
> --
> Alexander Sverdlin.
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-17 20:44   ` Alexander Sverdlin
@ 2024-02-18 13:55     ` Dario Binacchi
  2024-02-19 20:51     ` Andreas Dannenberg via buildroot
  1 sibling, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:55 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sat, Feb 17, 2024 at 9:44 PM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > As explained in [1], adding support for AM62x LP SK in U-Boot, requires
> > binman for building bootloader images. The BINMAN_INDIRS environment
> > variable is used to provide a space-separated list of directories to
> > search for binary blobs.
> >
> > [1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >
> > ---
> >
> > no changes since v1:
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/uboot/uboot.mk | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> > index dda606a88059..cf70f86a4132 100644
> > --- a/boot/uboot/uboot.mk
> > +++ b/boot/uboot/uboot.mk
> > @@ -189,7 +189,8 @@ endif
> >  ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
> >  UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
> >  UBOOT_DEPENDENCIES += ti-k3-boot-firmware
> > -UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
> > +UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \
>
> Is the above actually still required with binman?
> The names are hardcoded in U-Boot in arch/arm/dts/k3-am625-sk-binman.dtsi

I will verify with some tests,

Thanks and regards
Dario

>
> > +     BINMAN_INDIRS=$(BINARIES_DIR)
>
> This seems to be the only required part.
>
> >  endif
> >
> >  ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
>
> --
> Alexander Sverdlin.
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory
  2024-02-17 21:05   ` François Perrad
@ 2024-02-18 13:59     ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 13:59 UTC (permalink / raw)
  To: François Perrad
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	Alexander Sverdlin, bryce, Andreas Dannenberg

Hi François,

On Sat, Feb 17, 2024 at 10:05 PM François Perrad
<francois.perrad@gadz.org> wrote:
>
>
>
> Le sam. 17 févr. 2024 à 17:03, Dario Binacchi <dario.binacchi@amarulasolutions.com> a écrit :
>>
>> Move all TI K3 packages to the directory ti-k3.
>
>
> The Buildroot documentation states that "New subdirectories are discouraged".
> See https://buildroot.org/downloads/manual/manual.html#_package_directory

This patch is preliminary to the next one. That is, I wanted to
decouple the SECTYPE and SOC configurations
from a specific package since they are general parameters for the
ti-k3 platform. This seemed to me the best
solution. Any alternative suggestions are welcome.

Thanks and regards,
Dario

>
> François
>
>>
>> This patch is preparatory for future developments.
>>
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>
>> ---
>>
>> Added in v4
>>
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>> ---
>>  boot/Config.in                                      |  5 +----
>>  boot/ti-k3/Config.in                                | 13 +++++++++++++
>>  boot/ti-k3/common.mk                                |  1 +
>>  boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in      |  0
>>  .../ti-k3-boot-firmware/ti-k3-boot-firmware.hash    |  0
>>  .../ti-k3-boot-firmware/ti-k3-boot-firmware.mk      |  0
>>  boot/{ => ti-k3}/ti-k3-core-secdev/Config.in        |  0
>>  .../ti-k3-core-secdev/ti-k3-core-secdev.hash        |  0
>>  .../ti-k3-core-secdev/ti-k3-core-secdev.mk          |  0
>>  boot/{ => ti-k3}/ti-k3-image-gen/Config.in          |  0
>>  .../ti-k3-image-gen/ti-k3-image-gen.hash            |  0
>>  boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk |  0
>>  boot/{ => ti-k3}/ti-k3-r5-loader/Config.in          |  0
>>  .../ti-k3-r5-loader/ti-k3-r5-loader.hash            |  0
>>  boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk |  0
>>  configs/ti_am62x_sk_defconfig                       |  1 +
>>  configs/ti_am64x_sk_defconfig                       |  1 +
>>  17 files changed, 17 insertions(+), 4 deletions(-)
>>  create mode 100644 boot/ti-k3/Config.in
>>  create mode 100644 boot/ti-k3/common.mk
>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
>>  rename boot/{ => ti-k3}/ti-k3-core-secdev/Config.in (100%)
>>  rename boot/{ => ti-k3}/ti-k3-core-secdev/ti-k3-core-secdev.hash (100%)
>>  rename boot/{ => ti-k3}/ti-k3-core-secdev/ti-k3-core-secdev.mk (100%)
>>  rename boot/{ => ti-k3}/ti-k3-image-gen/Config.in (100%)
>>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
>>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (100%)
>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (100%)
>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (100%)
>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (100%)
>>
>> diff --git a/boot/Config.in b/boot/Config.in
>> index 18a7d268f95a..74a64a096afc 100644
>> --- a/boot/Config.in
>> +++ b/boot/Config.in
>> @@ -19,10 +19,7 @@ source "boot/opensbi/Config.in"
>>  source "boot/s500-bootloader/Config.in"
>>  source "boot/shim/Config.in"
>>  source "boot/syslinux/Config.in"
>> -source "boot/ti-k3-boot-firmware/Config.in"
>> -source "boot/ti-k3-core-secdev/Config.in"
>> -source "boot/ti-k3-image-gen/Config.in"
>> -source "boot/ti-k3-r5-loader/Config.in"
>> +source "boot/ti-k3/Config.in"
>>  source "boot/uboot/Config.in"
>>  source "boot/vexpress-firmware/Config.in"
>>
>> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
>> new file mode 100644
>> index 000000000000..06dda2f156a9
>> --- /dev/null
>> +++ b/boot/ti-k3/Config.in
>> @@ -0,0 +1,13 @@
>> +config BR2_TARGET_TI_K3
>> +       bool "TI K3"
>> +       help
>> +         The TI K3 bootloaders and tools.
>> +
>> +if BR2_TARGET_TI_K3
>> +
>> +source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
>> +source "boot/ti-k3/ti-k3-core-secdev/Config.in"
>> +source "boot/ti-k3/ti-k3-image-gen/Config.in"
>> +source "boot/ti-k3/ti-k3-r5-loader/Config.in"
>> +
>> +endif
>> diff --git a/boot/ti-k3/common.mk b/boot/ti-k3/common.mk
>> new file mode 100644
>> index 000000000000..18a1329baa4c
>> --- /dev/null
>> +++ b/boot/ti-k3/common.mk
>> @@ -0,0 +1 @@
>> +include $(sort $(wildcard boot/ti-k3/*/*.mk))
>> diff --git a/boot/ti-k3-boot-firmware/Config.in b/boot/ti-k3/ti-k3-boot-firmware/Config.in
>> similarity index 100%
>> rename from boot/ti-k3-boot-firmware/Config.in
>> rename to boot/ti-k3/ti-k3-boot-firmware/Config.in
>> diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.hash b/boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
>> similarity index 100%
>> rename from boot/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
>> rename to boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.hash
>> diff --git a/boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk b/boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
>> similarity index 100%
>> rename from boot/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
>> rename to boot/ti-k3/ti-k3-boot-firmware/ti-k3-boot-firmware.mk
>> diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3/ti-k3-core-secdev/Config.in
>> similarity index 100%
>> rename from boot/ti-k3-core-secdev/Config.in
>> rename to boot/ti-k3/ti-k3-core-secdev/Config.in
>> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
>> similarity index 100%
>> rename from boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
>> rename to boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
>> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
>> similarity index 100%
>> rename from boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
>> rename to boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
>> diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
>> similarity index 100%
>> rename from boot/ti-k3-image-gen/Config.in
>> rename to boot/ti-k3/ti-k3-image-gen/Config.in
>> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.hash
>> similarity index 100%
>> rename from boot/ti-k3-image-gen/ti-k3-image-gen.hash
>> rename to boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.hash
>> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>> similarity index 100%
>> rename from boot/ti-k3-image-gen/ti-k3-image-gen.mk
>> rename to boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>> diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3/ti-k3-r5-loader/Config.in
>> similarity index 100%
>> rename from boot/ti-k3-r5-loader/Config.in
>> rename to boot/ti-k3/ti-k3-r5-loader/Config.in
>> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.hash b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.hash
>> similarity index 100%
>> rename from boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
>> rename to boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.hash
>> diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
>> similarity index 100%
>> rename from boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
>> rename to boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
>> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
>> index 4de39fb897fd..cd26235342e4 100644
>> --- a/configs/ti_am62x_sk_defconfig
>> +++ b/configs/ti_am62x_sk_defconfig
>> @@ -23,6 +23,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>>  BR2_TARGET_OPTEE_OS=y
>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>> +BR2_TARGET_TI_K3=y
>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>>  BR2_TARGET_TI_K3_R5_LOADER=y
>> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
>> index 5fd9653b5b8f..1befeb4ab96c 100644
>> --- a/configs/ti_am64x_sk_defconfig
>> +++ b/configs/ti_am64x_sk_defconfig
>> @@ -23,6 +23,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>>  BR2_TARGET_OPTEE_OS=y
>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
>> +BR2_TARGET_TI_K3=y
>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>>  BR2_TARGET_TI_K3_R5_LOADER=y
>> --
>> 2.43.0
>>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-17 23:45   ` Alexander Sverdlin
@ 2024-02-18 14:01     ` Dario Binacchi
  2024-02-19 10:42     ` Romain Naour
  2024-02-19 20:36     ` Andreas Dannenberg via buildroot
  2 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-18 14:01 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Anand Gadiyar,
	linux-amarula, bryce, Andreas Dannenberg

Hi Alexander,

On Sun, Feb 18, 2024 at 12:45 AM Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario,
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > The patch sets the configurations required by TI HS systems. Some of these
> > configurations (i. e. HS SYSFW image signing key, HS Software Revision)
> > are provided by the ti-k3-core-secdev package in the binaries directory.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>
> so for test I've reverted the previous "boot/ti-k3-core-secdev: new package"
> commit, then...
>
> > ---
> >
> > no changes since v3:
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3-image-gen/Config.in          |  1 +
> >  boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
> >  2 files changed, 15 insertions(+), 2 deletions(-)
> >
> > diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> > index d76cef82e911..38d1598d9fc0 100644
> > --- a/boot/ti-k3-image-gen/Config.in
> > +++ b/boot/ti-k3-image-gen/Config.in
> > @@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >       bool "ti-k3-image-gen"
> >       depends on BR2_TARGET_TI_K3_R5_LOADER
> >       select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> > +     select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>
> ... removed this, ...
>
> >       # We need FIT support in uboot-tools, which is why we select a
> >       # host package
> >       select BR2_PACKAGE_HOST_UBOOT_TOOLS
> > diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > index 64be9a18f2c4..74b4fcb4bf89 100644
> > --- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > @@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> >  TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> >  TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> >
> > -TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > +ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> > +TI_K3_IMAGE_GEN_SYSFW = \
> > +     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > +else
> > +TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev
>
> ... the above line, ...
>
> > +
> > +TI_K3_IMAGE_GEN_SYSFW = \
> > +     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
> > +     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
> > +endif
> >
> >  define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
> > -     cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
> > +     $(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
> > +             cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
> > +     )
> >  endef
> >
> >  define TI_K3_IMAGE_GEN_BUILD_CMDS
> > @@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
> >       $(BR2_MAKE) -C $(@D) \
> >               SOC=$(TI_K3_IMAGE_GEN_SOC) \
> >               SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
> > +             TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \
>
> ... and this line...
>
> >               CONFIG=evm \
> >               CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
> >               SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
>
> ... and everything still builds and boots fine on SK-AM62B (HS-FS):

Thanks for your info,
I will consider them for version 5.

Thanks and regards,
Dario

>
> U-Boot SPL 2024.01 (Feb 18 2024 - 00:02:43 +0100)
> SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> SPL initial stack usage: 13400 bytes
> Trying to boot from MMC2
> Authentication passed
> Authentication passed
> Authentication passed
> Authentication passed
> Authentication passed
> Starting ATF on ARM64 core...
>
> NOTICE:  BL31: v2.7(release):v2.7
> NOTICE:  BL31: Built : 23:57:43, Feb 17 2024
> I/TC:
> I/TC: OP-TEE version: Unknown_4.0 (gcc version 12.3.0 (Buildroot 2023.11-1199-g470b2069e4)) #1 Sat Feb 17 22:57:38 UTC 2024 aarch64
> I/TC: WARNING: This OP-TEE configuration might be insecure!
> I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
> I/TC: Primary CPU initializing
> I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> I/TC: HUK Initialized
> I/TC: Activated SA2UL device
> I/TC: Enabled firewalls for SA2UL TRNG device
> I/TC: SA2UL TRNG initialized
> I/TC: SA2UL Drivers initialized
> I/TC: Primary CPU switching to normal world boot
>
> U-Boot SPL 2024.01 (Feb 18 2024 - 00:03:30 +0100)
> SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> SPL initial stack usage: 1872 bytes
> Trying to boot from MMC2
> Authentication passed
> Authentication passed
>
>
> U-Boot 2024.01 (Feb 18 2024 - 00:03:30 +0100)
>
> SoC:   AM62X SR1.0 HS-FS
> Model: Texas Instruments AM625 SK
> DRAM:  2 GiB
> Core:  56 devices, 23 uclasses, devicetree: separate
> MMC:   mmc@fa10000: 0, mmc@fa00000: 1
> Loading Environment from nowhere... OK
> In:    serial@2800000
> Out:   serial@2800000
> Err:   serial@2800000
> Net:   eth0: ethernet@8000000port@1
> Hit any key to stop autoboot:  0
> switch to partitions #0, OK
> mmc1 is current device
> SD/MMC found on device 1
> Failed to load 'uEnv.txt'
> Scanning for bootflows in all bootdevs
> Seq  Method       State   Uclass    Part  Name                      Filename
> ---  -----------  ------  --------  ----  ------------------------  ----------------
> Scanning global bootmeth 'efi_mgr':
> No EFI system partition
> No EFI system partition
> Failed to persist EFI variables
> Scanning bootdev 'mmc@fa00000.bootdev':
>   0  extlinux     ready   mmc          1  mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
> ** Booting bootflow 'mmc@fa00000.bootdev.part_1' with extlinux
> 1:      am62x-sk-buildroot
> Retrieving file: /Image
> append: console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait earlycon=ns16550a,mmio32,0x02800000
> Retrieving file: /k3-am62x.dtb
> ## Flattened Device Tree blob at ffb14700
>    Booting using the fdt blob at 0xffb14700
> Working FDT set to ffb14700
>    Loading Device Tree to 000000008ffed000, end 000000008ffff687 ... OK
> Working FDT set to 8ffed000
>
> Starting kernel ...
>
> [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
> [    0.000000] Linux version 6.6.1 (...) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2023.11-1199-g470b2069e4) 12.3.0, GNU ld (GNU Binutils) 2.40) #1 SMP PREEMPT Sun Feb 18
> 00:37:47 CET 2024
>
>
>
> --
> Alexander Sverdlin.
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
                   ` (21 preceding siblings ...)
  2024-02-17 21:14 ` Alexander Sverdlin
@ 2024-02-19  9:30 ` Romain Naour
  2024-02-19 11:02   ` Michael Nazzareno Trimarchi
  22 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19  9:30 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
> high-security field-securable (HS-FS) silicon to optionally customize keys
> and encryption for security applications.
> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
> which, however, was buggy. This series fixes the errors and bumps the Linux
> kernel and U-Boot required for such a new device.
> 
> This series, which in my humble opinion, should have been immediately
> considered to correct the compilation errors in case of HS-FS devcies, has
> seen an increase in patches in version 4 to remove the ti-k3-image-gen
> package thanks to Binman. Additionally, it shares some modifications and
> views on how to implement certain changes with the series
> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> Therefore, I think it is necessary not to run them in parallel but to decide
> whether to merge one before the other or to consider a single series where
> the patches can be coherent with each other. I am available for both solutions.
> Let me know.

Thanks for this new version. I beleive both series should be merged into one
since we want to follow u-boot switch to binman, add more TI K3 SoC support and
keeping exising am62x ans am64x working in GP or HS/HS-FS.

My main concern is to avoid adding a new package for a tool that is already
deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].

Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".

[1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html

Best regards,
Romain

> 
> Dario Binacchi (20):
>   configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
>     setting
>   configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
>     setting
>   configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader
>     version
>   configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader
>     version
>   boot/ti-k3-r5-loader: bump to version 2024.01
>   boot/ti-k3-core-secdev: new package
>   boot/ti-k3-image-gen: manage HS hardware
>   package/python-jsonschema: add host variant
>   package/python-attrs: add host variant
>   package/python-referencing: add host variant
>   package/python-rpds-py: add host variant
>   package/python-jsonschema-specifications: add host variant
>   boot/ti-k3-r5-loader: set binman environment
>   boot/uboot: set BINMAN_INDIRS for TI K3 DM
>   configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
>   configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
>   boot: move ti-k3-* packages to 'ti-k3' directory
>   boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
>   boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
>   configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore
> 
>  DEVELOPERS                                    |  1 +
>  board/ti/am62x-sk/genimage.cfg                |  7 +-
>  board/ti/am62x-sk/post-build.sh               | 49 ++++++++++++
>  board/ti/am62x-sk/post-image.sh               |  5 ++
>  boot/Config.in                                |  4 +-
>  boot/ti-k3-image-gen/Config.in                | 77 -------------------
>  boot/ti-k3/Config.in                          | 59 ++++++++++++++
>  boot/ti-k3/common.mk                          |  1 +
>  .../{ => ti-k3}/ti-k3-boot-firmware/Config.in |  0
>  .../ti-k3-boot-firmware.hash                  |  0
>  .../ti-k3-boot-firmware.mk                    |  0
>  boot/ti-k3/ti-k3-core-secdev/Config.in        |  9 +++
>  .../ti-k3-core-secdev/ti-k3-core-secdev.hash  |  3 +
>  .../ti-k3-core-secdev/ti-k3-core-secdev.mk    | 22 ++++++
>  boot/ti-k3/ti-k3-image-gen/Config.in          | 25 ++++++
>  .../ti-k3-image-gen/ti-k3-image-gen.hash      |  0
>  .../ti-k3-image-gen/ti-k3-image-gen.mk        | 20 ++++-
>  boot/{ => ti-k3}/ti-k3-r5-loader/Config.in    |  4 +-
>  .../ti-k3-r5-loader/ti-k3-r5-loader.hash      |  2 +-
>  .../ti-k3-r5-loader/ti-k3-r5-loader.mk        | 16 +++-
>  boot/uboot/Config.in                          |  7 +-
>  boot/uboot/uboot.mk                           |  3 +-
>  configs/ti_am62x_sk_defconfig                 | 23 +++---
>  configs/ti_am64x_sk_defconfig                 |  8 +-
>  package/python-attrs/python-attrs.mk          |  6 ++
>  .../python-jsonschema-specifications.mk       |  5 ++
>  .../python-jsonschema/python-jsonschema.mk    |  6 ++
>  .../python-referencing/python-referencing.mk  |  5 ++
>  package/python-rpds-py/python-rpds-py.mk      |  1 +
>  29 files changed, 263 insertions(+), 105 deletions(-)
>  create mode 100755 board/ti/am62x-sk/post-build.sh
>  create mode 100755 board/ti/am62x-sk/post-image.sh
>  delete mode 100644 boot/ti-k3-image-gen/Config.in
>  create mode 100644 boot/ti-k3/Config.in
>  create mode 100644 boot/ti-k3/common.mk
>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/Config.in
>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
>  create mode 100644 boot/ti-k3/ti-k3-image-gen/Config.in
>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (67%)
>  rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (97%)
>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (54%)
>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (85%)
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting Dario Binacchi
  2024-02-17 20:06   ` Alexander Sverdlin
@ 2024-02-19  9:36   ` Romain Naour
  1 sibling, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19  9:36 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> Checking the output of the command `git grep PLATFORM | grep k3`, we can
> found the proper settings for the optee-os package:
> 
> .github/workflows/ci.yml:          _make PLATFORM=k3-am62x
> .github/workflows/ci.yml:          _make PLATFORM=k3-am62x CFG_ARM64_core=y
> ...
> core/arch/arm/plat-k3/conf.mk:ifneq (,$(filter ${PLATFORM_FLAVOR},am65x j721e j784s4 am64x am62x))

Setting BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR doesn't seems necessary since
optee-os Makefile can extract it from BR2_TARGET_OPTEE_OS_PLATFORM [1].

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

Best regards,
Romain


> 
> Suggested-by: Romain Naour <romain.naour@smile.fr>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  configs/ti_am62x_sk_defconfig | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index f88252a89c68..fde6f8f5636a 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -21,7 +21,8 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="k3"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD="lite"
>  BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE=y
>  BR2_TARGET_OPTEE_OS=y
> -BR2_TARGET_OPTEE_OS_PLATFORM="k3"
> +BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> +BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>  BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package Dario Binacchi
  2024-02-17 17:06   ` Alexander Sverdlin
@ 2024-02-19  9:48   ` Romain Naour
  2024-02-19 20:15     ` Andreas Dannenberg via buildroot
  1 sibling, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19  9:48 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> This is a security development package containing tools for
> High-Security(HS) TI K3 platform devices.

Note: this tool can also handle TI "legacy" platform such AM57xx or AM43xx (not
sure we really want do that).

Can you try without this package when using binman?
This tool doesn't seems "future proof".

http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html

Best regards,
Romain

> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Changes in v4:
> - Remove the trailing '/' at the end of the url in the help of
>   Config.in
> - Fixed license issues
> - Use $(BINARIES_DIR)/ti-k3-core-secdev as the directory where to
>   install files.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  DEVELOPERS                                    |  1 +
>  boot/Config.in                                |  1 +
>  boot/ti-k3-core-secdev/Config.in              |  9 ++++++++
>  boot/ti-k3-core-secdev/ti-k3-core-secdev.hash |  3 +++
>  boot/ti-k3-core-secdev/ti-k3-core-secdev.mk   | 22 +++++++++++++++++++
>  5 files changed, 36 insertions(+)
>  create mode 100644 boot/ti-k3-core-secdev/Config.in
>  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
>  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 0d12c3abcb11..33d99ab2440f 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -753,6 +753,7 @@ F:	package/xinetd/
>  N:	Dario Binacchi <dario.binacchi@amarulasolutions.com>
>  F:	board/bsh/
>  F:	board/stmicroelectronics/stm32f769-disco/
> +F:	boot/ti-k3-core-secdev/
>  F:	configs/imx8mn_bsh_smm_s2_defconfig
>  F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
>  F:	configs/stm32f769_disco_sd_defconfig
> diff --git a/boot/Config.in b/boot/Config.in
> index e5fdf7ad439e..18a7d268f95a 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -20,6 +20,7 @@ source "boot/s500-bootloader/Config.in"
>  source "boot/shim/Config.in"
>  source "boot/syslinux/Config.in"
>  source "boot/ti-k3-boot-firmware/Config.in"
> +source "boot/ti-k3-core-secdev/Config.in"
>  source "boot/ti-k3-image-gen/Config.in"
>  source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
> diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3-core-secdev/Config.in
> new file mode 100644
> index 000000000000..f7b4e2962042
> --- /dev/null
> +++ b/boot/ti-k3-core-secdev/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_TARGET_TI_K3_CORE_SECDEV
> +	bool "ti-k3-core-secdev"
> +	depends on BR2_aarch64
> +	help
> +	  This package downloads and installs development tools for
> +	  High-Security(HS) TI K3 platforms (which include AM62x,
> +	  AM64x, AM65x and more).
> +
> +	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> new file mode 100644
> index 000000000000..e3074a398d62
> --- /dev/null
> +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256  b6d3bca0d561d055c6869c5564b06f2fb1b9f67e4ef180c2baf8a14a6a6afa06  core-secdev-k3-08.06.00.007.tar.xz
> +sha256  3e5cf4f5ab9f0333f46cd68fabede3f21e55de1a9e3c6ad673f241f4514d8369  manifest/k3-secdev-0.2-manifest.html
> diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> new file mode 100644
> index 000000000000..f7655a0fefc8
> --- /dev/null
> +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# ti-k3-core-secdev
> +#
> +################################################################################
> +
> +TI_K3_CORE_SECDEV_VERSION = 08.06.00.007
> +TI_K3_CORE_SECDEV_SITE = https://git.ti.com/cgit/security-development-tools/core-secdev-k3/snapshot
> +TI_K3_CORE_SECDEV_SOURCE = core-secdev-k3-$(TI_K3_CORE_SECDEV_VERSION).tar.xz
> +TI_K3_CORE_SECDEV_INSTALL_IMAGES = YES
> +TI_K3_CORE_SECDEV_LICENSE = BSD-3-Clause
> +TI_K3_CORE_SECDEV_LICENSE_FILES = manifest/k3-secdev-0.2-manifest.html
> +
> +TI_K3_CORE_SECDEV_INSTALL_DIR = $(BINARIES_DIR)/ti-k3-core-secdev
> +
> +define TI_K3_CORE_SECDEV_INSTALL_IMAGES_CMDS
> +	mkdir -p $(TI_K3_CORE_SECDEV_INSTALL_DIR)
> +	cp -dpfr $(@D)/keys $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> +	cp -dpfr $(@D)/scripts $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> +endef
> +
> +$(eval $(generic-package))

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware Dario Binacchi
  2024-02-17 23:45   ` Alexander Sverdlin
@ 2024-02-19  9:58   ` Romain Naour
  2024-02-19 20:19     ` Andreas Dannenberg via buildroot
  1 sibling, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19  9:58 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> The patch sets the configurations required by TI HS systems. Some of these
> configurations (i. e. HS SYSFW image signing key, HS Software Revision)
> are provided by the ti-k3-core-secdev package in the binaries directory.

Such keys has been added to u-boot v2023.10:

https://git.ti.com/cgit/security-development-tools/core-secdev-k3/tree/keys

https://source.denx.de/u-boot/u-boot/-/commit/d5b1ef30d7ffabb9f57d5c62b9f0608837af0f4f

Do we need something else from ti-k3-core-secdev package that is not already
provided by u-boot?

Best regards,
Romain

> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> no changes since v3:
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3-image-gen/Config.in          |  1 +
>  boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
>  2 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> index d76cef82e911..38d1598d9fc0 100644
> --- a/boot/ti-k3-image-gen/Config.in
> +++ b/boot/ti-k3-image-gen/Config.in
> @@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>  	bool "ti-k3-image-gen"
>  	depends on BR2_TARGET_TI_K3_R5_LOADER
>  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>  	# We need FIT support in uboot-tools, which is why we select a
>  	# host package
>  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> index 64be9a18f2c4..74b4fcb4bf89 100644
> --- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> @@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
>  TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
>  TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
>  
> -TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> +ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> +TI_K3_IMAGE_GEN_SYSFW = \
> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> +else
> +TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev
> +
> +TI_K3_IMAGE_GEN_SYSFW = \
> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
> +endif
>  
>  define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
> -	cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
> +	$(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
> +		cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
> +	)
>  endef
>  
>  define TI_K3_IMAGE_GEN_BUILD_CMDS
> @@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
>  	$(BR2_MAKE) -C $(@D) \
>  		SOC=$(TI_K3_IMAGE_GEN_SOC) \
>  		SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
> +		TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \
>  		CONFIG=evm \
>  		CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>  		SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 08/20] package/python-jsonschema: add host variant
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 08/20] package/python-jsonschema: add host variant Dario Binacchi
@ 2024-02-19 10:03   ` Romain Naour
  0 siblings, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:03 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> Recent version of U-Boot use binman to provide a mechanism for building
> images, from simple SPL + U-Boot combinations, to more complex
> arrangements with many parts. This package is required by binman.

I did some improvement about host-python package you need for binam.
Indeed, host-python-jsonschema has some runtime dependencies, but we don't have
the concept of runtime dependencies for host packages.

Due to thoses runtime dependencies you can't add python-jsonschema host variant
before adding host-python-attrs, host-python-jsonschema-specifications,
host-python-referencing and host-python-rpds-py.

Best regards,
Romain


> 
> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> no changes since v3
> 
> Changes in v3:
> - Drop Config.in.host
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  package/python-jsonschema/python-jsonschema.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/python-jsonschema/python-jsonschema.mk b/package/python-jsonschema/python-jsonschema.mk
> index 512c92aa7752..85fef7ad22ac 100644
> --- a/package/python-jsonschema/python-jsonschema.mk
> +++ b/package/python-jsonschema/python-jsonschema.mk
> @@ -15,4 +15,10 @@ PYTHON_JSONSCHEMA_DEPENDENCIES = \
>  	host-python-hatch-fancy-pypi-readme \
>  	host-python-hatch-vcs
>  
> +HOST_PYTHON_JSONSCHEMA_DEPENDENCIES = \
> +	host-python-hatchling \
> +	host-python-hatch-fancy-pypi-readme \
> +	host-python-hatch-vcs
> +
>  $(eval $(python-package))
> +$(eval $(host-python-package))

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment Dario Binacchi
  2024-02-17 20:38   ` Alexander Sverdlin
@ 2024-02-19 10:15   ` Romain Naour
  2024-02-21 10:19     ` Dario Binacchi
  1 sibling, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:15 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> Recent version of U-Boot use binman to provide a mechanism for building
> images, from simple SPL + U-Boot combinations, to more complex
> arrangements with many parts.
> 
> The patch set the BINMAN_INDIRS environment variable to provide the
> directory to search for binary blobs and select the packages required by
> binman.
> 
> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Changes in v4:
> - Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> 
> Changes in v2:
> - Change commit message
> - Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> - Select packages required by binman if
>   BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> 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 0ffcb8235f2e..2a10024aedaa 100644
> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
>  	host-pkgconf \
>  	$(BR2_MAKE_HOST_DEPENDENCY) \
>  	host-arm-gnu-toolchain \
> -	host-openssl
> +	host-openssl \
> +	host-python-attrs \
> +	host-python-jsonschema \
> +	host-python-jsonschema-specifications \
> +	host-python-pyyaml \
> +	host-python-referencing \
> +	host-python-rpds-py

Most of theses new dependencies are not ti-k3-r5-loader dependencies but
host-python-jsonschema runtime dependencies.

Note: host-python-jsonschema depends on
BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS due to its runtime dependency on
host-python-rpds-py.

>  
>  TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
>  TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
> @@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
>  	$(BR2_BISON_HOST_DEPENDENCY) \
>  	$(BR2_FLEX_HOST_DEPENDENCY)
>  
> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)

It's a u-boot package config option. just add host-python-pylibfdt the dependency.

> +TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
> +endif
> +
>  ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
>  TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
>  else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
> @@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
>  	CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>  	ARCH=arm \
>  	HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
> +	BINMAN_INDIRS=$(BINARIES_DIR) \

I suggested to add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN but indeed we should
use binman unconditionally for ti-k3-r5-loader package.

http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/

Best regards,
Romain


>  	HOSTLDFLAGS="$(HOST_LDFLAGS)"
>  
>  define TI_K3_R5_LOADER_BUILD_CMDS

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM Dario Binacchi
  2024-02-17 20:44   ` Alexander Sverdlin
@ 2024-02-19 10:19   ` Romain Naour
  1 sibling, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:19 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> As explained in [1], adding support for AM62x LP SK in U-Boot, requires
> binman for building bootloader images. The BINMAN_INDIRS environment
> variable is used to provide a space-separated list of directories to
> search for binary blobs.

Binman is not a tool specific to TI K3 SoC and may be used by any other SoC
vendor. I believe we should add a new u-boot option for it
(BR2_TARGET_UBOOT_USE_BINMAN) and not depend on BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
being enabled.

http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-10-romain.naour@smile.fr/

> 
> [1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> no changes since v1:
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/uboot/uboot.mk | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> index dda606a88059..cf70f86a4132 100644
> --- a/boot/uboot/uboot.mk
> +++ b/boot/uboot/uboot.mk
> @@ -189,7 +189,8 @@ endif
>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
>  UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
>  UBOOT_DEPENDENCIES += ti-k3-boot-firmware
> -UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
> +UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \
> +	BINMAN_INDIRS=$(BINARIES_DIR)
>  endif

Binman dependencies are missing.

Best regards,
Romain


>  
>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope Dario Binacchi
  2024-02-17 20:33   ` Alexander Sverdlin
@ 2024-02-19 10:28   ` Romain Naour
  2024-02-20  1:28     ` Andreas Dannenberg via buildroot
  1 sibling, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:28 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> Recent versions of U-Boot can use Binman to compile and sign the generated
> binaries, thus making the use of custom tools like ti-k3-image-gen no
> longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> configured and used outside of it. This patch allows setting such options
> even if the package is not enabled.

I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.

Best regards,
Romain


> 
> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3/Config.in                          | 46 ++++++++++++++
>  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
>  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
>  boot/uboot/Config.in                          |  7 +--
>  configs/ti_am62x_sk_defconfig                 |  2 +-
>  configs/ti_am64x_sk_defconfig                 |  2 +-
>  6 files changed, 59 insertions(+), 67 deletions(-)
> 
> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> index 06dda2f156a9..9e508326c9c8 100644
> --- a/boot/ti-k3/Config.in
> +++ b/boot/ti-k3/Config.in
> @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
>  
>  if BR2_TARGET_TI_K3
>  
> +choice
> +	prompt "SoC family"
> +
> +config BR2_TARGET_TI_K3_SOC_AM62AX
> +	bool "am62ax"
> +
> +config BR2_TARGET_TI_K3_SOC_AM62X
> +	bool "am62x"
> +
> +config BR2_TARGET_TI_K3_SOC_AM64X
> +	bool "am64x"
> +
> +config BR2_TARGET_TI_K3_SOC_AM65X
> +	bool "am65x"
> +
> +endchoice
> +
> +choice
> +	prompt "Security type"
> +	help
> +	  The target SoC security type option.
> +
> +config BR2_TARGET_TI_K3_SECTYPE_GP
> +	bool "gp"
> +
> +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> +	bool "hs-fs"
> +
> +config BR2_TARGET_TI_K3_SECTYPE_HS
> +	bool "hs"
> +
> +endchoice
> +
> +config BR2_TARGET_TI_K3_SOC
> +	string
> +	default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> +	default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> +	default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> +	default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> +
> +config BR2_TARGET_TI_K3_SECTYPE
> +	string
> +	default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> +	default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> +	default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> +
>  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
>  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
>  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> index 38d1598d9fc0..2d53d62dd4ee 100644
> --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>  	bool "ti-k3-image-gen"
>  	depends on BR2_TARGET_TI_K3_R5_LOADER
>  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> -	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
>  	# We need FIT support in uboot-tools, which is why we select a
>  	# host package
>  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>  	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
>  
>  if BR2_TARGET_TI_K3_IMAGE_GEN
> -choice
> -	prompt "SoC family"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	bool "am62ax"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> -	bool "am62x"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> -	bool "am64x"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> -	bool "am65x"
> -
> -endchoice
> -
> -choice
> -	prompt "Security type"
> -	help
> -	  The target SoC security type option for image gen.  Valid
> -	  options are "gp" for General Purpose devices, "hs-fs" for
> -	  High Security - Field Securable devices, or "hs" for High
> -	  Security - Security Enforcing devices.  Note for all High
> -	  Security device variants the TI_SECURE_DEV_PKG environmental
> -	  variable must be defined at build time pointing to a valid
> -	  core-secdev-k3 folder location, otherwise the build will
> -	  fail, see
> -	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> -	bool "gp"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> -	bool "hs-fs"
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> -	bool "hs"
> -
> -endchoice
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> -	string
> -	default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> -	default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> -	default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>  
>  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
>  	string
> -	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> -	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> -	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> -
> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> -	string
> -	default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> -	default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> -	default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> +	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> +	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> +	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> +	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
>  
>  endif
> diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> index 74b4fcb4bf89..834d8f7d5cd5 100644
> --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
>  	$(BR2_MAKE_HOST_DEPENDENCY)
>  
>  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
>  
> -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
>  TI_K3_IMAGE_GEN_SYSFW = \
>  	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
>  else
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index beafb38930db..1a9d21e7c6d1 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -244,8 +244,7 @@ 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
> +	depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
>  	help
>  	  Some TI K3 devices need the Device Manager (DM) firmware to
>  	  be available for the U-Boot build.
> @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>  
>  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>  	string
> -	default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> -	default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> +	default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> +	default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
>  
>  endif
>  
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index cd26235342e4..cfefce0a77a4 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>  BR2_TARGET_TI_K3=y
> +BR2_TARGET_TI_K3_SOC_AM62X=y
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> index 1befeb4ab96c..daf78dbffff8 100644
> --- a/configs/ti_am64x_sk_defconfig
> +++ b/configs/ti_am64x_sk_defconfig
> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
>  BR2_TARGET_TI_K3=y
> +BR2_TARGET_TI_K3_SOC_AM64X=y
>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 20/20] configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 20/20] configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore Dario Binacchi
@ 2024-02-19 10:31   ` Romain Naour
  0 siblings, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:31 UTC (permalink / raw)
  To: Dario Binacchi, buildroot
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Dario,

Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> Recent versions of U-Boot are capable of building tiboot3.bin using
> Binman. So it's no longer necessary to use custom tools like
> ti-k3-image-gen.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  configs/ti_am62x_sk_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> index cfefce0a77a4..6259dec5985d 100644
> --- a/configs/ti_am62x_sk_defconfig
> +++ b/configs/ti_am62x_sk_defconfig
> @@ -25,7 +25,7 @@ BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>  BR2_TARGET_TI_K3=y
>  BR2_TARGET_TI_K3_SOC_AM62X=y
> -BR2_TARGET_TI_K3_IMAGE_GEN=y
> +BR2_TARGET_TI_K3_BOOT_FIRMWARE=y
>  BR2_TARGET_TI_K3_R5_LOADER=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"

The am64x defconfig should do the same, then the ti-k3-boot-firmware can be removed.

Best regards,
Romain

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-17 17:40 ` [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Alexander Sverdlin
@ 2024-02-19 10:35   ` Romain Naour
  2024-02-19 22:42   ` Patrick Oppenlander
  1 sibling, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:35 UTC (permalink / raw)
  To: Alexander Sverdlin, Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, linux-amarula, bryce,
	Anand Gadiyar

Hello Alexander,

Le 17/02/2024 à 18:40, Alexander Sverdlin a écrit :
> Hi Dario!
> 
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
>> This series, which in my humble opinion, should have been immediately
>> considered to correct the compilation errors in case of HS-FS devcies, has
>> seen an increase in patches in version 4 to remove the ti-k3-image-gen
> 
> I wasn't aware of the preceeding versions, but...
> 
>> package thanks to Binman. Additionally, it shares some modifications and
>> views on how to implement certain changes with the series
>> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
>> Therefore, I think it is necessary not to run them in parallel but to decide
>> whether to merge one before the other or to consider a single series where
>> the patches can be coherent with each other. I am available for both solutions.
>> Let me know.
> 
> ... as the broken HS-FS went unnoticed, seems there is no rush to fix the
> build now? I'd vote for a combined series, because yours and Romains do
> overlap here and there, but I personally would pick different parts from
> different series. I'd not introduce secdev package unless absolutely
> necessary, and I actually build HS-FS images with yocto with custom keys
> and using upstream U-Boot binman alone, so maybe I miss something, but
> I don't see the package as required.
> 
> From my side I can offer testing on SK-AM62x variants, both GP and HS-FS.
> I will definitely test your v4 because in contrast to Romain's U-Boot
> v2024.01 bump yours may actually boot...
> 

Can you merge Dario changes (extlinux.conf and post-build.sh) and try again?

Best regards,
Romain

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-17 20:38   ` Alexander Sverdlin
@ 2024-02-19 10:40     ` Romain Naour
  0 siblings, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:40 UTC (permalink / raw)
  To: Alexander Sverdlin, Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, linux-amarula, bryce,
	Anand Gadiyar

Hello Alexander,

Le 17/02/2024 à 21:38, Alexander Sverdlin a écrit :
> Hi Dario,
> 
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
>> Recent version of U-Boot use binman to provide a mechanism for building
>> images, from simple SPL + U-Boot combinations, to more complex
>> arrangements with many parts.
>>
>> The patch set the BINMAN_INDIRS environment variable to provide the
>> directory to search for binary blobs and select the packages required by
>> binman.
>>
>> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
>> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> I personally do not see why binman usage should be configurable as in
> https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/
> your patch looks simpler,

Agree, the binman must be mandatory for ti-k3-r5-loader package.

The intend was to take care of the existing am64x am62x defconfig that was
working without binman. As soon as all TI K3 defconfig switched to binman, this
option can be removed.

Best regards,
Romain


> 
> Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> 
>> ---
>>
>> Changes in v4:
>> - Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
>>
>> Changes in v2:
>> - Change commit message
>> - Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
>> - Select packages required by binman if
>>   BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled
>>
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>> ---
>>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> 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 0ffcb8235f2e..2a10024aedaa 100644
>> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
>> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
>> @@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
>>  	host-pkgconf \
>>  	$(BR2_MAKE_HOST_DEPENDENCY) \
>>  	host-arm-gnu-toolchain \
>> -	host-openssl
>> +	host-openssl \
>> +	host-python-attrs \
>> +	host-python-jsonschema \
>> +	host-python-jsonschema-specifications \
>> +	host-python-pyyaml \
>> +	host-python-referencing \
>> +	host-python-rpds-py
>>  
>>  TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
>>  TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
>> @@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
>>  	$(BR2_BISON_HOST_DEPENDENCY) \
>>  	$(BR2_FLEX_HOST_DEPENDENCY)
>>  
>> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
>> +TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
>> +endif
>> +
>>  ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
>>  TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
>>  else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
>> @@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
>>  	CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>>  	ARCH=arm \
>>  	HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
>> +	BINMAN_INDIRS=$(BINARIES_DIR) \
>>  	HOSTLDFLAGS="$(HOST_LDFLAGS)"
>>  
>>  define TI_K3_R5_LOADER_BUILD_CMDS
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-17 23:45   ` Alexander Sverdlin
  2024-02-18 14:01     ` Dario Binacchi
@ 2024-02-19 10:42     ` Romain Naour
  2024-02-19 10:47       ` Alexander Sverdlin
  2024-02-19 20:36     ` Andreas Dannenberg via buildroot
  2 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:42 UTC (permalink / raw)
  To: Alexander Sverdlin, Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, linux-amarula, bryce,
	Anand Gadiyar

Hello Alexander,

Le 18/02/2024 à 00:45, Alexander Sverdlin a écrit :
> Hi Dario,
> 
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
>> The patch sets the configurations required by TI HS systems. Some of these
>> configurations (i. e. HS SYSFW image signing key, HS Software Revision)
>> are provided by the ti-k3-core-secdev package in the binaries directory.
>>
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> so for test I've reverted the previous "boot/ti-k3-core-secdev: new package"
> commit, then...

Thanks for testing!
To be sure, I would recommend to do a build from scratch before testing.

Best regards,
Romain


> 
>> ---
>>
>> no changes since v3:
>>
>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>> ---
>>  boot/ti-k3-image-gen/Config.in          |  1 +
>>  boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
>>  2 files changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
>> index d76cef82e911..38d1598d9fc0 100644
>> --- a/boot/ti-k3-image-gen/Config.in
>> +++ b/boot/ti-k3-image-gen/Config.in
>> @@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>>  	bool "ti-k3-image-gen"
>>  	depends on BR2_TARGET_TI_K3_R5_LOADER
>>  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
>> +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> 
> ... removed this, ...
> 
>>  	# We need FIT support in uboot-tools, which is why we select a
>>  	# host package
>>  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
>> diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
>> index 64be9a18f2c4..74b4fcb4bf89 100644
>> --- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
>> +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
>> @@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
>>  TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
>>  TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
>>  
>> -TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
>> +ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
>> +TI_K3_IMAGE_GEN_SYSFW = \
>> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
>> +else
>> +TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev
> 
> ... the above line, ...
> 
>> +
>> +TI_K3_IMAGE_GEN_SYSFW = \
>> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
>> +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
>> +endif
>>  
>>  define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
>> -	cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
>> +	$(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
>> +		cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
>> +	)
>>  endef
>>  
>>  define TI_K3_IMAGE_GEN_BUILD_CMDS
>> @@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
>>  	$(BR2_MAKE) -C $(@D) \
>>  		SOC=$(TI_K3_IMAGE_GEN_SOC) \
>>  		SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
>> +		TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \
> 
> ... and this line...
> 
>>  		CONFIG=evm \
>>  		CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>>  		SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
> 
> ... and everything still builds and boots fine on SK-AM62B (HS-FS):
> 
> U-Boot SPL 2024.01 (Feb 18 2024 - 00:02:43 +0100)
> SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> SPL initial stack usage: 13400 bytes
> Trying to boot from MMC2
> Authentication passed
> Authentication passed
> Authentication passed
> Authentication passed
> Authentication passed
> Starting ATF on ARM64 core...
> 
> NOTICE:  BL31: v2.7(release):v2.7
> NOTICE:  BL31: Built : 23:57:43, Feb 17 2024
> I/TC: 
> I/TC: OP-TEE version: Unknown_4.0 (gcc version 12.3.0 (Buildroot 2023.11-1199-g470b2069e4)) #1 Sat Feb 17 22:57:38 UTC 2024 aarch64
> I/TC: WARNING: This OP-TEE configuration might be insecure!
> I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
> I/TC: Primary CPU initializing
> I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> I/TC: HUK Initialized
> I/TC: Activated SA2UL device
> I/TC: Enabled firewalls for SA2UL TRNG device
> I/TC: SA2UL TRNG initialized
> I/TC: SA2UL Drivers initialized
> I/TC: Primary CPU switching to normal world boot
> 
> U-Boot SPL 2024.01 (Feb 18 2024 - 00:03:30 +0100)
> SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> SPL initial stack usage: 1872 bytes
> Trying to boot from MMC2
> Authentication passed
> Authentication passed
> 
> 
> U-Boot 2024.01 (Feb 18 2024 - 00:03:30 +0100)
> 
> SoC:   AM62X SR1.0 HS-FS
> Model: Texas Instruments AM625 SK
> DRAM:  2 GiB
> Core:  56 devices, 23 uclasses, devicetree: separate
> MMC:   mmc@fa10000: 0, mmc@fa00000: 1
> Loading Environment from nowhere... OK
> In:    serial@2800000
> Out:   serial@2800000
> Err:   serial@2800000
> Net:   eth0: ethernet@8000000port@1
> Hit any key to stop autoboot:  0 
> switch to partitions #0, OK
> mmc1 is current device
> SD/MMC found on device 1
> Failed to load 'uEnv.txt'
> Scanning for bootflows in all bootdevs
> Seq  Method       State   Uclass    Part  Name                      Filename
> ---  -----------  ------  --------  ----  ------------------------  ----------------
> Scanning global bootmeth 'efi_mgr':
> No EFI system partition
> No EFI system partition
> Failed to persist EFI variables
> Scanning bootdev 'mmc@fa00000.bootdev':
>   0  extlinux     ready   mmc          1  mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
> ** Booting bootflow 'mmc@fa00000.bootdev.part_1' with extlinux
> 1:      am62x-sk-buildroot
> Retrieving file: /Image
> append: console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait earlycon=ns16550a,mmio32,0x02800000
> Retrieving file: /k3-am62x.dtb
> ## Flattened Device Tree blob at ffb14700
>    Booting using the fdt blob at 0xffb14700
> Working FDT set to ffb14700
>    Loading Device Tree to 000000008ffed000, end 000000008ffff687 ... OK
> Working FDT set to 8ffed000
> 
> Starting kernel ...
> 
> [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
> [    0.000000] Linux version 6.6.1 (...) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2023.11-1199-g470b2069e4) 12.3.0, GNU ld (GNU Binutils) 2.40) #1 SMP PREEMPT Sun Feb 18 
> 00:37:47 CET 2024
> 
> 
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-19 10:42     ` Romain Naour
@ 2024-02-19 10:47       ` Alexander Sverdlin
  0 siblings, 0 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-19 10:47 UTC (permalink / raw)
  To: Romain Naour, Dario Binacchi, buildroot
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, Andreas Dannenberg, linux-amarula, bryce,
	Anand Gadiyar

Hi Romain,

On Mon, 2024-02-19 at 11:42 +0100, Romain Naour wrote:
> > > The patch sets the configurations required by TI HS systems. Some of these
> > > configurations (i. e. HS SYSFW image signing key, HS Software Revision)
> > > are provided by the ti-k3-core-secdev package in the binaries directory.
> > > 
> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > 
> > so for test I've reverted the previous "boot/ti-k3-core-secdev: new package"
> > commit, then...
> 
> Thanks for testing!
> To be sure, I would recommend to do a build from scratch before testing.

indeed it was a clean build.

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-18 13:38     ` Dario Binacchi
@ 2024-02-19 10:47       ` Romain Naour
  0 siblings, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-19 10:47 UTC (permalink / raw)
  To: Dario Binacchi, Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Andreas Dannenberg, linux-amarula,
	bryce, Anand Gadiyar

Hello Dario,

Le 18/02/2024 à 14:38, Dario Binacchi a écrit :
> Hi Alexander,
> 
> On Sat, Feb 17, 2024 at 6:28 PM Alexander Sverdlin
> <alexander.sverdlin@gmail.com> wrote:
>>
>> Hi Dario,
>>
>> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
>>> Recent versions of U-Boot are capable of building tiboot3.bin using
>>> Binman. In this case, let's copy it to the binaries directory.
>>>
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>
>> https://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-12-romain.naour@smile.fr/
>>
>> looks more complete with sysfw.itb?
> 
> In my use case, there was no need as it was necessary to enable
> ti-k3-boot-firmware:
> 
> define TI_K3_BOOT_FIRMWARE_INSTALL_IMAGES_CMDS
> cp -dpfr $(@D)/ti-sysfw $(BINARIES_DIR)/
> cp -dpfr $(@D)/ti-dm $(BINARIES_DIR)/
> endef
> 
> I also wonder whether it is necessary to remove the
> cp -dpfr $(@D)/ti-sysfw $(BINARIES_DIR)/
> to avoid conflicts.
> 
> Alternatively, as happened with ti-k3-hen-image, one day we may no
> longer need ti-k3-boot-firmware,
> and therefore we could add a copy of sysfw.itb from ti-k3-r5-loader. I
> am awaiting suggestions.
> However, my patch does not require modifying the genimage.cfg file. In
> any case, I would try to ensure
> this also for sysfw.itb.

sysfw.itb is build by ti-k3-r5-loader and it's not provided by
ti-k3-boot-firmware. This file depends on the TI K3 "Split binary" 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)

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

Best regards,
Romain


> 
> Thanks and regards,
> Dario
> 
>>
>>> ---
>>>
>>> Added in v4
>>>
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>> ---
>>>  boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
>>> index 2a10024aedaa..643298a1e70a 100644
>>> --- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
>>> +++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
>>> @@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
>>>       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
>>>  endef
>>>
>>> +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
>>> +
>>>  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
>>>       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
>>> +     find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
>>>  endef
>>>
>>>  $(eval $(kconfig-package))
>>
>> --
>> Alexander Sverdlin.
>>
> 
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-19  9:30 ` Romain Naour
@ 2024-02-19 11:02   ` Michael Nazzareno Trimarchi
  2024-02-19 11:24     ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Michael Nazzareno Trimarchi @ 2024-02-19 11:02 UTC (permalink / raw)
  To: Romain Naour
  Cc: linux-amarula, Anand Gadiyar, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot, Dario Binacchi,
	Alexander Sverdlin, bryce, Andreas Dannenberg

Hi Romain

On Mon, Feb 19, 2024 at 10:30 AM Romain Naour <romain.naour@smile.fr> wrote:
>
> Hello Dario,
>
> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> > The SK-AM62B-P1 is the newest version of SK-AM62 which includes
> > high-security field-securable (HS-FS) silicon to optionally customize keys
> > and encryption for security applications.
> > This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
> > which, however, was buggy. This series fixes the errors and bumps the Linux
> > kernel and U-Boot required for such a new device.
> >
> > This series, which in my humble opinion, should have been immediately
> > considered to correct the compilation errors in case of HS-FS devcies, has
> > seen an increase in patches in version 4 to remove the ti-k3-image-gen
> > package thanks to Binman. Additionally, it shares some modifications and
> > views on how to implement certain changes with the series
> > https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> > Therefore, I think it is necessary not to run them in parallel but to decide
> > whether to merge one before the other or to consider a single series where
> > the patches can be coherent with each other. I am available for both solutions.
> > Let me know.
>
> Thanks for this new version. I beleive both series should be merged into one
> since we want to follow u-boot switch to binman, add more TI K3 SoC support and
> keeping exising am62x ans am64x working in GP or HS/HS-FS.
>

Because the Dario patchset was sent before (end of November), it's
reasonable to review and adjust that one
and apply your changes for ti_j721e_sk on top of it. It think that is
a standard way to make people happy about
their work and contribution.

Michael

> My main concern is to avoid adding a new package for a tool that is already
> deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].
>
> Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".
>
> [1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html
>
> Best regards,
> Romain
>
> >
> > Dario Binacchi (20):
> >   configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
> >     setting
> >   configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
> >     setting
> >   configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader
> >     version
> >   configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader
> >     version
> >   boot/ti-k3-r5-loader: bump to version 2024.01
> >   boot/ti-k3-core-secdev: new package
> >   boot/ti-k3-image-gen: manage HS hardware
> >   package/python-jsonschema: add host variant
> >   package/python-attrs: add host variant
> >   package/python-referencing: add host variant
> >   package/python-rpds-py: add host variant
> >   package/python-jsonschema-specifications: add host variant
> >   boot/ti-k3-r5-loader: set binman environment
> >   boot/uboot: set BINMAN_INDIRS for TI K3 DM
> >   configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
> >   configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
> >   boot: move ti-k3-* packages to 'ti-k3' directory
> >   boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
> >   boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
> >   configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore
> >
> >  DEVELOPERS                                    |  1 +
> >  board/ti/am62x-sk/genimage.cfg                |  7 +-
> >  board/ti/am62x-sk/post-build.sh               | 49 ++++++++++++
> >  board/ti/am62x-sk/post-image.sh               |  5 ++
> >  boot/Config.in                                |  4 +-
> >  boot/ti-k3-image-gen/Config.in                | 77 -------------------
> >  boot/ti-k3/Config.in                          | 59 ++++++++++++++
> >  boot/ti-k3/common.mk                          |  1 +
> >  .../{ => ti-k3}/ti-k3-boot-firmware/Config.in |  0
> >  .../ti-k3-boot-firmware.hash                  |  0
> >  .../ti-k3-boot-firmware.mk                    |  0
> >  boot/ti-k3/ti-k3-core-secdev/Config.in        |  9 +++
> >  .../ti-k3-core-secdev/ti-k3-core-secdev.hash  |  3 +
> >  .../ti-k3-core-secdev/ti-k3-core-secdev.mk    | 22 ++++++
> >  boot/ti-k3/ti-k3-image-gen/Config.in          | 25 ++++++
> >  .../ti-k3-image-gen/ti-k3-image-gen.hash      |  0
> >  .../ti-k3-image-gen/ti-k3-image-gen.mk        | 20 ++++-
> >  boot/{ => ti-k3}/ti-k3-r5-loader/Config.in    |  4 +-
> >  .../ti-k3-r5-loader/ti-k3-r5-loader.hash      |  2 +-
> >  .../ti-k3-r5-loader/ti-k3-r5-loader.mk        | 16 +++-
> >  boot/uboot/Config.in                          |  7 +-
> >  boot/uboot/uboot.mk                           |  3 +-
> >  configs/ti_am62x_sk_defconfig                 | 23 +++---
> >  configs/ti_am64x_sk_defconfig                 |  8 +-
> >  package/python-attrs/python-attrs.mk          |  6 ++
> >  .../python-jsonschema-specifications.mk       |  5 ++
> >  .../python-jsonschema/python-jsonschema.mk    |  6 ++
> >  .../python-referencing/python-referencing.mk  |  5 ++
> >  package/python-rpds-py/python-rpds-py.mk      |  1 +
> >  29 files changed, 263 insertions(+), 105 deletions(-)
> >  create mode 100755 board/ti/am62x-sk/post-build.sh
> >  create mode 100755 board/ti/am62x-sk/post-image.sh
> >  delete mode 100644 boot/ti-k3-image-gen/Config.in
> >  create mode 100644 boot/ti-k3/Config.in
> >  create mode 100644 boot/ti-k3/common.mk
> >  rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
> >  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
> >  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
> >  create mode 100644 boot/ti-k3/ti-k3-core-secdev/Config.in
> >  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
> >  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
> >  create mode 100644 boot/ti-k3/ti-k3-image-gen/Config.in
> >  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
> >  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (67%)
> >  rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (97%)
> >  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (54%)
> >  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (85%)
> >
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-19 11:02   ` Michael Nazzareno Trimarchi
@ 2024-02-19 11:24     ` Romain Naour
  2024-02-20  0:41       ` Andreas Dannenberg via buildroot
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19 11:24 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: linux-amarula, Anand Gadiyar, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot, Dario Binacchi,
	Alexander Sverdlin, bryce, Andreas Dannenberg

Hello Michael,

Le 19/02/2024 à 12:02, Michael Nazzareno Trimarchi a écrit :
> Hi Romain
> 
> On Mon, Feb 19, 2024 at 10:30 AM Romain Naour <romain.naour@smile.fr> wrote:
>>
>> Hello Dario,
>>
>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
>>> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
>>> high-security field-securable (HS-FS) silicon to optionally customize keys
>>> and encryption for security applications.
>>> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
>>> which, however, was buggy. This series fixes the errors and bumps the Linux
>>> kernel and U-Boot required for such a new device.
>>>
>>> This series, which in my humble opinion, should have been immediately
>>> considered to correct the compilation errors in case of HS-FS devcies, has
>>> seen an increase in patches in version 4 to remove the ti-k3-image-gen
>>> package thanks to Binman. Additionally, it shares some modifications and
>>> views on how to implement certain changes with the series
>>> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
>>> Therefore, I think it is necessary not to run them in parallel but to decide
>>> whether to merge one before the other or to consider a single series where
>>> the patches can be coherent with each other. I am available for both solutions.
>>> Let me know.
>>
>> Thanks for this new version. I beleive both series should be merged into one
>> since we want to follow u-boot switch to binman, add more TI K3 SoC support and
>> keeping exising am62x ans am64x working in GP or HS/HS-FS.
>>
> 
> Because the Dario patchset was sent before (end of November), it's
> reasonable to review and adjust that one
> and apply your changes for ti_j721e_sk on top of it. It think that is
> a standard way to make people happy about
> their work and contribution.

Actually, the two series are about the same topic: TI K3 SoC support (GP, HS,
HS-FS) not only AM62x-SK HS-FS devices

But due to the complexity of the BSP, the boot flow (4 way to boot!) and the
switch from custom tool to binman... this series is really difficult to review
without having a good understanding of TI K3 architecture peculiarity and having
one of each TI evaluation boards 🙂

The series (based on Dario's work) about ti_j721e_sk suggested to remove TI
custom tools replaced by binman along with other improvements.

I'll way for v5 and rebase the ti_j721e_sk on top of it.

Best regards,
Romain


> 
> Michael
> 
>> My main concern is to avoid adding a new package for a tool that is already
>> deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].
>>
>> Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".
>>
>> [1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html
>>
>> Best regards,
>> Romain
>>
>>>
>>> Dario Binacchi (20):
>>>   configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
>>>     setting
>>>   configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
>>>     setting
>>>   configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader
>>>     version
>>>   configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader
>>>     version
>>>   boot/ti-k3-r5-loader: bump to version 2024.01
>>>   boot/ti-k3-core-secdev: new package
>>>   boot/ti-k3-image-gen: manage HS hardware
>>>   package/python-jsonschema: add host variant
>>>   package/python-attrs: add host variant
>>>   package/python-referencing: add host variant
>>>   package/python-rpds-py: add host variant
>>>   package/python-jsonschema-specifications: add host variant
>>>   boot/ti-k3-r5-loader: set binman environment
>>>   boot/uboot: set BINMAN_INDIRS for TI K3 DM
>>>   configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
>>>   configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
>>>   boot: move ti-k3-* packages to 'ti-k3' directory
>>>   boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
>>>   boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
>>>   configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore
>>>
>>>  DEVELOPERS                                    |  1 +
>>>  board/ti/am62x-sk/genimage.cfg                |  7 +-
>>>  board/ti/am62x-sk/post-build.sh               | 49 ++++++++++++
>>>  board/ti/am62x-sk/post-image.sh               |  5 ++
>>>  boot/Config.in                                |  4 +-
>>>  boot/ti-k3-image-gen/Config.in                | 77 -------------------
>>>  boot/ti-k3/Config.in                          | 59 ++++++++++++++
>>>  boot/ti-k3/common.mk                          |  1 +
>>>  .../{ => ti-k3}/ti-k3-boot-firmware/Config.in |  0
>>>  .../ti-k3-boot-firmware.hash                  |  0
>>>  .../ti-k3-boot-firmware.mk                    |  0
>>>  boot/ti-k3/ti-k3-core-secdev/Config.in        |  9 +++
>>>  .../ti-k3-core-secdev/ti-k3-core-secdev.hash  |  3 +
>>>  .../ti-k3-core-secdev/ti-k3-core-secdev.mk    | 22 ++++++
>>>  boot/ti-k3/ti-k3-image-gen/Config.in          | 25 ++++++
>>>  .../ti-k3-image-gen/ti-k3-image-gen.hash      |  0
>>>  .../ti-k3-image-gen/ti-k3-image-gen.mk        | 20 ++++-
>>>  boot/{ => ti-k3}/ti-k3-r5-loader/Config.in    |  4 +-
>>>  .../ti-k3-r5-loader/ti-k3-r5-loader.hash      |  2 +-
>>>  .../ti-k3-r5-loader/ti-k3-r5-loader.mk        | 16 +++-
>>>  boot/uboot/Config.in                          |  7 +-
>>>  boot/uboot/uboot.mk                           |  3 +-
>>>  configs/ti_am62x_sk_defconfig                 | 23 +++---
>>>  configs/ti_am64x_sk_defconfig                 |  8 +-
>>>  package/python-attrs/python-attrs.mk          |  6 ++
>>>  .../python-jsonschema-specifications.mk       |  5 ++
>>>  .../python-jsonschema/python-jsonschema.mk    |  6 ++
>>>  .../python-referencing/python-referencing.mk  |  5 ++
>>>  package/python-rpds-py/python-rpds-py.mk      |  1 +
>>>  29 files changed, 263 insertions(+), 105 deletions(-)
>>>  create mode 100755 board/ti/am62x-sk/post-build.sh
>>>  create mode 100755 board/ti/am62x-sk/post-image.sh
>>>  delete mode 100644 boot/ti-k3-image-gen/Config.in
>>>  create mode 100644 boot/ti-k3/Config.in
>>>  create mode 100644 boot/ti-k3/common.mk
>>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
>>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
>>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
>>>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/Config.in
>>>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
>>>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
>>>  create mode 100644 boot/ti-k3/ti-k3-image-gen/Config.in
>>>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
>>>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (67%)
>>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (97%)
>>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (54%)
>>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (85%)
>>>
>>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package
  2024-02-19  9:48   ` Romain Naour
@ 2024-02-19 20:15     ` Andreas Dannenberg via buildroot
  0 siblings, 0 replies; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-19 20:15 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Dario Binacchi, Alexander Sverdlin,
	bryce, Anand Gadiyar

Hi Romain, All,

On Mon, Feb 19, 2024 at 10:48:59AM +0100, Romain Naour wrote:
> Hello Dario,
> 
> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> > This is a security development package containing tools for
> > High-Security(HS) TI K3 platform devices.
> 
> Note: this tool can also handle TI "legacy" platform such AM57xx or AM43xx (not
> sure we really want do that).

While there are secure variants of those older platforms, it is very
much controlled/restricted and not something readily available. So not
something somebody easily can obtain to test, etc. Either way the secure
dev source package associated with 'ti-k3-core-secdev' here is also only
for K3 generation of devices and won't compatible with AM57xx or AM43xx
anyways.

> 
> Can you try without this package when using binman?
> This tool doesn't seems "future proof".
> 
> http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html

Yes we should drop the package.

Thanks, Andreas


> Best regards,
> Romain
> 
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > 
> > ---
> > 
> > Changes in v4:
> > - Remove the trailing '/' at the end of the url in the help of
> >   Config.in
> > - Fixed license issues
> > - Use $(BINARIES_DIR)/ti-k3-core-secdev as the directory where to
> >   install files.
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  DEVELOPERS                                    |  1 +
> >  boot/Config.in                                |  1 +
> >  boot/ti-k3-core-secdev/Config.in              |  9 ++++++++
> >  boot/ti-k3-core-secdev/ti-k3-core-secdev.hash |  3 +++
> >  boot/ti-k3-core-secdev/ti-k3-core-secdev.mk   | 22 +++++++++++++++++++
> >  5 files changed, 36 insertions(+)
> >  create mode 100644 boot/ti-k3-core-secdev/Config.in
> >  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> >  create mode 100644 boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> > 
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 0d12c3abcb11..33d99ab2440f 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -753,6 +753,7 @@ F:	package/xinetd/
> >  N:	Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >  F:	board/bsh/
> >  F:	board/stmicroelectronics/stm32f769-disco/
> > +F:	boot/ti-k3-core-secdev/
> >  F:	configs/imx8mn_bsh_smm_s2_defconfig
> >  F:	configs/imx8mn_bsh_smm_s2_pro_defconfig
> >  F:	configs/stm32f769_disco_sd_defconfig
> > diff --git a/boot/Config.in b/boot/Config.in
> > index e5fdf7ad439e..18a7d268f95a 100644
> > --- a/boot/Config.in
> > +++ b/boot/Config.in
> > @@ -20,6 +20,7 @@ source "boot/s500-bootloader/Config.in"
> >  source "boot/shim/Config.in"
> >  source "boot/syslinux/Config.in"
> >  source "boot/ti-k3-boot-firmware/Config.in"
> > +source "boot/ti-k3-core-secdev/Config.in"
> >  source "boot/ti-k3-image-gen/Config.in"
> >  source "boot/ti-k3-r5-loader/Config.in"
> >  source "boot/uboot/Config.in"
> > diff --git a/boot/ti-k3-core-secdev/Config.in b/boot/ti-k3-core-secdev/Config.in
> > new file mode 100644
> > index 000000000000..f7b4e2962042
> > --- /dev/null
> > +++ b/boot/ti-k3-core-secdev/Config.in
> > @@ -0,0 +1,9 @@
> > +config BR2_TARGET_TI_K3_CORE_SECDEV
> > +	bool "ti-k3-core-secdev"
> > +	depends on BR2_aarch64
> > +	help
> > +	  This package downloads and installs development tools for
> > +	  High-Security(HS) TI K3 platforms (which include AM62x,
> > +	  AM64x, AM65x and more).
> > +
> > +	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> > diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> > new file mode 100644
> > index 000000000000..e3074a398d62
> > --- /dev/null
> > +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.hash
> > @@ -0,0 +1,3 @@
> > +# Locally calculated
> > +sha256  b6d3bca0d561d055c6869c5564b06f2fb1b9f67e4ef180c2baf8a14a6a6afa06  core-secdev-k3-08.06.00.007.tar.xz
> > +sha256  3e5cf4f5ab9f0333f46cd68fabede3f21e55de1a9e3c6ad673f241f4514d8369  manifest/k3-secdev-0.2-manifest.html
> > diff --git a/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> > new file mode 100644
> > index 000000000000..f7655a0fefc8
> > --- /dev/null
> > +++ b/boot/ti-k3-core-secdev/ti-k3-core-secdev.mk
> > @@ -0,0 +1,22 @@
> > +################################################################################
> > +#
> > +# ti-k3-core-secdev
> > +#
> > +################################################################################
> > +
> > +TI_K3_CORE_SECDEV_VERSION = 08.06.00.007
> > +TI_K3_CORE_SECDEV_SITE = https://git.ti.com/cgit/security-development-tools/core-secdev-k3/snapshot
> > +TI_K3_CORE_SECDEV_SOURCE = core-secdev-k3-$(TI_K3_CORE_SECDEV_VERSION).tar.xz
> > +TI_K3_CORE_SECDEV_INSTALL_IMAGES = YES
> > +TI_K3_CORE_SECDEV_LICENSE = BSD-3-Clause
> > +TI_K3_CORE_SECDEV_LICENSE_FILES = manifest/k3-secdev-0.2-manifest.html
> > +
> > +TI_K3_CORE_SECDEV_INSTALL_DIR = $(BINARIES_DIR)/ti-k3-core-secdev
> > +
> > +define TI_K3_CORE_SECDEV_INSTALL_IMAGES_CMDS
> > +	mkdir -p $(TI_K3_CORE_SECDEV_INSTALL_DIR)
> > +	cp -dpfr $(@D)/keys $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> > +	cp -dpfr $(@D)/scripts $(TI_K3_CORE_SECDEV_INSTALL_DIR)/
> > +endef
> > +
> > +$(eval $(generic-package))
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-19  9:58   ` Romain Naour
@ 2024-02-19 20:19     ` Andreas Dannenberg via buildroot
  0 siblings, 0 replies; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-19 20:19 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Dario Binacchi, Alexander Sverdlin,
	bryce, Anand Gadiyar

On Mon, Feb 19, 2024 at 10:58:26AM +0100, Romain Naour wrote:
> Hello Dario,
> 
> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> > The patch sets the configurations required by TI HS systems. Some of these
> > configurations (i. e. HS SYSFW image signing key, HS Software Revision)
> > are provided by the ti-k3-core-secdev package in the binaries directory.
> 
> Such keys has been added to u-boot v2023.10:
> 
> https://git.ti.com/cgit/security-development-tools/core-secdev-k3/tree/keys
> 
> https://source.denx.de/u-boot/u-boot/-/commit/d5b1ef30d7ffabb9f57d5c62b9f0608837af0f4f
> 
> Do we need something else from ti-k3-core-secdev package that is not already
> provided by u-boot?

No, we don't need anything from that. If you look at TI's current SDKs/Yocto
builds this package is not used at all. The TI goal is to do things in a
standard upstream way (in upstream) as much as possible, hence we are
trying to move away from all these "vendor quirks" however possible.

Regards, Andreas



> 
> Best regards,
> Romain
> 
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > 
> > ---
> > 
> > no changes since v3:
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3-image-gen/Config.in          |  1 +
> >  boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
> >  2 files changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> > index d76cef82e911..38d1598d9fc0 100644
> > --- a/boot/ti-k3-image-gen/Config.in
> > +++ b/boot/ti-k3-image-gen/Config.in
> > @@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >  	bool "ti-k3-image-gen"
> >  	depends on BR2_TARGET_TI_K3_R5_LOADER
> >  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> > +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >  	# We need FIT support in uboot-tools, which is why we select a
> >  	# host package
> >  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> > diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > index 64be9a18f2c4..74b4fcb4bf89 100644
> > --- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > @@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> >  TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> >  TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> >  
> > -TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > +ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> > +TI_K3_IMAGE_GEN_SYSFW = \
> > +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > +else
> > +TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev
> > +
> > +TI_K3_IMAGE_GEN_SYSFW = \
> > +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
> > +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
> > +endif
> >  
> >  define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
> > -	cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
> > +	$(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
> > +		cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
> > +	)
> >  endef
> >  
> >  define TI_K3_IMAGE_GEN_BUILD_CMDS
> > @@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
> >  	$(BR2_MAKE) -C $(@D) \
> >  		SOC=$(TI_K3_IMAGE_GEN_SOC) \
> >  		SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
> > +		TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \
> >  		CONFIG=evm \
> >  		CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
> >  		SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-17 23:45   ` Alexander Sverdlin
  2024-02-18 14:01     ` Dario Binacchi
  2024-02-19 10:42     ` Romain Naour
@ 2024-02-19 20:36     ` Andreas Dannenberg via buildroot
  2024-02-19 20:42       ` Alexander Sverdlin
  2 siblings, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-19 20:36 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Dario Binacchi,
	linux-amarula, bryce, Anand Gadiyar

Hi Alexander,

On Sun, Feb 18, 2024 at 12:45:47AM +0100, Alexander Sverdlin wrote:
> Hi Dario,
> 
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > The patch sets the configurations required by TI HS systems. Some of these
> > configurations (i. e. HS SYSFW image signing key, HS Software Revision)
> > are provided by the ti-k3-core-secdev package in the binaries directory.
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> so for test I've reverted the previous "boot/ti-k3-core-secdev: new package"
> commit, then...
> 
> > ---
> > 
> > no changes since v3:
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3-image-gen/Config.in          |  1 +
> >  boot/ti-k3-image-gen/ti-k3-image-gen.mk | 16 ++++++++++++++--
> >  2 files changed, 15 insertions(+), 2 deletions(-)
> > 
> > diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
> > index d76cef82e911..38d1598d9fc0 100644
> > --- a/boot/ti-k3-image-gen/Config.in
> > +++ b/boot/ti-k3-image-gen/Config.in
> > @@ -2,6 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >  	bool "ti-k3-image-gen"
> >  	depends on BR2_TARGET_TI_K3_R5_LOADER
> >  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> > +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> 
> ... removed this, ...
> 
> >  	# We need FIT support in uboot-tools, which is why we select a
> >  	# host package
> >  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> > diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > index 64be9a18f2c4..74b4fcb4bf89 100644
> > --- a/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
> > @@ -29,10 +29,21 @@ TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> >  TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> >  TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> >  
> > -TI_K3_IMAGE_GEN_SYSFW = $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > +ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> > +TI_K3_IMAGE_GEN_SYSFW = \
> > +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > +else
> > +TI_K3_IMAGE_GEN_DEPENDENCIES += ti-k3-core-secdev
> 
> ... the above line, ...
> 
> > +
> > +TI_K3_IMAGE_GEN_SYSFW = \
> > +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-enc.bin \
> > +	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE)-cert.bin
> > +endif
> >  
> >  define TI_K3_IMAGE_GEN_CONFIGURE_CMDS
> > -	cp $(BINARIES_DIR)/ti-sysfw/$(TI_K3_IMAGE_GEN_SYSFW) $(@D)
> > +	$(foreach t,$(TI_K3_IMAGE_GEN_SYSFW),\
> > +		cp $(BINARIES_DIR)/ti-sysfw/$(t) $(@D)/
> > +	)
> >  endef
> >  
> >  define TI_K3_IMAGE_GEN_BUILD_CMDS
> > @@ -40,6 +51,7 @@ define TI_K3_IMAGE_GEN_BUILD_CMDS
> >  	$(BR2_MAKE) -C $(@D) \
> >  		SOC=$(TI_K3_IMAGE_GEN_SOC) \
> >  		SOC_TYPE=$(TI_K3_IMAGE_GEN_SECTYPE) \
> > +		TI_SECURE_DEV_PKG=$(BINARIES_DIR)/ti-k3-core-secdev \
> 
> ... and this line...
> 
> >  		CONFIG=evm \
> >  		CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
> >  		SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
> 
> ... and everything still builds and boots fine on SK-AM62B (HS-FS):
> 
> U-Boot SPL 2024.01 (Feb 18 2024 - 00:02:43 +0100)
> SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> SPL initial stack usage: 13400 bytes
> Trying to boot from MMC2
> Authentication passed
> Authentication passed
> Authentication passed
> Authentication passed
> Authentication passed
> Starting ATF on ARM64 core...
> 
> NOTICE:  BL31: v2.7(release):v2.7
> NOTICE:  BL31: Built : 23:57:43, Feb 17 2024
> I/TC: 
> I/TC: OP-TEE version: Unknown_4.0 (gcc version 12.3.0 (Buildroot 2023.11-1199-g470b2069e4)) #1 Sat Feb 17 22:57:38 UTC 2024 aarch64
> I/TC: WARNING: This OP-TEE configuration might be insecure!
> I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
> I/TC: Primary CPU initializing
> I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> I/TC: HUK Initialized
> I/TC: Activated SA2UL device
> I/TC: Enabled firewalls for SA2UL TRNG device
> I/TC: SA2UL TRNG initialized
> I/TC: SA2UL Drivers initialized
> I/TC: Primary CPU switching to normal world boot
> 
> U-Boot SPL 2024.01 (Feb 18 2024 - 00:03:30 +0100)
> SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
> SPL initial stack usage: 1872 bytes
> Trying to boot from MMC2
> Authentication passed
> Authentication passed
> 
> 
> U-Boot 2024.01 (Feb 18 2024 - 00:03:30 +0100)
> 
> SoC:   AM62X SR1.0 HS-FS
> Model: Texas Instruments AM625 SK
> DRAM:  2 GiB
> Core:  56 devices, 23 uclasses, devicetree: separate
> MMC:   mmc@fa10000: 0, mmc@fa00000: 1
> Loading Environment from nowhere... OK
> In:    serial@2800000
> Out:   serial@2800000
> Err:   serial@2800000
> Net:   eth0: ethernet@8000000port@1
> Hit any key to stop autoboot:  0 
> switch to partitions #0, OK
> mmc1 is current device
> SD/MMC found on device 1
> Failed to load 'uEnv.txt'
> Scanning for bootflows in all bootdevs
> Seq  Method       State   Uclass    Part  Name                      Filename
> ---  -----------  ------  --------  ----  ------------------------  ----------------
> Scanning global bootmeth 'efi_mgr':
> No EFI system partition
> No EFI system partition
> Failed to persist EFI variables
> Scanning bootdev 'mmc@fa00000.bootdev':
>   0  extlinux     ready   mmc          1  mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
> ** Booting bootflow 'mmc@fa00000.bootdev.part_1' with extlinux
> 1:      am62x-sk-buildroot
> Retrieving file: /Image
> append: console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait earlycon=ns16550a,mmio32,0x02800000
> Retrieving file: /k3-am62x.dtb
> ## Flattened Device Tree blob at ffb14700
>    Booting using the fdt blob at 0xffb14700
> Working FDT set to ffb14700
>    Loading Device Tree to 000000008ffed000, end 000000008ffff687 ... OK
> Working FDT set to 8ffed000
> 
> Starting kernel ...
> 
> [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]

Just wanting to double-check one quick detail. Did you have to make any
additional modifications to boot-mode related U-Boot settings or ENV
variables? Or did the "new normal" of CONFIG_BOOTSTD just work for you? 


--
Andreas Dannenberg
Texas Instruments Inc



> [    0.000000] Linux version 6.6.1 (...) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2023.11-1199-g470b2069e4) 12.3.0, GNU ld (GNU Binutils) 2.40) #1 SMP PREEMPT Sun Feb 18 
> 00:37:47 CET 2024
> 
> 
> 
> -- 
> Alexander Sverdlin.
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware
  2024-02-19 20:36     ` Andreas Dannenberg via buildroot
@ 2024-02-19 20:42       ` Alexander Sverdlin
  0 siblings, 0 replies; 84+ messages in thread
From: Alexander Sverdlin @ 2024-02-19 20:42 UTC (permalink / raw)
  To: Andreas Dannenberg
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Dario Binacchi,
	linux-amarula, bryce, Anand Gadiyar

Hi Andreas!

On Mon, 2024-02-19 at 14:36 -0600, Andreas Dannenberg wrote:
> >    0  extlinux     ready   mmc          1  mmc@fa00000.bootdev.part_ /extlinux/extlinux.conf
> > ** Booting bootflow 'mmc@fa00000.bootdev.part_1' with extlinux
> > 1:      am62x-sk-buildroot
> > Retrieving file: /Image
> > append: console=ttyS2,115200n8 root=/dev/mmcblk1p2 rw rootfstype=ext4 rootwait earlycon=ns16550a,mmio32,0x02800000
> > Retrieving file: /k3-am62x.dtb
> > ## Flattened Device Tree blob at ffb14700
> >     Booting using the fdt blob at 0xffb14700
> > Working FDT set to ffb14700
> >     Loading Device Tree to 000000008ffed000, end 000000008ffff687 ... OK
> > Working FDT set to 8ffed000
> > 
> > Starting kernel ...
> > 
> > [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
> 
> Just wanting to double-check one quick detail. Did you have to make any
> additional modifications to boot-mode related U-Boot settings or ENV
> variables? Or did the "new normal" of CONFIG_BOOTSTD just work for you? 

No changes in U-Boot whatsoever, patchset from Dario works as-is, seems
that the extlinux.conf visible in the log above did the trick.

-- 
Alexander Sverdlin.

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-17 20:44   ` Alexander Sverdlin
  2024-02-18 13:55     ` Dario Binacchi
@ 2024-02-19 20:51     ` Andreas Dannenberg via buildroot
  2024-02-19 21:34       ` Romain Naour
  1 sibling, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-19 20:51 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Dario Binacchi,
	linux-amarula, bryce, Anand Gadiyar

On Sat, Feb 17, 2024 at 09:44:29PM +0100, Alexander Sverdlin wrote:
> Hi Dario,
> 
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > As explained in [1], adding support for AM62x LP SK in U-Boot, requires
> > binman for building bootloader images. The BINMAN_INDIRS environment
> > variable is used to provide a space-separated list of directories to
> > search for binary blobs.
> > 
> > [1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > 
> > ---
> > 
> > no changes since v1:
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/uboot/uboot.mk | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> > index dda606a88059..cf70f86a4132 100644
> > --- a/boot/uboot/uboot.mk
> > +++ b/boot/uboot/uboot.mk
> > @@ -189,7 +189,8 @@ endif
> >  ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
> >  UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
> >  UBOOT_DEPENDENCIES += ti-k3-boot-firmware
> > -UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
> > +UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \
> 
> Is the above actually still required with binman?
> The names are hardcoded in U-Boot in arch/arm/dts/k3-am625-sk-binman.dtsi
> 
> > +	BINMAN_INDIRS=$(BINARIES_DIR)
> 
> This seems to be the only required part.

Correct. 'DM=' is no longer used, also see the official U-Boot build
instructions for TI platforms in the SDK documentation [1] (technically
speaking this documentation is for the U-Boot vendor tree, but the same
principle applies to upstream U-Boot builds).

Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>

[1] 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



> 
> >  endif
> >  
> >  ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
> 
> -- 
> Alexander Sverdlin.
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-19 20:51     ` Andreas Dannenberg via buildroot
@ 2024-02-19 21:34       ` Romain Naour
  2024-02-20  2:00         ` Andreas Dannenberg via buildroot
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-19 21:34 UTC (permalink / raw)
  To: Andreas Dannenberg, Alexander Sverdlin
  Cc: michael, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Dario Binacchi, linux-amarula,
	bryce, Anand Gadiyar

Hello Andreas,

Le 19/02/2024 à 21:51, Andreas Dannenberg a écrit :
> On Sat, Feb 17, 2024 at 09:44:29PM +0100, Alexander Sverdlin wrote:
>> Hi Dario,
>>
>> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
>>> As explained in [1], adding support for AM62x LP SK in U-Boot, requires
>>> binman for building bootloader images. The BINMAN_INDIRS environment
>>> variable is used to provide a space-separated list of directories to
>>> search for binary blobs.
>>>
>>> [1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>>
>>> ---
>>>
>>> no changes since v1:
>>>
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>> ---
>>>  boot/uboot/uboot.mk | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
>>> index dda606a88059..cf70f86a4132 100644
>>> --- a/boot/uboot/uboot.mk
>>> +++ b/boot/uboot/uboot.mk
>>> @@ -189,7 +189,8 @@ endif
>>>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
>>>  UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
>>>  UBOOT_DEPENDENCIES += ti-k3-boot-firmware
>>> -UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
>>> +UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \
>>
>> Is the above actually still required with binman?
>> The names are hardcoded in U-Boot in arch/arm/dts/k3-am625-sk-binman.dtsi
>>
>>> +	BINMAN_INDIRS=$(BINARIES_DIR)
>>
>> This seems to be the only required part.
> 
> Correct. 'DM=' is no longer used, also see the official U-Boot build
> instructions for TI platforms in the SDK documentation [1] (technically
> speaking this documentation is for the U-Boot vendor tree, but the same
> principle applies to upstream U-Boot builds).
> 
> Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
> 
> [1] 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

It means that we can remove BR2_TARGET_UBOOT_NEEDS_TI_K3_DM and
UBOOT_TI_K3_DM_SOCNAME too.

meta-ti still use DM= but probably to support u-boot-ti-staging_2023.04 that is
still available [1].

The u-boot documentation also contains a similar note [2].

In the end we only need an option to select which SoC type we want to use
(GP,HS,HS-FS).

[1]
https://git.yoctoproject.org/meta-ti/tree/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc?h=cicd.master.202402130100#n52

[2]
https://gitlab.com/u-boot/u-boot/-/blob/master/doc/board/ti/k3.rst?ref_type=heads&plain=1#L372

Best regards,
Romain

> 
> 
> 
>>
>>>  endif
>>>  
>>>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
>>
>> -- 
>> Alexander Sverdlin.
>>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-17 17:40 ` [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Alexander Sverdlin
  2024-02-19 10:35   ` Romain Naour
@ 2024-02-19 22:42   ` Patrick Oppenlander
  1 sibling, 0 replies; 84+ messages in thread
From: Patrick Oppenlander @ 2024-02-19 22:42 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: michael, Anand Gadiyar, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, Dario Binacchi,
	linux-amarula, bryce, Andreas Dannenberg

On Sun, 18 Feb 2024 at 04:40, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
>
> Hi Dario!
>
> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> > This series, which in my humble opinion, should have been immediately
> > considered to correct the compilation errors in case of HS-FS devcies, has
> > seen an increase in patches in version 4 to remove the ti-k3-image-gen
>
> I wasn't aware of the preceeding versions, but...
>
> > package thanks to Binman. Additionally, it shares some modifications and
> > views on how to implement certain changes with the series
> > https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> > Therefore, I think it is necessary not to run them in parallel but to decide
> > whether to merge one before the other or to consider a single series where
> > the patches can be coherent with each other. I am available for both solutions.
> > Let me know.
>
> ... as the broken HS-FS went unnoticed, seems there is no rush to fix the
> build now?

I noticed, and hacked in some am64x specific fixes here:
https://github.com/relectrify/buildroot/commits/2023.11.1_relectrify.

I was going to submit a cleaned up version of the patches, but I got
distracted by fixing encrypted boot (see below) and never got back to
cleaning them up. Sorry about that.

Apparently TI don't support encrypted boot in their Linux SDK (yet?),
only in the MCU SDK. There's a python script in the MCU SDK
(rom_image_gen.py) which kinda works once you teach it how to read
ascii keys as generated by the keywriter package. Except, it changes
the size of the plaintext because it aligns it to 16-bytes and appends
32 random bytes, which causes a boot failure somewhere early on in
U-Boot. I hacked around that by sticking the original binary size into
some of those random bytes (it's not part of the X509 cert..) and
teaching U-Boot to detect the encrypted image
(https://github.com/relectrify/u-boot/commit/d16b4705ffebb0881633dfd5300bf4ac8490e75c)
and doing a fixup. Once you do that, and change all the right places
to run rom_image_gen.py it works, but it's pretty painful to get
there.

Hopefully this situation is a bit better in the binman version.

Patrick
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-19 11:24     ` Romain Naour
@ 2024-02-20  0:41       ` Andreas Dannenberg via buildroot
  2024-02-20 10:03         ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-20  0:41 UTC (permalink / raw)
  To: Romain Naour
  Cc: Dario Binacchi, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot,
	Michael Nazzareno Trimarchi, Alexander Sverdlin, bryce,
	Anand Gadiyar

On Mon, Feb 19, 2024 at 12:24:52PM +0100, Romain Naour wrote:
> Hello Michael,
> 
> Le 19/02/2024 à 12:02, Michael Nazzareno Trimarchi a écrit :
> > Hi Romain
> > 
> > On Mon, Feb 19, 2024 at 10:30 AM Romain Naour <romain.naour@smile.fr> wrote:
> >>
> >> Hello Dario,
> >>
> >> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> >>> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
> >>> high-security field-securable (HS-FS) silicon to optionally customize keys
> >>> and encryption for security applications.
> >>> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
> >>> which, however, was buggy. This series fixes the errors and bumps the Linux
> >>> kernel and U-Boot required for such a new device.
> >>>
> >>> This series, which in my humble opinion, should have been immediately
> >>> considered to correct the compilation errors in case of HS-FS devcies, has
> >>> seen an increase in patches in version 4 to remove the ti-k3-image-gen
> >>> package thanks to Binman. Additionally, it shares some modifications and
> >>> views on how to implement certain changes with the series
> >>> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> >>> Therefore, I think it is necessary not to run them in parallel but to decide
> >>> whether to merge one before the other or to consider a single series where
> >>> the patches can be coherent with each other. I am available for both solutions.
> >>> Let me know.
> >>
> >> Thanks for this new version. I beleive both series should be merged into one
> >> since we want to follow u-boot switch to binman, add more TI K3 SoC support and
> >> keeping exising am62x ans am64x working in GP or HS/HS-FS.
> >>
> > 
> > Because the Dario patchset was sent before (end of November), it's
> > reasonable to review and adjust that one
> > and apply your changes for ti_j721e_sk on top of it. It think that is
> > a standard way to make people happy about
> > their work and contribution.
> 
> Actually, the two series are about the same topic: TI K3 SoC support (GP, HS,
> HS-FS) not only AM62x-SK HS-FS devices
> 
> But due to the complexity of the BSP, the boot flow (4 way to boot!) and the
> switch from custom tool to binman... this series is really difficult to review
> without having a good understanding of TI K3 architecture peculiarity and having
> one of each TI evaluation boards 🙂

Although I helped conceive some of this and the associated tooling early
on, some of the what may look strange architectural decisions were driven
by different use cases and requirements for the different devices
(especially around automotive fast/early boot, but also security) in
combination with limited on-chip SRAM... So this where we are at now. A
future AM6x device variant will have yet another boot flow, but I can
already say it will be very much simplified over what we have today :)

> The series (based on Dario's work) about ti_j721e_sk suggested to remove TI
> custom tools replaced by binman along with other improvements.
> 
> I'll way for v5 and rebase the ti_j721e_sk on top of it.

Thank you Romain for your buy-in. Let's focus on getting Dario's series
in good shape and then move onto yours. I'd also like to re-introduce
graphics (I had that working before) but I need to wait for all the
"baseline" stuff to settle first.


--
Andreas Dannenberg
Texas Instruments Inc



> 
> Best regards,
> Romain
> 
> 
> > 
> > Michael
> > 
> >> My main concern is to avoid adding a new package for a tool that is already
> >> deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].
> >>
> >> Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".
> >>
> >> [1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html
> >>
> >> Best regards,
> >> Romain
> >>
> >>>
> >>> Dario Binacchi (20):
> >>>   configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
> >>>     setting
> >>>   configs/ti_am64x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM
> >>>     setting
> >>>   configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader
> >>>     version
> >>>   configs/ti_am64x_sk_defconfig: explicitly set the ti-k3-r5-loader
> >>>     version
> >>>   boot/ti-k3-r5-loader: bump to version 2024.01
> >>>   boot/ti-k3-core-secdev: new package
> >>>   boot/ti-k3-image-gen: manage HS hardware
> >>>   package/python-jsonschema: add host variant
> >>>   package/python-attrs: add host variant
> >>>   package/python-referencing: add host variant
> >>>   package/python-rpds-py: add host variant
> >>>   package/python-jsonschema-specifications: add host variant
> >>>   boot/ti-k3-r5-loader: set binman environment
> >>>   boot/uboot: set BINMAN_INDIRS for TI K3 DM
> >>>   configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01
> >>>   configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1
> >>>   boot: move ti-k3-* packages to 'ti-k3' directory
> >>>   boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
> >>>   boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
> >>>   configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore
> >>>
> >>>  DEVELOPERS                                    |  1 +
> >>>  board/ti/am62x-sk/genimage.cfg                |  7 +-
> >>>  board/ti/am62x-sk/post-build.sh               | 49 ++++++++++++
> >>>  board/ti/am62x-sk/post-image.sh               |  5 ++
> >>>  boot/Config.in                                |  4 +-
> >>>  boot/ti-k3-image-gen/Config.in                | 77 -------------------
> >>>  boot/ti-k3/Config.in                          | 59 ++++++++++++++
> >>>  boot/ti-k3/common.mk                          |  1 +
> >>>  .../{ => ti-k3}/ti-k3-boot-firmware/Config.in |  0
> >>>  .../ti-k3-boot-firmware.hash                  |  0
> >>>  .../ti-k3-boot-firmware.mk                    |  0
> >>>  boot/ti-k3/ti-k3-core-secdev/Config.in        |  9 +++
> >>>  .../ti-k3-core-secdev/ti-k3-core-secdev.hash  |  3 +
> >>>  .../ti-k3-core-secdev/ti-k3-core-secdev.mk    | 22 ++++++
> >>>  boot/ti-k3/ti-k3-image-gen/Config.in          | 25 ++++++
> >>>  .../ti-k3-image-gen/ti-k3-image-gen.hash      |  0
> >>>  .../ti-k3-image-gen/ti-k3-image-gen.mk        | 20 ++++-
> >>>  boot/{ => ti-k3}/ti-k3-r5-loader/Config.in    |  4 +-
> >>>  .../ti-k3-r5-loader/ti-k3-r5-loader.hash      |  2 +-
> >>>  .../ti-k3-r5-loader/ti-k3-r5-loader.mk        | 16 +++-
> >>>  boot/uboot/Config.in                          |  7 +-
> >>>  boot/uboot/uboot.mk                           |  3 +-
> >>>  configs/ti_am62x_sk_defconfig                 | 23 +++---
> >>>  configs/ti_am64x_sk_defconfig                 |  8 +-
> >>>  package/python-attrs/python-attrs.mk          |  6 ++
> >>>  .../python-jsonschema-specifications.mk       |  5 ++
> >>>  .../python-jsonschema/python-jsonschema.mk    |  6 ++
> >>>  .../python-referencing/python-referencing.mk  |  5 ++
> >>>  package/python-rpds-py/python-rpds-py.mk      |  1 +
> >>>  29 files changed, 263 insertions(+), 105 deletions(-)
> >>>  create mode 100755 board/ti/am62x-sk/post-build.sh
> >>>  create mode 100755 board/ti/am62x-sk/post-image.sh
> >>>  delete mode 100644 boot/ti-k3-image-gen/Config.in
> >>>  create mode 100644 boot/ti-k3/Config.in
> >>>  create mode 100644 boot/ti-k3/common.mk
> >>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/Config.in (100%)
> >>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.hash (100%)
> >>>  rename boot/{ => ti-k3}/ti-k3-boot-firmware/ti-k3-boot-firmware.mk (100%)
> >>>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/Config.in
> >>>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.hash
> >>>  create mode 100644 boot/ti-k3/ti-k3-core-secdev/ti-k3-core-secdev.mk
> >>>  create mode 100644 boot/ti-k3/ti-k3-image-gen/Config.in
> >>>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.hash (100%)
> >>>  rename boot/{ => ti-k3}/ti-k3-image-gen/ti-k3-image-gen.mk (67%)
> >>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/Config.in (97%)
> >>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.hash (54%)
> >>>  rename boot/{ => ti-k3}/ti-k3-r5-loader/ti-k3-r5-loader.mk (85%)
> >>>
> >>
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-19 10:28   ` Romain Naour
@ 2024-02-20  1:28     ` Andreas Dannenberg via buildroot
  2024-02-20  9:05       ` Dario Binacchi
  0 siblings, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-20  1:28 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Dario Binacchi, Alexander Sverdlin,
	bryce, Anand Gadiyar

Romain, Dario,

On Mon, Feb 19, 2024 at 11:28:59AM +0100, Romain Naour wrote:
> Hello Dario,
> 
> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> > Recent versions of U-Boot can use Binman to compile and sign the generated
> > binaries, thus making the use of custom tools like ti-k3-image-gen no
> > longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> > configured and used outside of it. This patch allows setting such options
> > even if the package is not enabled.
> 
> I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
> kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.

There were discussions/suggestions around this before by Yann E Morin
[1] and Thomas Petazzoni [2]. I think the gist of it was to move the
selection to a new package like BR2_PACKAGE_TI_K3_PLATFORM containing
all the K3 SoC specific selections. And then other packages and Kconfig
menues can depend on it more cleanly. Like it's currently done with
package/freescale-imx/Config.in.  This would also bring some consistency
in how those NXP and TI device families are managed, which will make for
a better end-user experience I think.



--
Andreas Dannenberg
Texas Instruments Inc

[1] http://lists.busybox.net/pipermail/buildroot/2023-June/669342.html
[2] http://lists.busybox.net/pipermail/buildroot/2023-August/673292.html


> 
> Best regards,
> Romain
> 
> 
> > 
> > ---
> > 
> > Added in v4
> > 
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3/Config.in                          | 46 ++++++++++++++
> >  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
> >  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
> >  boot/uboot/Config.in                          |  7 +--
> >  configs/ti_am62x_sk_defconfig                 |  2 +-
> >  configs/ti_am64x_sk_defconfig                 |  2 +-
> >  6 files changed, 59 insertions(+), 67 deletions(-)
> > 
> > diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> > index 06dda2f156a9..9e508326c9c8 100644
> > --- a/boot/ti-k3/Config.in
> > +++ b/boot/ti-k3/Config.in
> > @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
> >  
> >  if BR2_TARGET_TI_K3
> >  
> > +choice
> > +	prompt "SoC family"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM62AX
> > +	bool "am62ax"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM62X
> > +	bool "am62x"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM64X
> > +	bool "am64x"
> > +
> > +config BR2_TARGET_TI_K3_SOC_AM65X
> > +	bool "am65x"
> > +
> > +endchoice
> > +
> > +choice
> > +	prompt "Security type"
> > +	help
> > +	  The target SoC security type option.
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE_GP
> > +	bool "gp"
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> > +	bool "hs-fs"
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE_HS
> > +	bool "hs"
> > +
> > +endchoice
> > +
> > +config BR2_TARGET_TI_K3_SOC
> > +	string
> > +	default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> > +	default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> > +	default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> > +	default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> > +
> > +config BR2_TARGET_TI_K3_SECTYPE
> > +	string
> > +	default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> > +	default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> > +	default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> > +
> >  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
> >  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
> >  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> > diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> > index 38d1598d9fc0..2d53d62dd4ee 100644
> > --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> > +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> > @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >  	bool "ti-k3-image-gen"
> >  	depends on BR2_TARGET_TI_K3_R5_LOADER
> >  	select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> > -	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > +	select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
> >  	# We need FIT support in uboot-tools, which is why we select a
> >  	# host package
> >  	select BR2_PACKAGE_HOST_UBOOT_TOOLS
> > @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >  	  https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> >  
> >  if BR2_TARGET_TI_K3_IMAGE_GEN
> > -choice
> > -	prompt "SoC family"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -	bool "am62ax"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > -	bool "am62x"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > -	bool "am64x"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > -	bool "am65x"
> > -
> > -endchoice
> > -
> > -choice
> > -	prompt "Security type"
> > -	help
> > -	  The target SoC security type option for image gen.  Valid
> > -	  options are "gp" for General Purpose devices, "hs-fs" for
> > -	  High Security - Field Securable devices, or "hs" for High
> > -	  Security - Security Enforcing devices.  Note for all High
> > -	  Security device variants the TI_SECURE_DEV_PKG environmental
> > -	  variable must be defined at build time pointing to a valid
> > -	  core-secdev-k3 folder location, otherwise the build will
> > -	  fail, see
> > -	  https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> > -	bool "gp"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> > -	bool "hs-fs"
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > -	bool "hs"
> > -
> > -endchoice
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> > -	string
> > -	default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -	default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > -	default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > -	default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >  
> >  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
> >  	string
> > -	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -	default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > -	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > -	default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > -
> > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> > -	string
> > -	default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> > -	default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> > -	default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > +	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> > +	default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> > +	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> > +	default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
> >  
> >  endif
> > diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > index 74b4fcb4bf89..834d8f7d5cd5 100644
> > --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
> >  	$(BR2_MAKE_HOST_DEPENDENCY)
> >  
> >  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> > -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> > -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> > +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> > +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> >  
> > -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> > +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
> >  TI_K3_IMAGE_GEN_SYSFW = \
> >  	$(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> >  else
> > diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> > index beafb38930db..1a9d21e7c6d1 100644
> > --- a/boot/uboot/Config.in
> > +++ b/boot/uboot/Config.in
> > @@ -244,8 +244,7 @@ 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
> > +	depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
> >  	help
> >  	  Some TI K3 devices need the Device Manager (DM) firmware to
> >  	  be available for the U-Boot build.
> > @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> >  
> >  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
> >  	string
> > -	default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > -	default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > +	default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> > +	default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
> >  
> >  endif
> >  
> > diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> > index cd26235342e4..cfefce0a77a4 100644
> > --- a/configs/ti_am62x_sk_defconfig
> > +++ b/configs/ti_am62x_sk_defconfig
> > @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> >  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
> >  BR2_TARGET_TI_K3=y
> > +BR2_TARGET_TI_K3_SOC_AM62X=y
> >  BR2_TARGET_TI_K3_IMAGE_GEN=y
> > -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
> >  BR2_TARGET_TI_K3_R5_LOADER=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> > diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> > index 1befeb4ab96c..daf78dbffff8 100644
> > --- a/configs/ti_am64x_sk_defconfig
> > +++ b/configs/ti_am64x_sk_defconfig
> > @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
> >  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
> >  BR2_TARGET_TI_K3=y
> > +BR2_TARGET_TI_K3_SOC_AM64X=y
> >  BR2_TARGET_TI_K3_IMAGE_GEN=y
> > -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
> >  BR2_TARGET_TI_K3_R5_LOADER=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM
  2024-02-19 21:34       ` Romain Naour
@ 2024-02-20  2:00         ` Andreas Dannenberg via buildroot
  0 siblings, 0 replies; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-20  2:00 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Dario Binacchi, Alexander Sverdlin,
	bryce, Anand Gadiyar

On Mon, Feb 19, 2024 at 10:34:52PM +0100, Romain Naour wrote:
> Hello Andreas,
> 
> Le 19/02/2024 à 21:51, Andreas Dannenberg a écrit :
> > On Sat, Feb 17, 2024 at 09:44:29PM +0100, Alexander Sverdlin wrote:
> >> Hi Dario,
> >>
> >> On Sat, 2024-02-17 at 17:02 +0100, Dario Binacchi wrote:
> >>> As explained in [1], adding support for AM62x LP SK in U-Boot, requires
> >>> binman for building bootloader images. The BINMAN_INDIRS environment
> >>> variable is used to provide a space-separated list of directories to
> >>> search for binary blobs.
> >>>
> >>> [1] https://patchwork.ozlabs.org/project/uboot/patch/20231030110138.1347603-3-n-yadav@ti.com/
> >>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >>>
> >>> ---
> >>>
> >>> no changes since v1:
> >>>
> >>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >>> ---
> >>>  boot/uboot/uboot.mk | 3 ++-
> >>>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
> >>> index dda606a88059..cf70f86a4132 100644
> >>> --- a/boot/uboot/uboot.mk
> >>> +++ b/boot/uboot/uboot.mk
> >>> @@ -189,7 +189,8 @@ endif
> >>>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y)
> >>>  UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME))
> >>>  UBOOT_DEPENDENCIES += ti-k3-boot-firmware
> >>> -UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f
> >>> +UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f \
> >>
> >> Is the above actually still required with binman?
> >> The names are hardcoded in U-Boot in arch/arm/dts/k3-am625-sk-binman.dtsi
> >>
> >>> +	BINMAN_INDIRS=$(BINARIES_DIR)
> >>
> >> This seems to be the only required part.
> > 
> > Correct. 'DM=' is no longer used, also see the official U-Boot build
> > instructions for TI platforms in the SDK documentation [1] (technically
> > speaking this documentation is for the U-Boot vendor tree, but the same
> > principle applies to upstream U-Boot builds).
> > 
> > Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
> > 
> > [1] 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
> 
> It means that we can remove BR2_TARGET_UBOOT_NEEDS_TI_K3_DM and
> UBOOT_TI_K3_DM_SOCNAME too.
> 
> meta-ti still use DM= but probably to support u-boot-ti-staging_2023.04 that is
> still available [1].
> 
> The u-boot documentation also contains a similar note [2].

Yes you are right, this option is still available as an override. But
best will be to standardize on the new way of doing things, which is
BINMAN_INDIRS.

> In the end we only need an option to select which SoC type we want to use
> (GP,HS,HS-FS).

Yes. There's one small twist to that, technically for HS devices (a.k.a.
"HS-SE" devices), which is what an HS-FS device turns into _after_ the
fuses are burned with a custom key, the end user will need to provide
their own key for signing the boot image, which will then be used
instead of './board/ti/keys/custMpk.pem' in the U-Boot tree. Let me
think about some more if there isn't a good way that can be done through
Builroot, based on how actual end customers manage their private keys
(which can be very elaborate, even involving HSMs in some cases). It
might be helpful to expose such an override using a config option that
can be used to point to an external key. Anyways just food for thought,
this shouldn't gate anything on Dario's series here.


--
Andreas Dannenberg
Texas Instruments Inc



> 
> [1]
> https://git.yoctoproject.org/meta-ti/tree/meta-ti-bsp/recipes-bsp/u-boot/u-boot-ti.inc?h=cicd.master.202402130100#n52
> 
> [2]
> https://gitlab.com/u-boot/u-boot/-/blob/master/doc/board/ti/k3.rst?ref_type=heads&plain=1#L372
> 
> Best regards,
> Romain
> 
> > 
> > 
> > 
> >>
> >>>  endif
> >>>  
> >>>  ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y)
> >>
> >> -- 
> >> Alexander Sverdlin.
> >>
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-20  1:28     ` Andreas Dannenberg via buildroot
@ 2024-02-20  9:05       ` Dario Binacchi
  2024-02-20  9:32         ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-20  9:05 UTC (permalink / raw)
  To: Andreas Dannenberg, Romain Naour
  Cc: linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, michael, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hi Andreas, Romain, All

On Tue, Feb 20, 2024 at 2:28 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
>
> Romain, Dario,
>
> On Mon, Feb 19, 2024 at 11:28:59AM +0100, Romain Naour wrote:
> > Hello Dario,
> >
> > Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> > > Recent versions of U-Boot can use Binman to compile and sign the generated
> > > binaries, thus making the use of custom tools like ti-k3-image-gen no
> > > longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> > > configured and used outside of it. This patch allows setting such options
> > > even if the package is not enabled.
> >
> > I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
> > kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.
>
> There were discussions/suggestions around this before by Yann E Morin
> [1] and Thomas Petazzoni [2]. I think the gist of it was to move the
> selection to a new package like BR2_PACKAGE_TI_K3_PLATFORM containing
> all the K3 SoC specific selections. And then other packages and Kconfig
> menues can depend on it more cleanly. Like it's currently done with
> package/freescale-imx/Config.in.  This would also bring some consistency
> in how those NXP and TI device families are managed, which will make for
> a better end-user experience I think.

If I'm not mistaken, I think the patches:
[18/20] boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
[17/20] boot: move ti-k3-* packages to 'ti-k3' directory
Are heading in the direction of what we find in
package/freescale-imx/, with the only difference being
that in our case, we're under boot.
So, can I consider these two patches correct?

Thanks and regards,
Dario

>
>
>
> --
> Andreas Dannenberg
> Texas Instruments Inc
>
> [1] http://lists.busybox.net/pipermail/buildroot/2023-June/669342.html
> [2] http://lists.busybox.net/pipermail/buildroot/2023-August/673292.html
>
>
> >
> > Best regards,
> > Romain
> >
> >
> > >
> > > ---
> > >
> > > Added in v4
> > >
> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > > ---
> > >  boot/ti-k3/Config.in                          | 46 ++++++++++++++
> > >  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
> > >  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
> > >  boot/uboot/Config.in                          |  7 +--
> > >  configs/ti_am62x_sk_defconfig                 |  2 +-
> > >  configs/ti_am64x_sk_defconfig                 |  2 +-
> > >  6 files changed, 59 insertions(+), 67 deletions(-)
> > >
> > > diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> > > index 06dda2f156a9..9e508326c9c8 100644
> > > --- a/boot/ti-k3/Config.in
> > > +++ b/boot/ti-k3/Config.in
> > > @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
> > >
> > >  if BR2_TARGET_TI_K3
> > >
> > > +choice
> > > +   prompt "SoC family"
> > > +
> > > +config BR2_TARGET_TI_K3_SOC_AM62AX
> > > +   bool "am62ax"
> > > +
> > > +config BR2_TARGET_TI_K3_SOC_AM62X
> > > +   bool "am62x"
> > > +
> > > +config BR2_TARGET_TI_K3_SOC_AM64X
> > > +   bool "am64x"
> > > +
> > > +config BR2_TARGET_TI_K3_SOC_AM65X
> > > +   bool "am65x"
> > > +
> > > +endchoice
> > > +
> > > +choice
> > > +   prompt "Security type"
> > > +   help
> > > +     The target SoC security type option.
> > > +
> > > +config BR2_TARGET_TI_K3_SECTYPE_GP
> > > +   bool "gp"
> > > +
> > > +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> > > +   bool "hs-fs"
> > > +
> > > +config BR2_TARGET_TI_K3_SECTYPE_HS
> > > +   bool "hs"
> > > +
> > > +endchoice
> > > +
> > > +config BR2_TARGET_TI_K3_SOC
> > > +   string
> > > +   default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> > > +   default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> > > +   default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> > > +   default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> > > +
> > > +config BR2_TARGET_TI_K3_SECTYPE
> > > +   string
> > > +   default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> > > +   default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> > > +   default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> > > +
> > >  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
> > >  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
> > >  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> > > diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> > > index 38d1598d9fc0..2d53d62dd4ee 100644
> > > --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> > > +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> > > @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> > >     bool "ti-k3-image-gen"
> > >     depends on BR2_TARGET_TI_K3_R5_LOADER
> > >     select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> > > -   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > > +   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
> > >     # We need FIT support in uboot-tools, which is why we select a
> > >     # host package
> > >     select BR2_PACKAGE_HOST_UBOOT_TOOLS
> > > @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> > >       https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> > >
> > >  if BR2_TARGET_TI_K3_IMAGE_GEN
> > > -choice
> > > -   prompt "SoC family"
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > > -   bool "am62ax"
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > > -   bool "am62x"
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > > -   bool "am64x"
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > > -   bool "am65x"
> > > -
> > > -endchoice
> > > -
> > > -choice
> > > -   prompt "Security type"
> > > -   help
> > > -     The target SoC security type option for image gen.  Valid
> > > -     options are "gp" for General Purpose devices, "hs-fs" for
> > > -     High Security - Field Securable devices, or "hs" for High
> > > -     Security - Security Enforcing devices.  Note for all High
> > > -     Security device variants the TI_SECURE_DEV_PKG environmental
> > > -     variable must be defined at build time pointing to a valid
> > > -     core-secdev-k3 folder location, otherwise the build will
> > > -     fail, see
> > > -     https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> > > -   bool "gp"
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> > > -   bool "hs-fs"
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > > -   bool "hs"
> > > -
> > > -endchoice
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> > > -   string
> > > -   default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > > -   default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > > -   default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > > -   default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > >
> > >  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
> > >     string
> > > -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > > -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > > -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> > > -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> > > -
> > > -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> > > -   string
> > > -   default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> > > -   default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> > > -   default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> > > +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> > > +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> > > +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> > > +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
> > >
> > >  endif
> > > diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > > index 74b4fcb4bf89..834d8f7d5cd5 100644
> > > --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > > +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> > > @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
> > >     $(BR2_MAKE_HOST_DEPENDENCY)
> > >
> > >  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> > > -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> > > -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> > > +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> > > +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> > >
> > > -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> > > +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
> > >  TI_K3_IMAGE_GEN_SYSFW = \
> > >     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> > >  else
> > > diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> > > index beafb38930db..1a9d21e7c6d1 100644
> > > --- a/boot/uboot/Config.in
> > > +++ b/boot/uboot/Config.in
> > > @@ -244,8 +244,7 @@ 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
> > > +   depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
> > >     help
> > >       Some TI K3 devices need the Device Manager (DM) firmware to
> > >       be available for the U-Boot build.
> > > @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> > >
> > >  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
> > >     string
> > > -   default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> > > -   default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> > > +   default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> > > +   default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
> > >
> > >  endif
> > >
> > > diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> > > index cd26235342e4..cfefce0a77a4 100644
> > > --- a/configs/ti_am62x_sk_defconfig
> > > +++ b/configs/ti_am62x_sk_defconfig
> > > @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> > >  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> > >  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
> > >  BR2_TARGET_TI_K3=y
> > > +BR2_TARGET_TI_K3_SOC_AM62X=y
> > >  BR2_TARGET_TI_K3_IMAGE_GEN=y
> > > -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
> > >  BR2_TARGET_TI_K3_R5_LOADER=y
> > >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> > >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> > > diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> > > index 1befeb4ab96c..daf78dbffff8 100644
> > > --- a/configs/ti_am64x_sk_defconfig
> > > +++ b/configs/ti_am64x_sk_defconfig
> > > @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> > >  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
> > >  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
> > >  BR2_TARGET_TI_K3=y
> > > +BR2_TARGET_TI_K3_SOC_AM64X=y
> > >  BR2_TARGET_TI_K3_IMAGE_GEN=y
> > > -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
> > >  BR2_TARGET_TI_K3_R5_LOADER=y
> > >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> > >  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
> >



-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-20  9:05       ` Dario Binacchi
@ 2024-02-20  9:32         ` Romain Naour
  2024-02-20 20:32           ` Andreas Dannenberg via buildroot
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-20  9:32 UTC (permalink / raw)
  To: Dario Binacchi, Andreas Dannenberg
  Cc: linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, michael, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hi Dario,

Le 20/02/2024 à 10:05, Dario Binacchi a écrit :
> Hi Andreas, Romain, All
> 
> On Tue, Feb 20, 2024 at 2:28 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
>>
>> Romain, Dario,
>>
>> On Mon, Feb 19, 2024 at 11:28:59AM +0100, Romain Naour wrote:
>>> Hello Dario,
>>>
>>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
>>>> Recent versions of U-Boot can use Binman to compile and sign the generated
>>>> binaries, thus making the use of custom tools like ti-k3-image-gen no
>>>> longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
>>>> configured and used outside of it. This patch allows setting such options
>>>> even if the package is not enabled.
>>>
>>> I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
>>> kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.
>>
>> There were discussions/suggestions around this before by Yann E Morin
>> [1] and Thomas Petazzoni [2]. I think the gist of it was to move the
>> selection to a new package like BR2_PACKAGE_TI_K3_PLATFORM containing
>> all the K3 SoC specific selections. And then other packages and Kconfig
>> menues can depend on it more cleanly. Like it's currently done with
>> package/freescale-imx/Config.in.  This would also bring some consistency
>> in how those NXP and TI device families are managed, which will make for
>> a better end-user experience I think.
> 
> If I'm not mistaken, I think the patches:
> [18/20] boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
> [17/20] boot: move ti-k3-* packages to 'ti-k3' directory
> Are heading in the direction of what we find in
> package/freescale-imx/, with the only difference being
> that in our case, we're under boot.
> So, can I consider these two patches correct?

Yes, can you try to move ti-k3 to package directory in V5 ?
It would also be used later by the GPU rogue firmwares.

Please add a comment in the commit log that we make an exception to the rule "no
subdirectory in package directory".

Thanks!

Best regards,
Romain


> 
> Thanks and regards,
> Dario
> 
>>
>>
>>
>> --
>> Andreas Dannenberg
>> Texas Instruments Inc
>>
>> [1] http://lists.busybox.net/pipermail/buildroot/2023-June/669342.html
>> [2] http://lists.busybox.net/pipermail/buildroot/2023-August/673292.html
>>
>>
>>>
>>> Best regards,
>>> Romain
>>>
>>>
>>>>
>>>> ---
>>>>
>>>> Added in v4
>>>>
>>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>>> ---
>>>>  boot/ti-k3/Config.in                          | 46 ++++++++++++++
>>>>  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
>>>>  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
>>>>  boot/uboot/Config.in                          |  7 +--
>>>>  configs/ti_am62x_sk_defconfig                 |  2 +-
>>>>  configs/ti_am64x_sk_defconfig                 |  2 +-
>>>>  6 files changed, 59 insertions(+), 67 deletions(-)
>>>>
>>>> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
>>>> index 06dda2f156a9..9e508326c9c8 100644
>>>> --- a/boot/ti-k3/Config.in
>>>> +++ b/boot/ti-k3/Config.in
>>>> @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
>>>>
>>>>  if BR2_TARGET_TI_K3
>>>>
>>>> +choice
>>>> +   prompt "SoC family"
>>>> +
>>>> +config BR2_TARGET_TI_K3_SOC_AM62AX
>>>> +   bool "am62ax"
>>>> +
>>>> +config BR2_TARGET_TI_K3_SOC_AM62X
>>>> +   bool "am62x"
>>>> +
>>>> +config BR2_TARGET_TI_K3_SOC_AM64X
>>>> +   bool "am64x"
>>>> +
>>>> +config BR2_TARGET_TI_K3_SOC_AM65X
>>>> +   bool "am65x"
>>>> +
>>>> +endchoice
>>>> +
>>>> +choice
>>>> +   prompt "Security type"
>>>> +   help
>>>> +     The target SoC security type option.
>>>> +
>>>> +config BR2_TARGET_TI_K3_SECTYPE_GP
>>>> +   bool "gp"
>>>> +
>>>> +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
>>>> +   bool "hs-fs"
>>>> +
>>>> +config BR2_TARGET_TI_K3_SECTYPE_HS
>>>> +   bool "hs"
>>>> +
>>>> +endchoice
>>>> +
>>>> +config BR2_TARGET_TI_K3_SOC
>>>> +   string
>>>> +   default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
>>>> +   default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
>>>> +   default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
>>>> +   default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
>>>> +
>>>> +config BR2_TARGET_TI_K3_SECTYPE
>>>> +   string
>>>> +   default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
>>>> +   default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
>>>> +   default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
>>>> +
>>>>  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
>>>>  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
>>>>  source "boot/ti-k3/ti-k3-image-gen/Config.in"
>>>> diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
>>>> index 38d1598d9fc0..2d53d62dd4ee 100644
>>>> --- a/boot/ti-k3/ti-k3-image-gen/Config.in
>>>> +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
>>>> @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>>>>     bool "ti-k3-image-gen"
>>>>     depends on BR2_TARGET_TI_K3_R5_LOADER
>>>>     select BR2_TARGET_TI_K3_BOOT_FIRMWARE
>>>> -   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>>>> +   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
>>>>     # We need FIT support in uboot-tools, which is why we select a
>>>>     # host package
>>>>     select BR2_PACKAGE_HOST_UBOOT_TOOLS
>>>> @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>>>>       https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
>>>>
>>>>  if BR2_TARGET_TI_K3_IMAGE_GEN
>>>> -choice
>>>> -   prompt "SoC family"
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>> -   bool "am62ax"
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>> -   bool "am62x"
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
>>>> -   bool "am64x"
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>>>> -   bool "am65x"
>>>> -
>>>> -endchoice
>>>> -
>>>> -choice
>>>> -   prompt "Security type"
>>>> -   help
>>>> -     The target SoC security type option for image gen.  Valid
>>>> -     options are "gp" for General Purpose devices, "hs-fs" for
>>>> -     High Security - Field Securable devices, or "hs" for High
>>>> -     Security - Security Enforcing devices.  Note for all High
>>>> -     Security device variants the TI_SECURE_DEV_PKG environmental
>>>> -     variable must be defined at build time pointing to a valid
>>>> -     core-secdev-k3 folder location, otherwise the build will
>>>> -     fail, see
>>>> -     https://git.ti.com/cgit/security-development-tools/core-secdev-k3
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
>>>> -   bool "gp"
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
>>>> -   bool "hs-fs"
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>>>> -   bool "hs"
>>>> -
>>>> -endchoice
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
>>>> -   string
>>>> -   default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>> -   default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>> -   default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
>>>> -   default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>>>>
>>>>  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
>>>>     string
>>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
>>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>>>> -
>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
>>>> -   string
>>>> -   default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
>>>> -   default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
>>>> -   default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
>>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
>>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
>>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
>>>>
>>>>  endif
>>>> diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>>>> index 74b4fcb4bf89..834d8f7d5cd5 100644
>>>> --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>>>> +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>>>> @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
>>>>     $(BR2_MAKE_HOST_DEPENDENCY)
>>>>
>>>>  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
>>>> -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
>>>> -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
>>>> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
>>>> +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
>>>>
>>>> -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
>>>> +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
>>>>  TI_K3_IMAGE_GEN_SYSFW = \
>>>>     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
>>>>  else
>>>> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
>>>> index beafb38930db..1a9d21e7c6d1 100644
>>>> --- a/boot/uboot/Config.in
>>>> +++ b/boot/uboot/Config.in
>>>> @@ -244,8 +244,7 @@ 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
>>>> +   depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
>>>>     help
>>>>       Some TI K3 devices need the Device Manager (DM) firmware to
>>>>       be available for the U-Boot build.
>>>> @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>>>>
>>>>  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>>>>     string
>>>> -   default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>> -   default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>> +   default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
>>>> +   default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
>>>>
>>>>  endif
>>>>
>>>> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
>>>> index cd26235342e4..cfefce0a77a4 100644
>>>> --- a/configs/ti_am62x_sk_defconfig
>>>> +++ b/configs/ti_am62x_sk_defconfig
>>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>>>>  BR2_TARGET_TI_K3=y
>>>> +BR2_TARGET_TI_K3_SOC_AM62X=y
>>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>>>>  BR2_TARGET_TI_K3_R5_LOADER=y
>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
>>>> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
>>>> index 1befeb4ab96c..daf78dbffff8 100644
>>>> --- a/configs/ti_am64x_sk_defconfig
>>>> +++ b/configs/ti_am64x_sk_defconfig
>>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
>>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
>>>>  BR2_TARGET_TI_K3=y
>>>> +BR2_TARGET_TI_K3_SOC_AM64X=y
>>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>>>>  BR2_TARGET_TI_K3_R5_LOADER=y
>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
>>>
> 
> 
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-20  0:41       ` Andreas Dannenberg via buildroot
@ 2024-02-20 10:03         ` Romain Naour
  2024-02-20 20:04           ` Andreas Dannenberg via buildroot
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-20 10:03 UTC (permalink / raw)
  To: Andreas Dannenberg
  Cc: Dario Binacchi, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot,
	Michael Nazzareno Trimarchi, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hello Andreas,

Le 20/02/2024 à 01:41, Andreas Dannenberg a écrit :
> On Mon, Feb 19, 2024 at 12:24:52PM +0100, Romain Naour wrote:
>> Hello Michael,
>>
>> Le 19/02/2024 à 12:02, Michael Nazzareno Trimarchi a écrit :
>>> Hi Romain
>>>
>>> On Mon, Feb 19, 2024 at 10:30 AM Romain Naour <romain.naour@smile.fr> wrote:
>>>>
>>>> Hello Dario,
>>>>
>>>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
>>>>> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
>>>>> high-security field-securable (HS-FS) silicon to optionally customize keys
>>>>> and encryption for security applications.
>>>>> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
>>>>> which, however, was buggy. This series fixes the errors and bumps the Linux
>>>>> kernel and U-Boot required for such a new device.
>>>>>
>>>>> This series, which in my humble opinion, should have been immediately
>>>>> considered to correct the compilation errors in case of HS-FS devcies, has
>>>>> seen an increase in patches in version 4 to remove the ti-k3-image-gen
>>>>> package thanks to Binman. Additionally, it shares some modifications and
>>>>> views on how to implement certain changes with the series
>>>>> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
>>>>> Therefore, I think it is necessary not to run them in parallel but to decide
>>>>> whether to merge one before the other or to consider a single series where
>>>>> the patches can be coherent with each other. I am available for both solutions.
>>>>> Let me know.
>>>>
>>>> Thanks for this new version. I beleive both series should be merged into one
>>>> since we want to follow u-boot switch to binman, add more TI K3 SoC support and
>>>> keeping exising am62x ans am64x working in GP or HS/HS-FS.
>>>>
>>>
>>> Because the Dario patchset was sent before (end of November), it's
>>> reasonable to review and adjust that one
>>> and apply your changes for ti_j721e_sk on top of it. It think that is
>>> a standard way to make people happy about
>>> their work and contribution.
>>
>> Actually, the two series are about the same topic: TI K3 SoC support (GP, HS,
>> HS-FS) not only AM62x-SK HS-FS devices
>>
>> But due to the complexity of the BSP, the boot flow (4 way to boot!) and the
>> switch from custom tool to binman... this series is really difficult to review
>> without having a good understanding of TI K3 architecture peculiarity and having
>> one of each TI evaluation boards 🙂
> 
> Although I helped conceive some of this and the associated tooling early
> on, some of the what may look strange architectural decisions were driven
> by different use cases and requirements for the different devices
> (especially around automotive fast/early boot, but also security) in
> combination with limited on-chip SRAM... So this where we are at now. A
> future AM6x device variant will have yet another boot flow, but I can
> already say it will be very much simplified over what we have today :)

About existing boot flow, I found two recent commit in u-boot that state that
the "Split binary" (that requires sysfw.itb) is already a legacy boot flow:

arm: dts: k3-binman: Add support for FIT templates

    Add templates for FIT images used extensively across K3 boards with most
    of the code common. This includes the FIT portions of:
    	- tispl.bin
    	- u-boot.img
    	- sysfw.itb (in case of legacy boot flow)

https://gitlab.com/u-boot/u-boot/-/commit/b153bad0f14168d5fcc02ba6bf1a2cd98daba9b5

    arm: dts: k3-*-binman: Move to using templated FITs

    Reduce redundancy in code by using templates to generate the A72 boot
    binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
    (for legacy boot following devices J721E and AM65x).

https://gitlab.com/u-boot/u-boot/-/commit/4509b9ff0b8cb26907f9e9c3571b43565c859275

Which one should be recommended or avoided for a new design?

Best regards,
Romain


> 
>> The series (based on Dario's work) about ti_j721e_sk suggested to remove TI
>> custom tools replaced by binman along with other improvements.
>>
>> I'll way for v5 and rebase the ti_j721e_sk on top of it.
> 
> Thank you Romain for your buy-in. Let's focus on getting Dario's series
> in good shape and then move onto yours. I'd also like to re-introduce
> graphics (I had that working before) but I need to wait for all the
> "baseline" stuff to settle first.
> 
> 
> --
> Andreas Dannenberg
> Texas Instruments Inc
> 
> 
> 
>>
>> Best regards,
>> Romain
>>
>>
>>>
>>> Michael
>>>
>>>> My main concern is to avoid adding a new package for a tool that is already
>>>> deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].
>>>>
>>>> Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".
>>>>
>>>> [1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html
>>>>
>>>> Best regards,
>>>> Romain
>>>>
>>>>>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-20 10:03         ` Romain Naour
@ 2024-02-20 20:04           ` Andreas Dannenberg via buildroot
  2024-02-20 21:36             ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-20 20:04 UTC (permalink / raw)
  To: Romain Naour
  Cc: Dario Binacchi, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot,
	Michael Nazzareno Trimarchi, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hi Romain,

On Tue, Feb 20, 2024 at 11:03:54AM +0100, Romain Naour wrote:
> Hello Andreas,
> 
> Le 20/02/2024 à 01:41, Andreas Dannenberg a écrit :
> > On Mon, Feb 19, 2024 at 12:24:52PM +0100, Romain Naour wrote:
> >> Hello Michael,
> >>
> >> Le 19/02/2024 à 12:02, Michael Nazzareno Trimarchi a écrit :
> >>> Hi Romain
> >>>
> >>> On Mon, Feb 19, 2024 at 10:30 AM Romain Naour <romain.naour@smile.fr> wrote:
> >>>>
> >>>> Hello Dario,
> >>>>
> >>>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> >>>>> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
> >>>>> high-security field-securable (HS-FS) silicon to optionally customize keys
> >>>>> and encryption for security applications.
> >>>>> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
> >>>>> which, however, was buggy. This series fixes the errors and bumps the Linux
> >>>>> kernel and U-Boot required for such a new device.
> >>>>>
> >>>>> This series, which in my humble opinion, should have been immediately
> >>>>> considered to correct the compilation errors in case of HS-FS devcies, has
> >>>>> seen an increase in patches in version 4 to remove the ti-k3-image-gen
> >>>>> package thanks to Binman. Additionally, it shares some modifications and
> >>>>> views on how to implement certain changes with the series
> >>>>> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
> >>>>> Therefore, I think it is necessary not to run them in parallel but to decide
> >>>>> whether to merge one before the other or to consider a single series where
> >>>>> the patches can be coherent with each other. I am available for both solutions.
> >>>>> Let me know.
> >>>>
> >>>> Thanks for this new version. I beleive both series should be merged into one
> >>>> since we want to follow u-boot switch to binman, add more TI K3 SoC support and
> >>>> keeping exising am62x ans am64x working in GP or HS/HS-FS.
> >>>>
> >>>
> >>> Because the Dario patchset was sent before (end of November), it's
> >>> reasonable to review and adjust that one
> >>> and apply your changes for ti_j721e_sk on top of it. It think that is
> >>> a standard way to make people happy about
> >>> their work and contribution.
> >>
> >> Actually, the two series are about the same topic: TI K3 SoC support (GP, HS,
> >> HS-FS) not only AM62x-SK HS-FS devices
> >>
> >> But due to the complexity of the BSP, the boot flow (4 way to boot!) and the
> >> switch from custom tool to binman... this series is really difficult to review
> >> without having a good understanding of TI K3 architecture peculiarity and having
> >> one of each TI evaluation boards 🙂
> > 
> > Although I helped conceive some of this and the associated tooling early
> > on, some of the what may look strange architectural decisions were driven
> > by different use cases and requirements for the different devices
> > (especially around automotive fast/early boot, but also security) in
> > combination with limited on-chip SRAM... So this where we are at now. A
> > future AM6x device variant will have yet another boot flow, but I can
> > already say it will be very much simplified over what we have today :)
> 
> About existing boot flow, I found two recent commit in u-boot that state that
> the "Split binary" (that requires sysfw.itb) is already a legacy boot flow:

It's called "legacy boot flow" because it was the boot flow used on the
first K3 devices that were released (AM65x, J721E). This boot flow was
not used on follow-on devices. The characteristics of this boot flow is
that the initial FW image that gets loaded (tiboot3.bin) doesn't contain
any device firmwares, but only a bootloader (such as U-Boot SPL). Then
this boot loader will load the System Firmware firmware + config data
blob (sysfw.itb) into the dedicated core (called "DMSC" = Device Manager
and Security Controller). And then addiitonal boot stages will be
loaded. These devices require this boot flow, and with this it is
required to be supported by U-Boot (and any Linux distribution or build
systems that build on that).

TI is still making/selling those "legacy boot flow" devices, and will
continue to do so for a very long time. One promiment community
incarnation that you are probably aware of is the BeagleBone AI-64.

> arm: dts: k3-binman: Add support for FIT templates
> 
>     Add templates for FIT images used extensively across K3 boards with most
>     of the code common. This includes the FIT portions of:
>     	- tispl.bin
>     	- u-boot.img
>     	- sysfw.itb (in case of legacy boot flow)
> 
> https://gitlab.com/u-boot/u-boot/-/commit/b153bad0f14168d5fcc02ba6bf1a2cd98daba9b5
> 
>     arm: dts: k3-*-binman: Move to using templated FITs
> 
>     Reduce redundancy in code by using templates to generate the A72 boot
>     binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
>     (for legacy boot following devices J721E and AM65x).
> 
> https://gitlab.com/u-boot/u-boot/-/commit/4509b9ff0b8cb26907f9e9c3571b43565c859275
> 
> Which one should be recommended or avoided for a new design?

Those commits are just a simplification to reduce duplication. As per
earlier comment the "legacy boot flow" is something we continue needing
to support. It isn't supposed to imply that those devices are about to
disappear.

Not sure if this answered your question; please let me know.

--
Andreas Dannenberg
Texas Instruments Inc


> 
> Best regards,
> Romain
> 
> 
> > 
> >> The series (based on Dario's work) about ti_j721e_sk suggested to remove TI
> >> custom tools replaced by binman along with other improvements.
> >>
> >> I'll way for v5 and rebase the ti_j721e_sk on top of it.
> > 
> > Thank you Romain for your buy-in. Let's focus on getting Dario's series
> > in good shape and then move onto yours. I'd also like to re-introduce
> > graphics (I had that working before) but I need to wait for all the
> > "baseline" stuff to settle first.
> > 
> > 
> > --
> > Andreas Dannenberg
> > Texas Instruments Inc
> > 
> > 
> > 
> >>
> >> Best regards,
> >> Romain
> >>
> >>
> >>>
> >>> Michael
> >>>
> >>>> My main concern is to avoid adding a new package for a tool that is already
> >>>> deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].
> >>>>
> >>>> Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".
> >>>>
> >>>> [1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html
> >>>>
> >>>> Best regards,
> >>>> Romain
> >>>>
> >>>>>
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-20  9:32         ` Romain Naour
@ 2024-02-20 20:32           ` Andreas Dannenberg via buildroot
  2024-02-20 22:06             ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-20 20:32 UTC (permalink / raw)
  To: Romain Naour, Dario Binacchi, Thomas Petazzoni
  Cc: linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	buildroot, michael, Alexander Sverdlin, bryce, Anand Gadiyar

Dear Romain, Dario, Thomas:

On Tue, Feb 20, 2024 at 10:32:14AM +0100, Romain Naour wrote:
> Hi Dario,
> 
> Le 20/02/2024 à 10:05, Dario Binacchi a écrit :
> > Hi Andreas, Romain, All
> > 
> > On Tue, Feb 20, 2024 at 2:28 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
> >>
> >> Romain, Dario,
> >>
> >> On Mon, Feb 19, 2024 at 11:28:59AM +0100, Romain Naour wrote:
> >>> Hello Dario,
> >>>
> >>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> >>>> Recent versions of U-Boot can use Binman to compile and sign the generated
> >>>> binaries, thus making the use of custom tools like ti-k3-image-gen no
> >>>> longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> >>>> configured and used outside of it. This patch allows setting such options
> >>>> even if the package is not enabled.
> >>>
> >>> I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
> >>> kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.
> >>
> >> There were discussions/suggestions around this before by Yann E Morin
> >> [1] and Thomas Petazzoni [2]. I think the gist of it was to move the
> >> selection to a new package like BR2_PACKAGE_TI_K3_PLATFORM containing
> >> all the K3 SoC specific selections. And then other packages and Kconfig
> >> menues can depend on it more cleanly. Like it's currently done with
> >> package/freescale-imx/Config.in.  This would also bring some consistency
> >> in how those NXP and TI device families are managed, which will make for
> >> a better end-user experience I think.
> > 
> > If I'm not mistaken, I think the patches:
> > [18/20] boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
> > [17/20] boot: move ti-k3-* packages to 'ti-k3' directory
> > Are heading in the direction of what we find in
> > package/freescale-imx/, with the only difference being
> > that in our case, we're under boot.
> > So, can I consider these two patches correct?

Yes the general direction those are headed is a good...

> Yes, can you try to move ti-k3 to package directory in V5 ?
> It would also be used later by the GPU rogue firmwares.

...and yes, for alignment sake with IMX it would be even better to have
it in package/, while also keeping some alignment with the naming of the
CONFIG options (hence my comment with 'BR2_PACKAGE_TI_K3_PLATFORM').


Hi Thomas,
assuming we create a new package called 'package/ti-k3' I was trying to
figure out what would be the best way to name the associated CONFIG
options that control device security settings and can be used to
determine which device is being used (for later uses in context of GPU
drivers and other device capabilities)?

I see different naming conventions being used, like this:

1) BR2_PACKAGE_*
2) BR2_TARGET_*
3) BR2_BOOT_*

Seems like BR2_TARGET_* what we have now would be most appropriate, but
then the IMX stuff uses BR2_PACKAGE_*, which *seems* to be reserved for
"userspace" (non-boot) packages as far as I can tell from my poor-man's
research. While I'd like to align things, the use of the BR2_PACKAGE_*
prefix may or may not be appropriate for our new additions here?

Just was hoping to get some guidance here so we don't need to re-work
this too many times.


--
Andreas Dannenberg
Texas Instruments Inc



> 
> Please add a comment in the commit log that we make an exception to the rule "no
> subdirectory in package directory".
> 
> Thanks!
> 
> Best regards,
> Romain
> 
> 
> > 
> > Thanks and regards,
> > Dario
> > 
> >>
> >>
> >>
> >> --
> >> Andreas Dannenberg
> >> Texas Instruments Inc
> >>
> >> [1] http://lists.busybox.net/pipermail/buildroot/2023-June/669342.html
> >> [2] http://lists.busybox.net/pipermail/buildroot/2023-August/673292.html
> >>
> >>
> >>>
> >>> Best regards,
> >>> Romain
> >>>
> >>>
> >>>>
> >>>> ---
> >>>>
> >>>> Added in v4
> >>>>
> >>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >>>> ---
> >>>>  boot/ti-k3/Config.in                          | 46 ++++++++++++++
> >>>>  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
> >>>>  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
> >>>>  boot/uboot/Config.in                          |  7 +--
> >>>>  configs/ti_am62x_sk_defconfig                 |  2 +-
> >>>>  configs/ti_am64x_sk_defconfig                 |  2 +-
> >>>>  6 files changed, 59 insertions(+), 67 deletions(-)
> >>>>
> >>>> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> >>>> index 06dda2f156a9..9e508326c9c8 100644
> >>>> --- a/boot/ti-k3/Config.in
> >>>> +++ b/boot/ti-k3/Config.in
> >>>> @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
> >>>>
> >>>>  if BR2_TARGET_TI_K3
> >>>>
> >>>> +choice
> >>>> +   prompt "SoC family"
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SOC_AM62AX
> >>>> +   bool "am62ax"
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SOC_AM62X
> >>>> +   bool "am62x"
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SOC_AM64X
> >>>> +   bool "am64x"
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SOC_AM65X
> >>>> +   bool "am65x"
> >>>> +
> >>>> +endchoice
> >>>> +
> >>>> +choice
> >>>> +   prompt "Security type"
> >>>> +   help
> >>>> +     The target SoC security type option.
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SECTYPE_GP
> >>>> +   bool "gp"
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> >>>> +   bool "hs-fs"
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SECTYPE_HS
> >>>> +   bool "hs"
> >>>> +
> >>>> +endchoice
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SOC
> >>>> +   string
> >>>> +   default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> >>>> +   default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> >>>> +   default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> >>>> +   default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> >>>> +
> >>>> +config BR2_TARGET_TI_K3_SECTYPE
> >>>> +   string
> >>>> +   default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> >>>> +   default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> >>>> +   default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> >>>> +
> >>>>  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
> >>>>  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
> >>>>  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> >>>> diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> >>>> index 38d1598d9fc0..2d53d62dd4ee 100644
> >>>> --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> >>>> +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> >>>> @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >>>>     bool "ti-k3-image-gen"
> >>>>     depends on BR2_TARGET_TI_K3_R5_LOADER
> >>>>     select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> >>>> -   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >>>> +   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
> >>>>     # We need FIT support in uboot-tools, which is why we select a
> >>>>     # host package
> >>>>     select BR2_PACKAGE_HOST_UBOOT_TOOLS
> >>>> @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >>>>       https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> >>>>
> >>>>  if BR2_TARGET_TI_K3_IMAGE_GEN
> >>>> -choice
> >>>> -   prompt "SoC family"
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>> -   bool "am62ax"
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>> -   bool "am62x"
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> >>>> -   bool "am64x"
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >>>> -   bool "am65x"
> >>>> -
> >>>> -endchoice
> >>>> -
> >>>> -choice
> >>>> -   prompt "Security type"
> >>>> -   help
> >>>> -     The target SoC security type option for image gen.  Valid
> >>>> -     options are "gp" for General Purpose devices, "hs-fs" for
> >>>> -     High Security - Field Securable devices, or "hs" for High
> >>>> -     Security - Security Enforcing devices.  Note for all High
> >>>> -     Security device variants the TI_SECURE_DEV_PKG environmental
> >>>> -     variable must be defined at build time pointing to a valid
> >>>> -     core-secdev-k3 folder location, otherwise the build will
> >>>> -     fail, see
> >>>> -     https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> >>>> -   bool "gp"
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> >>>> -   bool "hs-fs"
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >>>> -   bool "hs"
> >>>> -
> >>>> -endchoice
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> >>>> -   string
> >>>> -   default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>> -   default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>> -   default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> >>>> -   default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >>>>
> >>>>  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
> >>>>     string
> >>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> >>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >>>> -
> >>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> >>>> -   string
> >>>> -   default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> >>>> -   default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> >>>> -   default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> >>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> >>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> >>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
> >>>>
> >>>>  endif
> >>>> diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> >>>> index 74b4fcb4bf89..834d8f7d5cd5 100644
> >>>> --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> >>>> +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> >>>> @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
> >>>>     $(BR2_MAKE_HOST_DEPENDENCY)
> >>>>
> >>>>  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> >>>> -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> >>>> -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> >>>> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> >>>> +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> >>>>
> >>>> -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> >>>> +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
> >>>>  TI_K3_IMAGE_GEN_SYSFW = \
> >>>>     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> >>>>  else
> >>>> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> >>>> index beafb38930db..1a9d21e7c6d1 100644
> >>>> --- a/boot/uboot/Config.in
> >>>> +++ b/boot/uboot/Config.in
> >>>> @@ -244,8 +244,7 @@ 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
> >>>> +   depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
> >>>>     help
> >>>>       Some TI K3 devices need the Device Manager (DM) firmware to
> >>>>       be available for the U-Boot build.
> >>>> @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> >>>>
> >>>>  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
> >>>>     string
> >>>> -   default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>> -   default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>> +   default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> >>>> +   default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
> >>>>
> >>>>  endif
> >>>>
> >>>> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> >>>> index cd26235342e4..cfefce0a77a4 100644
> >>>> --- a/configs/ti_am62x_sk_defconfig
> >>>> +++ b/configs/ti_am62x_sk_defconfig
> >>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> >>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
> >>>>  BR2_TARGET_TI_K3=y
> >>>> +BR2_TARGET_TI_K3_SOC_AM62X=y
> >>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> >>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
> >>>>  BR2_TARGET_TI_K3_R5_LOADER=y
> >>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> >>>> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> >>>> index 1befeb4ab96c..daf78dbffff8 100644
> >>>> --- a/configs/ti_am64x_sk_defconfig
> >>>> +++ b/configs/ti_am64x_sk_defconfig
> >>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
> >>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
> >>>>  BR2_TARGET_TI_K3=y
> >>>> +BR2_TARGET_TI_K3_SOC_AM64X=y
> >>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> >>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
> >>>>  BR2_TARGET_TI_K3_R5_LOADER=y
> >>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
> >>>
> > 
> > 
> > 
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-20 20:04           ` Andreas Dannenberg via buildroot
@ 2024-02-20 21:36             ` Romain Naour
  2024-02-23 19:31               ` Andreas Dannenberg via buildroot
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-20 21:36 UTC (permalink / raw)
  To: Andreas Dannenberg
  Cc: Dario Binacchi, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot,
	Michael Nazzareno Trimarchi, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hi Andreas,

Le 20/02/2024 à 21:04, Andreas Dannenberg a écrit :
> Hi Romain,
> 
> On Tue, Feb 20, 2024 at 11:03:54AM +0100, Romain Naour wrote:
>> Hello Andreas,
>>
>> Le 20/02/2024 à 01:41, Andreas Dannenberg a écrit :
>>> On Mon, Feb 19, 2024 at 12:24:52PM +0100, Romain Naour wrote:
>>>> Hello Michael,
>>>>
>>>> Le 19/02/2024 à 12:02, Michael Nazzareno Trimarchi a écrit :
>>>>> Hi Romain
>>>>>
>>>>> On Mon, Feb 19, 2024 at 10:30 AM Romain Naour <romain.naour@smile.fr> wrote:
>>>>>>
>>>>>> Hello Dario,
>>>>>>
>>>>>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
>>>>>>> The SK-AM62B-P1 is the newest version of SK-AM62 which includes
>>>>>>> high-security field-securable (HS-FS) silicon to optionally customize keys
>>>>>>> and encryption for security applications.
>>>>>>> This requires enabling the BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS option,
>>>>>>> which, however, was buggy. This series fixes the errors and bumps the Linux
>>>>>>> kernel and U-Boot required for such a new device.
>>>>>>>
>>>>>>> This series, which in my humble opinion, should have been immediately
>>>>>>> considered to correct the compilation errors in case of HS-FS devcies, has
>>>>>>> seen an increase in patches in version 4 to remove the ti-k3-image-gen
>>>>>>> package thanks to Binman. Additionally, it shares some modifications and
>>>>>>> views on how to implement certain changes with the series
>>>>>>> https://patchwork.ozlabs.org/project/buildroot/list/?series=394840.
>>>>>>> Therefore, I think it is necessary not to run them in parallel but to decide
>>>>>>> whether to merge one before the other or to consider a single series where
>>>>>>> the patches can be coherent with each other. I am available for both solutions.
>>>>>>> Let me know.
>>>>>>
>>>>>> Thanks for this new version. I beleive both series should be merged into one
>>>>>> since we want to follow u-boot switch to binman, add more TI K3 SoC support and
>>>>>> keeping exising am62x ans am64x working in GP or HS/HS-FS.
>>>>>>
>>>>>
>>>>> Because the Dario patchset was sent before (end of November), it's
>>>>> reasonable to review and adjust that one
>>>>> and apply your changes for ti_j721e_sk on top of it. It think that is
>>>>> a standard way to make people happy about
>>>>> their work and contribution.
>>>>
>>>> Actually, the two series are about the same topic: TI K3 SoC support (GP, HS,
>>>> HS-FS) not only AM62x-SK HS-FS devices
>>>>
>>>> But due to the complexity of the BSP, the boot flow (4 way to boot!) and the
>>>> switch from custom tool to binman... this series is really difficult to review
>>>> without having a good understanding of TI K3 architecture peculiarity and having
>>>> one of each TI evaluation boards 🙂
>>>
>>> Although I helped conceive some of this and the associated tooling early
>>> on, some of the what may look strange architectural decisions were driven
>>> by different use cases and requirements for the different devices
>>> (especially around automotive fast/early boot, but also security) in
>>> combination with limited on-chip SRAM... So this where we are at now. A
>>> future AM6x device variant will have yet another boot flow, but I can
>>> already say it will be very much simplified over what we have today :)
>>
>> About existing boot flow, I found two recent commit in u-boot that state that
>> the "Split binary" (that requires sysfw.itb) is already a legacy boot flow:
> 
> It's called "legacy boot flow" because it was the boot flow used on the
> first K3 devices that were released (AM65x, J721E). This boot flow was
> not used on follow-on devices. The characteristics of this boot flow is
> that the initial FW image that gets loaded (tiboot3.bin) doesn't contain
> any device firmwares, but only a bootloader (such as U-Boot SPL). Then
> this boot loader will load the System Firmware firmware + config data
> blob (sysfw.itb) into the dedicated core (called "DMSC" = Device Manager
> and Security Controller). And then addiitonal boot stages will be
> loaded. These devices require this boot flow, and with this it is
> required to be supported by U-Boot (and any Linux distribution or build
> systems that build on that).
> 
> TI is still making/selling those "legacy boot flow" devices, and will
> continue to do so for a very long time. One promiment community
> incarnation that you are probably aware of is the BeagleBone AI-64.

Thank you for the detailed explanation!

I previouly worked on a AM57xx SoC that is nowaday legacy SoC, the latest
ti-kernel 6.1 doesn't support some of the driver that where available in
ti-kernel 5.10 (prueth 100M, RPMsg Sockets over virtio-rpmsg transport (use for
ARM-DSP IPC3.x), TI-RTOS (the csl-common package was also removed from meta-ti)).

Also the TI SDK on this plateform doesn't seems very active [1].

So, I'm worried when I read "legacy" :)

[1]
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1290197/processor-sdk-am57x-legacy-processor-s-linux-update-plan

> 
>> arm: dts: k3-binman: Add support for FIT templates
>>
>>     Add templates for FIT images used extensively across K3 boards with most
>>     of the code common. This includes the FIT portions of:
>>     	- tispl.bin
>>     	- u-boot.img
>>     	- sysfw.itb (in case of legacy boot flow)
>>
>> https://gitlab.com/u-boot/u-boot/-/commit/b153bad0f14168d5fcc02ba6bf1a2cd98daba9b5
>>
>>     arm: dts: k3-*-binman: Move to using templated FITs
>>
>>     Reduce redundancy in code by using templates to generate the A72 boot
>>     binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
>>     (for legacy boot following devices J721E and AM65x).
>>
>> https://gitlab.com/u-boot/u-boot/-/commit/4509b9ff0b8cb26907f9e9c3571b43565c859275
>>
>> Which one should be recommended or avoided for a new design?
> 
> Those commits are just a simplification to reduce duplication. As per
> earlier comment the "legacy boot flow" is something we continue needing
> to support. It isn't supposed to imply that those devices are about to
> disappear.
> 
> Not sure if this answered your question; please let me know.

Yes, thank you.

Best regards,
Romain


> 
> --
> Andreas Dannenberg
> Texas Instruments Inc
> 
> 
>>
>> Best regards,
>> Romain
>>
>>
>>>
>>>> The series (based on Dario's work) about ti_j721e_sk suggested to remove TI
>>>> custom tools replaced by binman along with other improvements.
>>>>
>>>> I'll way for v5 and rebase the ti_j721e_sk on top of it.
>>>
>>> Thank you Romain for your buy-in. Let's focus on getting Dario's series
>>> in good shape and then move onto yours. I'd also like to re-introduce
>>> graphics (I had that working before) but I need to wait for all the
>>> "baseline" stuff to settle first.
>>>
>>>
>>> --
>>> Andreas Dannenberg
>>> Texas Instruments Inc
>>>
>>>
>>>
>>>>
>>>> Best regards,
>>>> Romain
>>>>
>>>>
>>>>>
>>>>> Michael
>>>>>
>>>>>> My main concern is to avoid adding a new package for a tool that is already
>>>>>> deprecated ti-k3-image-gen (not sure if ti-k3-core-secdev is really deprecated) [1].
>>>>>>
>>>>>> Also the topic is not only "AM62x-SK HS-FS devices" but "TI K3 HS-FS devices".
>>>>>>
>>>>>> [1] http://lists.busybox.net/pipermail/buildroot/2024-February/685820.html
>>>>>>
>>>>>> Best regards,
>>>>>> Romain
>>>>>>
>>>>>>>
>>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-20 20:32           ` Andreas Dannenberg via buildroot
@ 2024-02-20 22:06             ` Romain Naour
  2024-02-21 15:48               ` Andreas Dannenberg via buildroot
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-20 22:06 UTC (permalink / raw)
  To: Andreas Dannenberg, Dario Binacchi, Thomas Petazzoni
  Cc: linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	buildroot, michael, Alexander Sverdlin, bryce, Anand Gadiyar

Hi Andreas,

Le 20/02/2024 à 21:32, Andreas Dannenberg a écrit :
> Dear Romain, Dario, Thomas:
> 
> On Tue, Feb 20, 2024 at 10:32:14AM +0100, Romain Naour wrote:
>> Hi Dario,
>>
>> Le 20/02/2024 à 10:05, Dario Binacchi a écrit :
>>> Hi Andreas, Romain, All
>>>
>>> On Tue, Feb 20, 2024 at 2:28 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
>>>>
>>>> Romain, Dario,
>>>>
>>>> On Mon, Feb 19, 2024 at 11:28:59AM +0100, Romain Naour wrote:
>>>>> Hello Dario,
>>>>>
>>>>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
>>>>>> Recent versions of U-Boot can use Binman to compile and sign the generated
>>>>>> binaries, thus making the use of custom tools like ti-k3-image-gen no
>>>>>> longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
>>>>>> configured and used outside of it. This patch allows setting such options
>>>>>> even if the package is not enabled.
>>>>>
>>>>> I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
>>>>> kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.
>>>>
>>>> There were discussions/suggestions around this before by Yann E Morin
>>>> [1] and Thomas Petazzoni [2]. I think the gist of it was to move the
>>>> selection to a new package like BR2_PACKAGE_TI_K3_PLATFORM containing
>>>> all the K3 SoC specific selections. And then other packages and Kconfig
>>>> menues can depend on it more cleanly. Like it's currently done with
>>>> package/freescale-imx/Config.in.  This would also bring some consistency
>>>> in how those NXP and TI device families are managed, which will make for
>>>> a better end-user experience I think.
>>>
>>> If I'm not mistaken, I think the patches:
>>> [18/20] boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
>>> [17/20] boot: move ti-k3-* packages to 'ti-k3' directory
>>> Are heading in the direction of what we find in
>>> package/freescale-imx/, with the only difference being
>>> that in our case, we're under boot.
>>> So, can I consider these two patches correct?
> 
> Yes the general direction those are headed is a good...
> 
>> Yes, can you try to move ti-k3 to package directory in V5 ?
>> It would also be used later by the GPU rogue firmwares.
> 
> ...and yes, for alignment sake with IMX it would be even better to have
> it in package/, while also keeping some alignment with the naming of the
> CONFIG options (hence my comment with 'BR2_PACKAGE_TI_K3_PLATFORM').
> 
> 
> Hi Thomas,
> assuming we create a new package called 'package/ti-k3' I was trying to
> figure out what would be the best way to name the associated CONFIG
> options that control device security settings and can be used to
> determine which device is being used (for later uses in context of GPU
> drivers and other device capabilities)?
> 
> I see different naming conventions being used, like this:
> 
> 1) BR2_PACKAGE_*
> 2) BR2_TARGET_*

Well, it seems we use BR2_TARGET_* for package in boot/ directory instead of
BR2_BOOT_* for "legacy" reason :)

At some point in the history of Buildroot the target/ directory existed and was
used to package bootloaders:

https://gitlab.com/buildroot.org/buildroot/-/commit/d7d57699ef83cce36d87bef73c9e1fbdc765a64c

But BR2_TARGET_* symbol was keep for packages (like grub) when booloaders was
moved to boot/.

> 3) BR2_BOOT_*

So, there is no such BR2_BOOT_* option.

> 
> Seems like BR2_TARGET_* what we have now would be most appropriate, but
> then the IMX stuff uses BR2_PACKAGE_*, which *seems* to be reserved for
> "userspace" (non-boot) packages as far as I can tell from my poor-man's
> research. While I'd like to align things, the use of the BR2_PACKAGE_*
> prefix may or may not be appropriate for our new additions here?

BR2_PACKAGE_* is appropriate here.

We still have BR2_TARGET_* in Buildroot since some Kconfig symbol are really old
and it is not easy to replace them without breaking existing defconfig
(especially the out of tree one).

> 
> Just was hoping to get some guidance here so we don't need to re-work
> this too many times.

It seems ok for me, lets see the upcoming V5 from Dario.

Best regards,
Romain


> 
> 
> --
> Andreas Dannenberg
> Texas Instruments Inc
> 
> 
> 
>>
>> Please add a comment in the commit log that we make an exception to the rule "no
>> subdirectory in package directory".
>>
>> Thanks!
>>
>> Best regards,
>> Romain
>>
>>
>>>
>>> Thanks and regards,
>>> Dario
>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Andreas Dannenberg
>>>> Texas Instruments Inc
>>>>
>>>> [1] http://lists.busybox.net/pipermail/buildroot/2023-June/669342.html
>>>> [2] http://lists.busybox.net/pipermail/buildroot/2023-August/673292.html
>>>>
>>>>
>>>>>
>>>>> Best regards,
>>>>> Romain
>>>>>
>>>>>
>>>>>>
>>>>>> ---
>>>>>>
>>>>>> Added in v4
>>>>>>
>>>>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>>>>> ---
>>>>>>  boot/ti-k3/Config.in                          | 46 ++++++++++++++
>>>>>>  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
>>>>>>  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
>>>>>>  boot/uboot/Config.in                          |  7 +--
>>>>>>  configs/ti_am62x_sk_defconfig                 |  2 +-
>>>>>>  configs/ti_am64x_sk_defconfig                 |  2 +-
>>>>>>  6 files changed, 59 insertions(+), 67 deletions(-)
>>>>>>
>>>>>> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
>>>>>> index 06dda2f156a9..9e508326c9c8 100644
>>>>>> --- a/boot/ti-k3/Config.in
>>>>>> +++ b/boot/ti-k3/Config.in
>>>>>> @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
>>>>>>
>>>>>>  if BR2_TARGET_TI_K3
>>>>>>
>>>>>> +choice
>>>>>> +   prompt "SoC family"
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SOC_AM62AX
>>>>>> +   bool "am62ax"
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SOC_AM62X
>>>>>> +   bool "am62x"
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SOC_AM64X
>>>>>> +   bool "am64x"
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SOC_AM65X
>>>>>> +   bool "am65x"
>>>>>> +
>>>>>> +endchoice
>>>>>> +
>>>>>> +choice
>>>>>> +   prompt "Security type"
>>>>>> +   help
>>>>>> +     The target SoC security type option.
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SECTYPE_GP
>>>>>> +   bool "gp"
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
>>>>>> +   bool "hs-fs"
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SECTYPE_HS
>>>>>> +   bool "hs"
>>>>>> +
>>>>>> +endchoice
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SOC
>>>>>> +   string
>>>>>> +   default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
>>>>>> +   default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
>>>>>> +   default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
>>>>>> +   default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
>>>>>> +
>>>>>> +config BR2_TARGET_TI_K3_SECTYPE
>>>>>> +   string
>>>>>> +   default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
>>>>>> +   default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
>>>>>> +   default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
>>>>>> +
>>>>>>  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
>>>>>>  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
>>>>>>  source "boot/ti-k3/ti-k3-image-gen/Config.in"
>>>>>> diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
>>>>>> index 38d1598d9fc0..2d53d62dd4ee 100644
>>>>>> --- a/boot/ti-k3/ti-k3-image-gen/Config.in
>>>>>> +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
>>>>>> @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>>>>>>     bool "ti-k3-image-gen"
>>>>>>     depends on BR2_TARGET_TI_K3_R5_LOADER
>>>>>>     select BR2_TARGET_TI_K3_BOOT_FIRMWARE
>>>>>> -   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>>>>>> +   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
>>>>>>     # We need FIT support in uboot-tools, which is why we select a
>>>>>>     # host package
>>>>>>     select BR2_PACKAGE_HOST_UBOOT_TOOLS
>>>>>> @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
>>>>>>       https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
>>>>>>
>>>>>>  if BR2_TARGET_TI_K3_IMAGE_GEN
>>>>>> -choice
>>>>>> -   prompt "SoC family"
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>>>> -   bool "am62ax"
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>>>> -   bool "am62x"
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
>>>>>> -   bool "am64x"
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>>>>>> -   bool "am65x"
>>>>>> -
>>>>>> -endchoice
>>>>>> -
>>>>>> -choice
>>>>>> -   prompt "Security type"
>>>>>> -   help
>>>>>> -     The target SoC security type option for image gen.  Valid
>>>>>> -     options are "gp" for General Purpose devices, "hs-fs" for
>>>>>> -     High Security - Field Securable devices, or "hs" for High
>>>>>> -     Security - Security Enforcing devices.  Note for all High
>>>>>> -     Security device variants the TI_SECURE_DEV_PKG environmental
>>>>>> -     variable must be defined at build time pointing to a valid
>>>>>> -     core-secdev-k3 folder location, otherwise the build will
>>>>>> -     fail, see
>>>>>> -     https://git.ti.com/cgit/security-development-tools/core-secdev-k3
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
>>>>>> -   bool "gp"
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
>>>>>> -   bool "hs-fs"
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>>>>>> -   bool "hs"
>>>>>> -
>>>>>> -endchoice
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
>>>>>> -   string
>>>>>> -   default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>>>> -   default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>>>> -   default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
>>>>>> -   default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>>>>>>
>>>>>>  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
>>>>>>     string
>>>>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
>>>>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
>>>>>> -
>>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
>>>>>> -   string
>>>>>> -   default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
>>>>>> -   default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
>>>>>> -   default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
>>>>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
>>>>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
>>>>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
>>>>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
>>>>>>
>>>>>>  endif
>>>>>> diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>>>>>> index 74b4fcb4bf89..834d8f7d5cd5 100644
>>>>>> --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>>>>>> +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
>>>>>> @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
>>>>>>     $(BR2_MAKE_HOST_DEPENDENCY)
>>>>>>
>>>>>>  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
>>>>>> -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
>>>>>> -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
>>>>>> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
>>>>>> +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
>>>>>>
>>>>>> -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
>>>>>> +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
>>>>>>  TI_K3_IMAGE_GEN_SYSFW = \
>>>>>>     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
>>>>>>  else
>>>>>> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
>>>>>> index beafb38930db..1a9d21e7c6d1 100644
>>>>>> --- a/boot/uboot/Config.in
>>>>>> +++ b/boot/uboot/Config.in
>>>>>> @@ -244,8 +244,7 @@ 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
>>>>>> +   depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
>>>>>>     help
>>>>>>       Some TI K3 devices need the Device Manager (DM) firmware to
>>>>>>       be available for the U-Boot build.
>>>>>> @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
>>>>>>
>>>>>>  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
>>>>>>     string
>>>>>> -   default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
>>>>>> -   default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
>>>>>> +   default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
>>>>>> +   default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
>>>>>>
>>>>>>  endif
>>>>>>
>>>>>> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
>>>>>> index cd26235342e4..cfefce0a77a4 100644
>>>>>> --- a/configs/ti_am62x_sk_defconfig
>>>>>> +++ b/configs/ti_am62x_sk_defconfig
>>>>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
>>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
>>>>>>  BR2_TARGET_TI_K3=y
>>>>>> +BR2_TARGET_TI_K3_SOC_AM62X=y
>>>>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>>>>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
>>>>>>  BR2_TARGET_TI_K3_R5_LOADER=y
>>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
>>>>>> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
>>>>>> index 1befeb4ab96c..daf78dbffff8 100644
>>>>>> --- a/configs/ti_am64x_sk_defconfig
>>>>>> +++ b/configs/ti_am64x_sk_defconfig
>>>>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
>>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
>>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
>>>>>>  BR2_TARGET_TI_K3=y
>>>>>> +BR2_TARGET_TI_K3_SOC_AM64X=y
>>>>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
>>>>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
>>>>>>  BR2_TARGET_TI_K3_R5_LOADER=y
>>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
>>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
>>>>>
>>>
>>>
>>>
>>

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-17 16:02 ` [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin Dario Binacchi
  2024-02-17 17:28   ` Alexander Sverdlin
@ 2024-02-20 22:34   ` Andreas Dannenberg via buildroot
  2024-02-21 20:11     ` Dario Binacchi
  1 sibling, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-20 22:34 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, michael,
	Alexander Sverdlin, bryce, Anand Gadiyar

Hi Dario,

On Sat, Feb 17, 2024 at 05:02:43PM +0100, Dario Binacchi wrote:
> Recent versions of U-Boot are capable of building tiboot3.bin using
> Binman. In this case, let's copy it to the binaries directory.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> 
> ---
> 
> Added in v4
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> index 2a10024aedaa..643298a1e70a 100644
> --- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> +++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> @@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
>  	$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
>  endef
>  
> +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> +
>  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
>  	cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> +	find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
>  endef

I like how this picks/renames the tiboot3.bin corresponding to the
device security type, this way allowing to generate a tailored and
readily bootable image depending on GP, HS-FS, HS device type.

However the find/copy approach may not always work as intended. Consider
the build output of R5 U-Boot SPL for AM64x for example:

$ ll tiboot3-*.bin
-rw-rw-r-- 1 a0797059 a0797059 304431 Feb 20 15:34 tiboot3-am64x-gp-evm.bin
-rw-rw-r-- 1 a0797059 a0797059 532270 Feb 20 15:34 tiboot3-am64x_sr2-hs-evm.bin
-rw-rw-r-- 1 a0797059 a0797059 532270 Feb 20 15:34 tiboot3-am64x_sr2-hs-fs-evm.bin

Note how there's a '_sr2' (Silicon Revision 2.0) in the filename of some
of the boot binaries. I did look at the different K3 devices supported
in U-Boot at the moment, and it looks like currently this will not be an
issue that will manifest itself as the device security type happens to
be unique enough to also pick the right silicon revision. But of course
this doesn't mean it'll always stay like this....

So it might be better to leverage BR2_TARGET_TI_K3_SOC to be more
specific in that find/copy operation and use this to replace the
asterisk in "tiboot3-*". So then somebody can use "am64x" or "am64x_sr2"
for example as BR2_TARGET_TI_K3_SOC, and you would guarantee the right
file gets used to populate the final tiboot3.bin.


--
Andreas Dannenberg
Texas Instruments Inc






>  
>  $(eval $(kconfig-package))
> -- 
> 2.43.0
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-19 10:15   ` Romain Naour
@ 2024-02-21 10:19     ` Dario Binacchi
  2024-02-21 15:29       ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Dario Binacchi @ 2024-02-21 10:19 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Andreas Dannenberg,
	Alexander Sverdlin, bryce, Anand Gadiyar

Hi Romain,

On Mon, Feb 19, 2024 at 11:15 AM Romain Naour <romain.naour@smile.fr> wrote:
>
> Hello Dario,
>
> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> > Recent version of U-Boot use binman to provide a mechanism for building
> > images, from simple SPL + U-Boot combinations, to more complex
> > arrangements with many parts.
> >
> > The patch set the BINMAN_INDIRS environment variable to provide the
> > directory to search for binary blobs and select the packages required by
> > binman.
> >
> > Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >
> > ---
> >
> > Changes in v4:
> > - Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> >
> > Changes in v2:
> > - Change commit message
> > - Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> > - Select packages required by binman if
> >   BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
> >  1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > 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 0ffcb8235f2e..2a10024aedaa 100644
> > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > @@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
> >       host-pkgconf \
> >       $(BR2_MAKE_HOST_DEPENDENCY) \
> >       host-arm-gnu-toolchain \
> > -     host-openssl
> > +     host-openssl \
> > +     host-python-attrs \
> > +     host-python-jsonschema \
> > +     host-python-jsonschema-specifications \
> > +     host-python-pyyaml \
> > +     host-python-referencing \
> > +     host-python-rpds-py
>
> Most of theses new dependencies are not ti-k3-r5-loader dependencies but
> host-python-jsonschema runtime dependencies.

I removed the runtime dependencies and tried to modify the patch based
on your indications and your patch
(http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/),
but I'm encountering compilation errors specifically on the Python
modules that you indicated as runtime
dependencies. I tried to compile ti_am62x_sk_defconfig on your series
(i. e. "Add ti_j721e_sk_defconfig"),
but it seems like the HSFS option has disappeared.
So I need to add the runtime dependencies as well to compile correctly.

Thanks and regards,
Dario

>
> Note: host-python-jsonschema depends on
> BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS due to its runtime dependency on
> host-python-rpds-py.
>
> >
> >  TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
> >  TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
> > @@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
> >       $(BR2_BISON_HOST_DEPENDENCY) \
> >       $(BR2_FLEX_HOST_DEPENDENCY)
> >
> > +ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
>
> It's a u-boot package config option. just add host-python-pylibfdt the dependency.
>
> > +TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
> > +endif
> > +
> >  ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
> >  TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
> >  else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
> > @@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
> >       CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
> >       ARCH=arm \
> >       HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
> > +     BINMAN_INDIRS=$(BINARIES_DIR) \
>
> I suggested to add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN but indeed we should
> use binman unconditionally for ti-k3-r5-loader package.
>
> http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/
>
> Best regards,
> Romain
>
>
> >       HOSTLDFLAGS="$(HOST_LDFLAGS)"
> >
> >  define TI_K3_R5_LOADER_BUILD_CMDS
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-21 10:19     ` Dario Binacchi
@ 2024-02-21 15:29       ` Romain Naour
  2024-02-21 20:09         ` Dario Binacchi
  0 siblings, 1 reply; 84+ messages in thread
From: Romain Naour @ 2024-02-21 15:29 UTC (permalink / raw)
  To: Dario Binacchi
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Andreas Dannenberg,
	Alexander Sverdlin, bryce, Anand Gadiyar

Hello Dario,

Le 21/02/2024 à 11:19, Dario Binacchi a écrit :
> Hi Romain,
> 
> On Mon, Feb 19, 2024 at 11:15 AM Romain Naour <romain.naour@smile.fr> wrote:
>>
>> Hello Dario,
>>
>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
>>> Recent version of U-Boot use binman to provide a mechanism for building
>>> images, from simple SPL + U-Boot combinations, to more complex
>>> arrangements with many parts.
>>>
>>> The patch set the BINMAN_INDIRS environment variable to provide the
>>> directory to search for binary blobs and select the packages required by
>>> binman.
>>>
>>> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
>>> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>>
>>> ---
>>>
>>> Changes in v4:
>>> - Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
>>>
>>> Changes in v2:
>>> - Change commit message
>>> - Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
>>> - Select packages required by binman if
>>>   BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled
>>>
>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
>>> ---
>>>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
>>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>>
>>> 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 0ffcb8235f2e..2a10024aedaa 100644
>>> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
>>> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
>>> @@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
>>>       host-pkgconf \
>>>       $(BR2_MAKE_HOST_DEPENDENCY) \
>>>       host-arm-gnu-toolchain \
>>> -     host-openssl
>>> +     host-openssl \
>>> +     host-python-attrs \
>>> +     host-python-jsonschema \
>>> +     host-python-jsonschema-specifications \
>>> +     host-python-pyyaml \
>>> +     host-python-referencing \
>>> +     host-python-rpds-py
>>
>> Most of theses new dependencies are not ti-k3-r5-loader dependencies but
>> host-python-jsonschema runtime dependencies.
> 
> I removed the runtime dependencies and tried to modify the patch based
> on your indications and your patch
> (http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/),
> but I'm encountering compilation errors specifically on the Python
> modules that you indicated as runtime
> dependencies.

What's the issue?

Make sure to take host-python changes from my series, some of them was updated
with their own runtime dependencies:

For example:
http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-7-romain.naour@smile.fr/

 I tried to compile ti_am62x_sk_defconfig on your series
> (i. e. "Add ti_j721e_sk_defconfig"),
> but it seems like the HSFS option has disappeared.

Indeed, this is something we need to improve.

> So I need to add the runtime dependencies as well to compile correctly.

Can you try with only patch 4/21 (package/python-attrs: add host variant) to
patch 10/21 (boot/ti-k3-r5-loader: add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN
option).

Maybe update the last patch 10/21 since it was suggested to remove
BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option to make binman use mandatory for
ti-k3-r5-loader package.

Best regards,
Romain

> 
> Thanks and regards,
> Dario
> 
>>
>> Note: host-python-jsonschema depends on
>> BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS due to its runtime dependency on
>> host-python-rpds-py.
>>
>>>
>>>  TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
>>>  TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
>>> @@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
>>>       $(BR2_BISON_HOST_DEPENDENCY) \
>>>       $(BR2_FLEX_HOST_DEPENDENCY)
>>>
>>> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
>>
>> It's a u-boot package config option. just add host-python-pylibfdt the dependency.
>>
>>> +TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
>>> +endif
>>> +
>>>  ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
>>>  TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
>>>  else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
>>> @@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
>>>       CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
>>>       ARCH=arm \
>>>       HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
>>> +     BINMAN_INDIRS=$(BINARIES_DIR) \
>>
>> I suggested to add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN but indeed we should
>> use binman unconditionally for ti-k3-r5-loader package.
>>
>> http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/
>>
>> Best regards,
>> Romain
>>
>>
>>>       HOSTLDFLAGS="$(HOST_LDFLAGS)"
>>>
>>>  define TI_K3_R5_LOADER_BUILD_CMDS
>>
> 
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope
  2024-02-20 22:06             ` Romain Naour
@ 2024-02-21 15:48               ` Andreas Dannenberg via buildroot
  0 siblings, 0 replies; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-21 15:48 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Dario Binacchi, Alexander Sverdlin,
	bryce, Anand Gadiyar

On Tue, Feb 20, 2024 at 11:06:26PM +0100, Romain Naour wrote:
> Hi Andreas,
> 
> Le 20/02/2024 à 21:32, Andreas Dannenberg a écrit :
> > Dear Romain, Dario, Thomas:
> > 
> > On Tue, Feb 20, 2024 at 10:32:14AM +0100, Romain Naour wrote:
> >> Hi Dario,
> >>
> >> Le 20/02/2024 à 10:05, Dario Binacchi a écrit :
> >>> Hi Andreas, Romain, All
> >>>
> >>> On Tue, Feb 20, 2024 at 2:28 AM Andreas Dannenberg <dannenberg@ti.com> wrote:
> >>>>
> >>>> Romain, Dario,
> >>>>
> >>>> On Mon, Feb 19, 2024 at 11:28:59AM +0100, Romain Naour wrote:
> >>>>> Hello Dario,
> >>>>>
> >>>>> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> >>>>>> Recent versions of U-Boot can use Binman to compile and sign the generated
> >>>>>> binaries, thus making the use of custom tools like ti-k3-image-gen no
> >>>>>> longer necessary. In ti-k3-image-gen, options such as SECTYPE and SOC were
> >>>>>> configured and used outside of it. This patch allows setting such options
> >>>>>> even if the package is not enabled.
> >>>>>
> >>>>> I'm agree that Buildroot doesn't provide any "Platform selection" as the Linux
> >>>>> kernel and I'm not sure where those TI_K3_{SECTYPE,SOC} should belong.
> >>>>
> >>>> There were discussions/suggestions around this before by Yann E Morin
> >>>> [1] and Thomas Petazzoni [2]. I think the gist of it was to move the
> >>>> selection to a new package like BR2_PACKAGE_TI_K3_PLATFORM containing
> >>>> all the K3 SoC specific selections. And then other packages and Kconfig
> >>>> menues can depend on it more cleanly. Like it's currently done with
> >>>> package/freescale-imx/Config.in.  This would also bring some consistency
> >>>> in how those NXP and TI device families are managed, which will make for
> >>>> a better end-user experience I think.
> >>>
> >>> If I'm not mistaken, I think the patches:
> >>> [18/20] boot/ti-k3: move TI_K3_{SECTYPE,SOC} out of the image-gen scope
> >>> [17/20] boot: move ti-k3-* packages to 'ti-k3' directory
> >>> Are heading in the direction of what we find in
> >>> package/freescale-imx/, with the only difference being
> >>> that in our case, we're under boot.
> >>> So, can I consider these two patches correct?
> > 
> > Yes the general direction those are headed is a good...
> > 
> >> Yes, can you try to move ti-k3 to package directory in V5 ?
> >> It would also be used later by the GPU rogue firmwares.
> > 
> > ...and yes, for alignment sake with IMX it would be even better to have
> > it in package/, while also keeping some alignment with the naming of the
> > CONFIG options (hence my comment with 'BR2_PACKAGE_TI_K3_PLATFORM').
> > 
> > 
> > Hi Thomas,
> > assuming we create a new package called 'package/ti-k3' I was trying to
> > figure out what would be the best way to name the associated CONFIG
> > options that control device security settings and can be used to
> > determine which device is being used (for later uses in context of GPU
> > drivers and other device capabilities)?
> > 
> > I see different naming conventions being used, like this:
> > 
> > 1) BR2_PACKAGE_*
> > 2) BR2_TARGET_*
> 
> Well, it seems we use BR2_TARGET_* for package in boot/ directory instead of
> BR2_BOOT_* for "legacy" reason :)
> 
> At some point in the history of Buildroot the target/ directory existed and was
> used to package bootloaders:
> 
> https://gitlab.com/buildroot.org/buildroot/-/commit/d7d57699ef83cce36d87bef73c9e1fbdc765a64c
> 
> But BR2_TARGET_* symbol was keep for packages (like grub) when booloaders was
> moved to boot/.
> 
> > 3) BR2_BOOT_*
> 
> So, there is no such BR2_BOOT_* option.
> 

Ok, thanks for the additional historic context.

> > 
> > Seems like BR2_TARGET_* what we have now would be most appropriate, but
> > then the IMX stuff uses BR2_PACKAGE_*, which *seems* to be reserved for
> > "userspace" (non-boot) packages as far as I can tell from my poor-man's
> > research. While I'd like to align things, the use of the BR2_PACKAGE_*
> > prefix may or may not be appropriate for our new additions here?
> 
> BR2_PACKAGE_* is appropriate here.
> 
> We still have BR2_TARGET_* in Buildroot since some Kconfig symbol are really old
> and it is not easy to replace them without breaking existing defconfig
> (especially the out of tree one).

Understood & glad we are discussing this.

--
Andreas Dannenberg
Texas Instruments Inc


> 
> > 
> > Just was hoping to get some guidance here so we don't need to re-work
> > this too many times.
> 
> It seems ok for me, lets see the upcoming V5 from Dario.
> 
> Best regards,
> Romain
> 
> 
> > 
> > 
> > --
> > Andreas Dannenberg
> > Texas Instruments Inc
> > 
> > 
> > 
> >>
> >> Please add a comment in the commit log that we make an exception to the rule "no
> >> subdirectory in package directory".
> >>
> >> Thanks!
> >>
> >> Best regards,
> >> Romain
> >>
> >>
> >>>
> >>> Thanks and regards,
> >>> Dario
> >>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Andreas Dannenberg
> >>>> Texas Instruments Inc
> >>>>
> >>>> [1] http://lists.busybox.net/pipermail/buildroot/2023-June/669342.html
> >>>> [2] http://lists.busybox.net/pipermail/buildroot/2023-August/673292.html
> >>>>
> >>>>
> >>>>>
> >>>>> Best regards,
> >>>>> Romain
> >>>>>
> >>>>>
> >>>>>>
> >>>>>> ---
> >>>>>>
> >>>>>> Added in v4
> >>>>>>
> >>>>>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >>>>>> ---
> >>>>>>  boot/ti-k3/Config.in                          | 46 ++++++++++++++
> >>>>>>  boot/ti-k3/ti-k3-image-gen/Config.in          | 63 ++-----------------
> >>>>>>  boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk |  6 +-
> >>>>>>  boot/uboot/Config.in                          |  7 +--
> >>>>>>  configs/ti_am62x_sk_defconfig                 |  2 +-
> >>>>>>  configs/ti_am64x_sk_defconfig                 |  2 +-
> >>>>>>  6 files changed, 59 insertions(+), 67 deletions(-)
> >>>>>>
> >>>>>> diff --git a/boot/ti-k3/Config.in b/boot/ti-k3/Config.in
> >>>>>> index 06dda2f156a9..9e508326c9c8 100644
> >>>>>> --- a/boot/ti-k3/Config.in
> >>>>>> +++ b/boot/ti-k3/Config.in
> >>>>>> @@ -5,6 +5,52 @@ config BR2_TARGET_TI_K3
> >>>>>>
> >>>>>>  if BR2_TARGET_TI_K3
> >>>>>>
> >>>>>> +choice
> >>>>>> +   prompt "SoC family"
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SOC_AM62AX
> >>>>>> +   bool "am62ax"
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SOC_AM62X
> >>>>>> +   bool "am62x"
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SOC_AM64X
> >>>>>> +   bool "am64x"
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SOC_AM65X
> >>>>>> +   bool "am65x"
> >>>>>> +
> >>>>>> +endchoice
> >>>>>> +
> >>>>>> +choice
> >>>>>> +   prompt "Security type"
> >>>>>> +   help
> >>>>>> +     The target SoC security type option.
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SECTYPE_GP
> >>>>>> +   bool "gp"
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SECTYPE_HS_FS
> >>>>>> +   bool "hs-fs"
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SECTYPE_HS
> >>>>>> +   bool "hs"
> >>>>>> +
> >>>>>> +endchoice
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SOC
> >>>>>> +   string
> >>>>>> +   default "am62ax" if BR2_TARGET_TI_K3_SOC_AM62AX
> >>>>>> +   default "am62x"  if BR2_TARGET_TI_K3_SOC_AM62X
> >>>>>> +   default "am64x"  if BR2_TARGET_TI_K3_SOC_AM64X
> >>>>>> +   default "am65x"  if BR2_TARGET_TI_K3_SOC_AM65X
> >>>>>> +
> >>>>>> +config BR2_TARGET_TI_K3_SECTYPE
> >>>>>> +   string
> >>>>>> +   default "gp"    if BR2_TARGET_TI_K3_SECTYPE_GP
> >>>>>> +   default "hs-fs" if BR2_TARGET_TI_K3_SECTYPE_HS_FS
> >>>>>> +   default "hs"    if BR2_TARGET_TI_K3_SECTYPE_HS
> >>>>>> +
> >>>>>>  source "boot/ti-k3/ti-k3-boot-firmware/Config.in"
> >>>>>>  source "boot/ti-k3/ti-k3-core-secdev/Config.in"
> >>>>>>  source "boot/ti-k3/ti-k3-image-gen/Config.in"
> >>>>>> diff --git a/boot/ti-k3/ti-k3-image-gen/Config.in b/boot/ti-k3/ti-k3-image-gen/Config.in
> >>>>>> index 38d1598d9fc0..2d53d62dd4ee 100644
> >>>>>> --- a/boot/ti-k3/ti-k3-image-gen/Config.in
> >>>>>> +++ b/boot/ti-k3/ti-k3-image-gen/Config.in
> >>>>>> @@ -2,7 +2,7 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >>>>>>     bool "ti-k3-image-gen"
> >>>>>>     depends on BR2_TARGET_TI_K3_R5_LOADER
> >>>>>>     select BR2_TARGET_TI_K3_BOOT_FIRMWARE
> >>>>>> -   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS || BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >>>>>> +   select BR2_TARGET_TI_K3_CORE_SECDEV if BR2_TARGET_TI_K3_SECTYPE_HS_FS || BR2_TARGET_TI_K3_SECTYPE_HS
> >>>>>>     # We need FIT support in uboot-tools, which is why we select a
> >>>>>>     # host package
> >>>>>>     select BR2_PACKAGE_HOST_UBOOT_TOOLS
> >>>>>> @@ -14,65 +14,12 @@ config BR2_TARGET_TI_K3_IMAGE_GEN
> >>>>>>       https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
> >>>>>>
> >>>>>>  if BR2_TARGET_TI_K3_IMAGE_GEN
> >>>>>> -choice
> >>>>>> -   prompt "SoC family"
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>>>> -   bool "am62ax"
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>>>> -   bool "am62x"
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> >>>>>> -   bool "am64x"
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >>>>>> -   bool "am65x"
> >>>>>> -
> >>>>>> -endchoice
> >>>>>> -
> >>>>>> -choice
> >>>>>> -   prompt "Security type"
> >>>>>> -   help
> >>>>>> -     The target SoC security type option for image gen.  Valid
> >>>>>> -     options are "gp" for General Purpose devices, "hs-fs" for
> >>>>>> -     High Security - Field Securable devices, or "hs" for High
> >>>>>> -     Security - Security Enforcing devices.  Note for all High
> >>>>>> -     Security device variants the TI_SECURE_DEV_PKG environmental
> >>>>>> -     variable must be defined at build time pointing to a valid
> >>>>>> -     core-secdev-k3 folder location, otherwise the build will
> >>>>>> -     fail, see
> >>>>>> -     https://git.ti.com/cgit/security-development-tools/core-secdev-k3
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> >>>>>> -   bool "gp"
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> >>>>>> -   bool "hs-fs"
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >>>>>> -   bool "hs"
> >>>>>> -
> >>>>>> -endchoice
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
> >>>>>> -   string
> >>>>>> -   default "am62ax" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>>>> -   default "am62x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>>>> -   default "am64x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> >>>>>> -   default "am65x"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >>>>>>
> >>>>>>  config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE
> >>>>>>     string
> >>>>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>>>> -   default "ti-fs"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X
> >>>>>> -   default "ti-sci" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM65X
> >>>>>> -
> >>>>>> -config BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE
> >>>>>> -   string
> >>>>>> -   default "gp"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP
> >>>>>> -   default "hs-fs" if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS_FS
> >>>>>> -   default "hs"    if BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_HS
> >>>>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62AX
> >>>>>> +   default "ti-fs"  if BR2_TARGET_TI_K3_SOC_AM62X
> >>>>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM64X
> >>>>>> +   default "ti-sci" if BR2_TARGET_TI_K3_SOC_AM65X
> >>>>>>
> >>>>>>  endif
> >>>>>> diff --git a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> >>>>>> index 74b4fcb4bf89..834d8f7d5cd5 100644
> >>>>>> --- a/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> >>>>>> +++ b/boot/ti-k3/ti-k3-image-gen/ti-k3-image-gen.mk
> >>>>>> @@ -26,10 +26,10 @@ TI_K3_IMAGE_GEN_DEPENDENCIES = \
> >>>>>>     $(BR2_MAKE_HOST_DEPENDENCY)
> >>>>>>
> >>>>>>  TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE))
> >>>>>> -TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
> >>>>>> -TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE))
> >>>>>> +TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_SOC))
> >>>>>> +TI_K3_IMAGE_GEN_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> >>>>>>
> >>>>>> -ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_SECTYPE_GP),y)
> >>>>>> +ifeq ($(BR2_TARGET_TI_K3_SECTYPE_GP),y)
> >>>>>>  TI_K3_IMAGE_GEN_SYSFW = \
> >>>>>>     $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SECTYPE).bin
> >>>>>>  else
> >>>>>> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> >>>>>> index beafb38930db..1a9d21e7c6d1 100644
> >>>>>> --- a/boot/uboot/Config.in
> >>>>>> +++ b/boot/uboot/Config.in
> >>>>>> @@ -244,8 +244,7 @@ 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
> >>>>>> +   depends on BR2_TARGET_TI_K3_SOC_AM62AX || BR2_TARGET_TI_K3_SOC_AM62X
> >>>>>>     help
> >>>>>>       Some TI K3 devices need the Device Manager (DM) firmware to
> >>>>>>       be available for the U-Boot build.
> >>>>>> @@ -254,8 +253,8 @@ if BR2_TARGET_UBOOT_NEEDS_TI_K3_DM
> >>>>>>
> >>>>>>  config BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME
> >>>>>>     string
> >>>>>> -   default "am62axx" if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62AX
> >>>>>> -   default "am62xx"  if BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X
> >>>>>> +   default "am62axx" if BR2_TARGET_TI_K3_SOC_AM62AX
> >>>>>> +   default "am62xx"  if BR2_TARGET_TI_K3_SOC_AM62X
> >>>>>>
> >>>>>>  endif
> >>>>>>
> >>>>>> diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
> >>>>>> index cd26235342e4..cfefce0a77a4 100644
> >>>>>> --- a/configs/ti_am62x_sk_defconfig
> >>>>>> +++ b/configs/ti_am62x_sk_defconfig
> >>>>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am62x"
> >>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am62x"
> >>>>>>  BR2_TARGET_TI_K3=y
> >>>>>> +BR2_TARGET_TI_K3_SOC_AM62X=y
> >>>>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> >>>>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM62X=y
> >>>>>>  BR2_TARGET_TI_K3_R5_LOADER=y
> >>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2024.01"
> >>>>>> diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
> >>>>>> index 1befeb4ab96c..daf78dbffff8 100644
> >>>>>> --- a/configs/ti_am64x_sk_defconfig
> >>>>>> +++ b/configs/ti_am64x_sk_defconfig
> >>>>>> @@ -24,8 +24,8 @@ BR2_TARGET_OPTEE_OS=y
> >>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM="k3-am64x"
> >>>>>>  BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR="am64x"
> >>>>>>  BR2_TARGET_TI_K3=y
> >>>>>> +BR2_TARGET_TI_K3_SOC_AM64X=y
> >>>>>>  BR2_TARGET_TI_K3_IMAGE_GEN=y
> >>>>>> -BR2_TARGET_TI_K3_IMAGE_GEN_SOC_AM64X=y
> >>>>>>  BR2_TARGET_TI_K3_R5_LOADER=y
> >>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION=y
> >>>>>>  BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE="2022.10"
> >>>>>
> >>>
> >>>
> >>>
> >>
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment
  2024-02-21 15:29       ` Romain Naour
@ 2024-02-21 20:09         ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-21 20:09 UTC (permalink / raw)
  To: Romain Naour
  Cc: michael, linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Andreas Dannenberg,
	Alexander Sverdlin, bryce, Anand Gadiyar

Hello Romain,

On Wed, Feb 21, 2024 at 4:29 PM Romain Naour <romain.naour@smile.fr> wrote:
>
> Hello Dario,
>
> Le 21/02/2024 à 11:19, Dario Binacchi a écrit :
> > Hi Romain,
> >
> > On Mon, Feb 19, 2024 at 11:15 AM Romain Naour <romain.naour@smile.fr> wrote:
> >>
> >> Hello Dario,
> >>
> >> Le 17/02/2024 à 17:02, Dario Binacchi a écrit :
> >>> Recent version of U-Boot use binman to provide a mechanism for building
> >>> images, from simple SPL + U-Boot combinations, to more complex
> >>> arrangements with many parts.
> >>>
> >>> The patch set the BINMAN_INDIRS environment variable to provide the
> >>> directory to search for binary blobs and select the packages required by
> >>> binman.
> >>>
> >>> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
> >>> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> >>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >>>
> >>> ---
> >>>
> >>> Changes in v4:
> >>> - Drop the BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> >>>
> >>> Changes in v2:
> >>> - Change commit message
> >>> - Add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option
> >>> - Select packages required by binman if
> >>>   BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN is enabled
> >>>
> >>> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >>> ---
> >>>  boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 13 ++++++++++++-
> >>>  1 file changed, 12 insertions(+), 1 deletion(-)
> >>>
> >>> 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 0ffcb8235f2e..2a10024aedaa 100644
> >>> --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> >>> +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
> >>> @@ -39,7 +39,13 @@ TI_K3_R5_LOADER_DEPENDENCIES = \
> >>>       host-pkgconf \
> >>>       $(BR2_MAKE_HOST_DEPENDENCY) \
> >>>       host-arm-gnu-toolchain \
> >>> -     host-openssl
> >>> +     host-openssl \
> >>> +     host-python-attrs \
> >>> +     host-python-jsonschema \
> >>> +     host-python-jsonschema-specifications \
> >>> +     host-python-pyyaml \
> >>> +     host-python-referencing \
> >>> +     host-python-rpds-py
> >>
> >> Most of theses new dependencies are not ti-k3-r5-loader dependencies but
> >> host-python-jsonschema runtime dependencies.
> >
> > I removed the runtime dependencies and tried to modify the patch based
> > on your indications and your patch
> > (http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/),
> > but I'm encountering compilation errors specifically on the Python
> > modules that you indicated as runtime
> > dependencies.
>
> What's the issue?
>
> Make sure to take host-python changes from my series, some of them was updated
> with their own runtime dependencies:

The problem was this. I hadn't noticed the changes you had applied to
my patches.
I'm doing the final tests, I'll submit v5 as soon as possible.

Many thanks!
Regards,
Dario

>
> For example:
> http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-7-romain.naour@smile.fr/
>
>  I tried to compile ti_am62x_sk_defconfig on your series
> > (i. e. "Add ti_j721e_sk_defconfig"),
> > but it seems like the HSFS option has disappeared.
>
> Indeed, this is something we need to improve.
>
> > So I need to add the runtime dependencies as well to compile correctly.
>
> Can you try with only patch 4/21 (package/python-attrs: add host variant) to
> patch 10/21 (boot/ti-k3-r5-loader: add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN
> option).
>
> Maybe update the last patch 10/21 since it was suggested to remove
> BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN option to make binman use mandatory for
> ti-k3-r5-loader package.
>
> Best regards,
> Romain
>
> >
> > Thanks and regards,
> > Dario
> >
> >>
> >> Note: host-python-jsonschema depends on
> >> BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS due to its runtime dependency on
> >> host-python-rpds-py.
> >>
> >>>
> >>>  TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
> >>>  TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
> >>> @@ -49,6 +55,10 @@ TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
> >>>       $(BR2_BISON_HOST_DEPENDENCY) \
> >>>       $(BR2_FLEX_HOST_DEPENDENCY)
> >>>
> >>> +ifeq ($(BR2_TARGET_UBOOT_NEEDS_PYLIBFDT),y)
> >>
> >> It's a u-boot package config option. just add host-python-pylibfdt the dependency.
> >>
> >>> +TI_K3_R5_LOADER_DEPENDENCIES += host-python-pylibfdt
> >>> +endif
> >>> +
> >>>  ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
> >>>  TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
> >>>  else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
> >>> @@ -58,6 +68,7 @@ TI_K3_R5_LOADER_MAKE_OPTS = \
> >>>       CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
> >>>       ARCH=arm \
> >>>       HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
> >>> +     BINMAN_INDIRS=$(BINARIES_DIR) \
> >>
> >> I suggested to add BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN but indeed we should
> >> use binman unconditionally for ti-k3-r5-loader package.
> >>
> >> http://patchwork.ozlabs.org/project/buildroot/patch/20240213172817.2872849-11-romain.naour@smile.fr/
> >>
> >> Best regards,
> >> Romain
> >>
> >>
> >>>       HOSTLDFLAGS="$(HOST_LDFLAGS)"
> >>>
> >>>  define TI_K3_R5_LOADER_BUILD_CMDS
> >>
> >
> >
>


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin
  2024-02-20 22:34   ` Andreas Dannenberg via buildroot
@ 2024-02-21 20:11     ` Dario Binacchi
  0 siblings, 0 replies; 84+ messages in thread
From: Dario Binacchi @ 2024-02-21 20:11 UTC (permalink / raw)
  To: Andreas Dannenberg
  Cc: linux-amarula, Asaf Kahlon, Xuanhao Shi, James Hilliard,
	Thomas Petazzoni, buildroot, Romain Naour, michael,
	Alexander Sverdlin, bryce, Anand Gadiyar

Hi Andreas,

On Tue, Feb 20, 2024 at 11:34 PM Andreas Dannenberg <dannenberg@ti.com> wrote:
>
> Hi Dario,
>
> On Sat, Feb 17, 2024 at 05:02:43PM +0100, Dario Binacchi wrote:
> > Recent versions of U-Boot are capable of building tiboot3.bin using
> > Binman. In this case, let's copy it to the binaries directory.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> >
> > ---
> >
> > Added in v4
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >  boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > index 2a10024aedaa..643298a1e70a 100644
> > --- a/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > +++ b/boot/ti-k3/ti-k3-r5-loader/ti-k3-r5-loader.mk
> > @@ -75,8 +75,11 @@ define TI_K3_R5_LOADER_BUILD_CMDS
> >       $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
> >  endef
> >
> > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_TARGET_TI_K3_SECTYPE))
> > +
> >  define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS
> >       cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin
> > +     find $(@D) -name "tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin" -type f -exec cp {} $(BINARIES_DIR)/tiboot3.bin \;
> >  endef
>
> I like how this picks/renames the tiboot3.bin corresponding to the
> device security type, this way allowing to generate a tailored and
> readily bootable image depending on GP, HS-FS, HS device type.
>
> However the find/copy approach may not always work as intended. Consider
> the build output of R5 U-Boot SPL for AM64x for example:
>
> $ ll tiboot3-*.bin
> -rw-rw-r-- 1 a0797059 a0797059 304431 Feb 20 15:34 tiboot3-am64x-gp-evm.bin
> -rw-rw-r-- 1 a0797059 a0797059 532270 Feb 20 15:34 tiboot3-am64x_sr2-hs-evm.bin
> -rw-rw-r-- 1 a0797059 a0797059 532270 Feb 20 15:34 tiboot3-am64x_sr2-hs-fs-evm.bin
>
> Note how there's a '_sr2' (Silicon Revision 2.0) in the filename of some
> of the boot binaries. I did look at the different K3 devices supported
> in U-Boot at the moment, and it looks like currently this will not be an
> issue that will manifest itself as the device security type happens to
> be unique enough to also pick the right silicon revision. But of course
> this doesn't mean it'll always stay like this....
>
> So it might be better to leverage BR2_TARGET_TI_K3_SOC to be more
> specific in that find/copy operation and use this to replace the
> asterisk in "tiboot3-*". So then somebody can use "am64x" or "am64x_sr2"
> for example as BR2_TARGET_TI_K3_SOC, and you would guarantee the right
> file gets used to populate the final tiboot3.bin.

Thanks for the suggestion!
I will add it to v5.

Thanks and regards,
Dario

>
>
> --
> Andreas Dannenberg
> Texas Instruments Inc
>
>
>
>
>
>
> >
> >  $(eval $(kconfig-package))
> > --
> > 2.43.0
> >



-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-20 21:36             ` Romain Naour
@ 2024-02-23 19:31               ` Andreas Dannenberg via buildroot
  2024-02-25 16:58                 ` Romain Naour
  0 siblings, 1 reply; 84+ messages in thread
From: Andreas Dannenberg via buildroot @ 2024-02-23 19:31 UTC (permalink / raw)
  To: Romain Naour
  Cc: Dario Binacchi, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot,
	Michael Nazzareno Trimarchi, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hi Romain,

On Tue, Feb 20, 2024 at 10:36:51PM +0100, Romain Naour wrote:

<snip>

> >> About existing boot flow, I found two recent commit in u-boot that state that
> >> the "Split binary" (that requires sysfw.itb) is already a legacy boot flow:
> > 
> > It's called "legacy boot flow" because it was the boot flow used on the
> > first K3 devices that were released (AM65x, J721E). This boot flow was
> > not used on follow-on devices. The characteristics of this boot flow is
> > that the initial FW image that gets loaded (tiboot3.bin) doesn't contain
> > any device firmwares, but only a bootloader (such as U-Boot SPL). Then
> > this boot loader will load the System Firmware firmware + config data
> > blob (sysfw.itb) into the dedicated core (called "DMSC" = Device Manager
> > and Security Controller). And then addiitonal boot stages will be
> > loaded. These devices require this boot flow, and with this it is
> > required to be supported by U-Boot (and any Linux distribution or build
> > systems that build on that).
> > 
> > TI is still making/selling those "legacy boot flow" devices, and will
> > continue to do so for a very long time. One promiment community
> > incarnation that you are probably aware of is the BeagleBone AI-64.
> 
> Thank you for the detailed explanation!
> 
> I previouly worked on a AM57xx SoC that is nowaday legacy SoC, the latest
> ti-kernel 6.1 doesn't support some of the driver that where available in
> ti-kernel 5.10 (prueth 100M, RPMsg Sockets over virtio-rpmsg transport (use for
> ARM-DSP IPC3.x), TI-RTOS (the csl-common package was also removed from meta-ti)).
> 
> Also the TI SDK on this plateform doesn't seems very active [1].

since you brought this up I wanted to add some additional context here.
Older devices like AM57xx (AM335x and AM437x fall into the same bucket)
will get what we call "LTS refresh SDKs" every year, rather than
multiple drops per year as we do for the more recent devices. As for
AM57xx specifically that refresh is currently targeted for e/o March
2024 and will be known as "SDK 9.2". There shouldn't be any feature
regressions, and the only "new" thing (in addition to an all-refreshed
SW baseline with 6.1 kernel and 2023.04 U-Boot) will be some Y2K38 issue
fix on Linux. TI will be making and selling those devices for a very
long time to come, and the annual refresh is seen as a good compromise
between keeping things refreshed periodically and up to date while
limiting the amount of repeat work/effort.

--
Andreas Dannenberg
Texas Instruments Inc

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices
  2024-02-23 19:31               ` Andreas Dannenberg via buildroot
@ 2024-02-25 16:58                 ` Romain Naour
  0 siblings, 0 replies; 84+ messages in thread
From: Romain Naour @ 2024-02-25 16:58 UTC (permalink / raw)
  To: Andreas Dannenberg
  Cc: Dario Binacchi, linux-amarula, Asaf Kahlon, Xuanhao Shi,
	James Hilliard, Thomas Petazzoni, buildroot,
	Michael Nazzareno Trimarchi, Alexander Sverdlin, bryce,
	Anand Gadiyar

Hi Andreas,

Le 23/02/2024 à 20:31, Andreas Dannenberg a écrit :
> Hi Romain,
> 
> On Tue, Feb 20, 2024 at 10:36:51PM +0100, Romain Naour wrote:
> 
> <snip>
> 
>>>> About existing boot flow, I found two recent commit in u-boot that state that
>>>> the "Split binary" (that requires sysfw.itb) is already a legacy boot flow:
>>>
>>> It's called "legacy boot flow" because it was the boot flow used on the
>>> first K3 devices that were released (AM65x, J721E). This boot flow was
>>> not used on follow-on devices. The characteristics of this boot flow is
>>> that the initial FW image that gets loaded (tiboot3.bin) doesn't contain
>>> any device firmwares, but only a bootloader (such as U-Boot SPL). Then
>>> this boot loader will load the System Firmware firmware + config data
>>> blob (sysfw.itb) into the dedicated core (called "DMSC" = Device Manager
>>> and Security Controller). And then addiitonal boot stages will be
>>> loaded. These devices require this boot flow, and with this it is
>>> required to be supported by U-Boot (and any Linux distribution or build
>>> systems that build on that).
>>>
>>> TI is still making/selling those "legacy boot flow" devices, and will
>>> continue to do so for a very long time. One promiment community
>>> incarnation that you are probably aware of is the BeagleBone AI-64.
>>
>> Thank you for the detailed explanation!
>>
>> I previouly worked on a AM57xx SoC that is nowaday legacy SoC, the latest
>> ti-kernel 6.1 doesn't support some of the driver that where available in
>> ti-kernel 5.10 (prueth 100M, RPMsg Sockets over virtio-rpmsg transport (use for
>> ARM-DSP IPC3.x), TI-RTOS (the csl-common package was also removed from meta-ti)).
>>
>> Also the TI SDK on this plateform doesn't seems very active [1].
> 
> since you brought this up I wanted to add some additional context here.
> Older devices like AM57xx (AM335x and AM437x fall into the same bucket)
> will get what we call "LTS refresh SDKs" every year, rather than
> multiple drops per year as we do for the more recent devices. As for
> AM57xx specifically that refresh is currently targeted for e/o March
> 2024 and will be known as "SDK 9.2". There shouldn't be any feature
> regressions, and the only "new" thing (in addition to an all-refreshed
> SW baseline with 6.1 kernel and 2023.04 U-Boot) will be some Y2K38 issue
> fix on Linux. TI will be making and selling those devices for a very
> long time to come, and the annual refresh is seen as a good compromise
> between keeping things refreshed periodically and up to date while
> limiting the amount of repeat work/effort.

Ok, thanks for the information.
I'm looking forward this new SDK release.

Best regards,
Romain


> 
> --
> Andreas Dannenberg
> Texas Instruments Inc
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 84+ messages in thread

end of thread, other threads:[~2024-02-25 16:58 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17 16:02 [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 01/20] configs/ti_am62x_sk_defconfig: fix BR2_TARGET_OPTEE_OS_PLATFORM setting Dario Binacchi
2024-02-17 20:06   ` Alexander Sverdlin
2024-02-19  9:36   ` Romain Naour
2024-02-17 16:02 ` [Buildroot] [PATCH v4 02/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
2024-02-17 20:08   ` Alexander Sverdlin
2024-02-17 16:02 ` [Buildroot] [PATCH v4 03/20] configs/ti_am62x_sk_defconfig: explicitly set the ti-k3-r5-loader version Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 04/20] configs/ti_am64x_sk_defconfig: " Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 05/20] boot/ti-k3-r5-loader: bump to version 2024.01 Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 06/20] boot/ti-k3-core-secdev: new package Dario Binacchi
2024-02-17 17:06   ` Alexander Sverdlin
2024-02-18 13:20     ` Dario Binacchi
2024-02-19  9:48   ` Romain Naour
2024-02-19 20:15     ` Andreas Dannenberg via buildroot
2024-02-17 16:02 ` [Buildroot] [PATCH v4 07/20] boot/ti-k3-image-gen: manage HS hardware Dario Binacchi
2024-02-17 23:45   ` Alexander Sverdlin
2024-02-18 14:01     ` Dario Binacchi
2024-02-19 10:42     ` Romain Naour
2024-02-19 10:47       ` Alexander Sverdlin
2024-02-19 20:36     ` Andreas Dannenberg via buildroot
2024-02-19 20:42       ` Alexander Sverdlin
2024-02-19  9:58   ` Romain Naour
2024-02-19 20:19     ` Andreas Dannenberg via buildroot
2024-02-17 16:02 ` [Buildroot] [PATCH v4 08/20] package/python-jsonschema: add host variant Dario Binacchi
2024-02-19 10:03   ` Romain Naour
2024-02-17 16:02 ` [Buildroot] [PATCH v4 09/20] package/python-attrs: " Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 10/20] package/python-referencing: " Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 11/20] package/python-rpds-py: " Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 12/20] package/python-jsonschema-specifications: " Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 13/20] boot/ti-k3-r5-loader: set binman environment Dario Binacchi
2024-02-17 20:38   ` Alexander Sverdlin
2024-02-19 10:40     ` Romain Naour
2024-02-19 10:15   ` Romain Naour
2024-02-21 10:19     ` Dario Binacchi
2024-02-21 15:29       ` Romain Naour
2024-02-21 20:09         ` Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 14/20] boot/uboot: set BINMAN_INDIRS for TI K3 DM Dario Binacchi
2024-02-17 20:44   ` Alexander Sverdlin
2024-02-18 13:55     ` Dario Binacchi
2024-02-19 20:51     ` Andreas Dannenberg via buildroot
2024-02-19 21:34       ` Romain Naour
2024-02-20  2:00         ` Andreas Dannenberg via buildroot
2024-02-19 10:19   ` Romain Naour
2024-02-17 16:02 ` [Buildroot] [PATCH v4 15/20] configs/ti_am62x_sk_defconfig: bump U-Boot version to 2024.01 Dario Binacchi
2024-02-17 20:20   ` Alexander Sverdlin
2024-02-18 13:49     ` Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 16/20] configs/ti_am62x_sk_defconfig: bump Linux version to 6.6.1 Dario Binacchi
2024-02-17 20:27   ` Alexander Sverdlin
2024-02-18 13:50     ` Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 17/20] boot: move ti-k3-* packages to 'ti-k3' directory Dario Binacchi
2024-02-17 21:05   ` François Perrad
2024-02-18 13:59     ` Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 18/20] boot/ti-k3: move TI_K3_{SECTYPE, SOC} out of the image-gen scope Dario Binacchi
2024-02-17 20:33   ` Alexander Sverdlin
2024-02-18 13:52     ` Dario Binacchi
2024-02-19 10:28   ` Romain Naour
2024-02-20  1:28     ` Andreas Dannenberg via buildroot
2024-02-20  9:05       ` Dario Binacchi
2024-02-20  9:32         ` Romain Naour
2024-02-20 20:32           ` Andreas Dannenberg via buildroot
2024-02-20 22:06             ` Romain Naour
2024-02-21 15:48               ` Andreas Dannenberg via buildroot
2024-02-17 16:02 ` [Buildroot] [PATCH v4 19/20] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin Dario Binacchi
2024-02-17 17:28   ` Alexander Sverdlin
2024-02-18 13:30     ` Dario Binacchi
2024-02-18 13:38     ` Dario Binacchi
2024-02-19 10:47       ` Romain Naour
2024-02-20 22:34   ` Andreas Dannenberg via buildroot
2024-02-21 20:11     ` Dario Binacchi
2024-02-17 16:02 ` [Buildroot] [PATCH v4 20/20] configs/ti_am62x_sk_defconfig: don't use ti-k3-image-gen anymore Dario Binacchi
2024-02-19 10:31   ` Romain Naour
2024-02-17 17:40 ` [Buildroot] [PATCH v4 00/20] Add support for AM62x-SK HS-FS devices Alexander Sverdlin
2024-02-19 10:35   ` Romain Naour
2024-02-19 22:42   ` Patrick Oppenlander
2024-02-17 21:14 ` Alexander Sverdlin
2024-02-19  9:30 ` Romain Naour
2024-02-19 11:02   ` Michael Nazzareno Trimarchi
2024-02-19 11:24     ` Romain Naour
2024-02-20  0:41       ` Andreas Dannenberg via buildroot
2024-02-20 10:03         ` Romain Naour
2024-02-20 20:04           ` Andreas Dannenberg via buildroot
2024-02-20 21:36             ` Romain Naour
2024-02-23 19:31               ` Andreas Dannenberg via buildroot
2024-02-25 16:58                 ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.