mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: k3: fix k3img dependencies
@ 2025-12-02 15:58 Sascha Hauer
  2025-12-02 15:58 ` [PATCH 1/4] ARM: K3: am62l: don't put sysfwdata into 1st stage image Sascha Hauer
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sascha Hauer @ 2025-12-02 15:58 UTC (permalink / raw)
  To: BAREBOX

This series fixes a dependency problem in the K3 image generation. The
k3img tool takes several files as input, but only the barebox image is
actually a dependency, so when (only) one of the other files change the
final image is not re-generated.

While at it we can make some input files SoC specific which means we no
longer have to specify them per board, saving one line per board and
file in Makefile.k3

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (4):
      ARM: K3: am62l: don't put sysfwdata into 1st stage image
      ARM: k3: make some firmware files SoC specific
      ARM: k3: am62l: Add dedicated config option for OP-TEE
      ARM: k3: am62l: fix dependencies on k3img input files

 firmware/Kconfig   |  4 ++++
 images/Makefile.k3 | 62 ++++++++++++++++++++++++------------------------------
 2 files changed, 31 insertions(+), 35 deletions(-)
---
base-commit: 8661354d7ef744e01b6f07b1b0114482c5e8f561
change-id: 20251202-k3-deps-eeff63389f70

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

* [PATCH 1/4] ARM: K3: am62l: don't put sysfwdata into 1st stage image
  2025-12-02 15:58 [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
@ 2025-12-02 15:58 ` Sascha Hauer
  2025-12-02 15:58 ` [PATCH 2/4] ARM: k3: make some firmware files SoC specific Sascha Hauer
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2025-12-02 15:58 UTC (permalink / raw)
  To: BAREBOX

SYSFWDATA is not needed for the tiboot3 stage. Drop it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 images/Makefile.k3 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/images/Makefile.k3 b/images/Makefile.k3
index d2b7be7ca017325dfc8700f556c7d17760c8aa1e..27ddb5d0b68ac6411165847f1fab18c38f48dc04 100644
--- a/images/Makefile.k3
+++ b/images/Makefile.k3
@@ -85,7 +85,6 @@ INNERDATA_start_am62lx_evm.pblb.k3_am62lx_img=$(INNERDATA_am62lx)
 KEY_start_am62lx_evm.pblb.k3_am62lx_img=$(KEY_custmpk)
 
 SYSFW_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(SYSFW_am62lx_hs_fs)
-SYSFWDATA_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(SYSFWDATA_am62lx)
 INNERDATA_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(INNERDATA_am62lx)
 TFA_BL1_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(FIRMWARE_DIR)/am62lx-bl1.bin
 KEY_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(KEY_custmpk)
@@ -134,7 +133,6 @@ quiet_cmd_k3_am62lx_tiboot3_image = K3_am62lx_tiboot3_IMG   $@
 		$(srctree)/scripts/k3img					\
 			$(TFA_BL1_$(@F)):1:16:160:70800000			\
 			$(SYSFW_$(@F)):2:0:0:00040000				\
-			$(SYSFWDATA_$(@F)):18:0:0:0006c000			\
 			$(INNERDATA_$(@F)):3:0:0:00000000			\
 			--key "$(KEY_$(@F))"					\
 			--out $@

-- 
2.47.3




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

* [PATCH 2/4] ARM: k3: make some firmware files SoC specific
  2025-12-02 15:58 [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
  2025-12-02 15:58 ` [PATCH 1/4] ARM: K3: am62l: don't put sysfwdata into 1st stage image Sascha Hauer
@ 2025-12-02 15:58 ` Sascha Hauer
  2025-12-02 15:58 ` [PATCH 3/4] ARM: k3: am62l: Add dedicated config option for OP-TEE Sascha Hauer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2025-12-02 15:58 UTC (permalink / raw)
  To: BAREBOX

On AM625 SYSFWDATA and DMDATA are really SoC specific, so drop the
possibility to overwrite them per board.

On AM62L TFA, SYSFW, SYSFWDATA, INNERDATA and the signing key are really
SoC specific, so drop the possibility to overwrite them per board.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 images/Makefile.k3 | 40 +++++++++++-----------------------------
 1 file changed, 11 insertions(+), 29 deletions(-)

diff --git a/images/Makefile.k3 b/images/Makefile.k3
index 27ddb5d0b68ac6411165847f1fab18c38f48dc04..e0f79f1439f1340a09c09d236b5d7470caa4ad77 100644
--- a/images/Makefile.k3
+++ b/images/Makefile.k3
@@ -42,8 +42,6 @@ INNERDATA_am625=$(FIRMWARE_DIR)/ti-linux-firmware/ti-sysfw/ti-fs-firmware-am62x-
 
 ## TI am625(sip)-SK ##
 SYSFW_start_am625_sk_r5.pblb.k3_am62x_img=$(SYSFW_am625_hs_fs)
-SYSFWDATA_start_am625_sk_r5.pblb.k3_am62x_img=$(SYSFWDATA_am625)
-DMDATA_start_am625_sk_r5.pblb.k3_am62x_img=$(DMDATA_am625)
 INNERDATA_start_am625_sk_r5.pblb.k3_am62x_img=$(INNERDATA_am625)
 KEY_start_am625_sk_r5.pblb.k3_am62x_img=$(KEY_custmpk)
 
@@ -52,8 +50,6 @@ FILE_barebox-am625-sk-r5.img = start_am625_sk_r5.pblb.k3_am62x_img
 image-$(CONFIG_MACH_AM625_SK) += barebox-am625-sk-r5.img
 
 SYSFW_start_am625sip_sk_r5.pblb.k3_am62x_img=$(SYSFW_am625_hs_fs)
-SYSFWDATA_start_am625sip_sk_r5.pblb.k3_am62x_img=$(SYSFWDATA_am625)
-DMDATA_start_am625sip_sk_r5.pblb.k3_am62x_img=$(DMDATA_am625)
 INNERDATA_start_am625sip_sk_r5.pblb.k3_am62x_img=$(INNERDATA_am625)
 KEY_start_am625sip_sk_r5.pblb.k3_am62x_img=$(KEY_custmpk)
 
@@ -63,8 +59,6 @@ image-$(CONFIG_MACH_AM625_SK) += barebox-am625sip-sk-r5.img
 
 ## BeaglePlay ##
 SYSFW_start_beagleplay_r5.pblb.k3_am62x_img=$(SYSFW_am625_gp)
-SYSFWDATA_start_beagleplay_r5.pblb.k3_am62x_img=$(SYSFWDATA_am625)
-DMDATA_start_beagleplay_r5.pblb.k3_am62x_img=$(DMDATA_am625)
 KEY_start_beagleplay_r5.pblb.k3_am62x_img=$(KEY_degenerate)
 
 pblb-$(CONFIG_MACH_BEAGLEPLAY) += start_beagleplay_r5
@@ -76,18 +70,10 @@ endif
 SYSFWDATA_am62lx=$(objtree)/arch/arm/mach-k3/combined-sysfw-cfg-am62l.k3cfg
 SYSFW_am62lx_hs_fs=$(FIRMWARE_DIR)/ti-linux-firmware/ti-sysfw/ti-fs-firmware-am62lx-hs-enc.bin
 INNERDATA_am62lx=$(FIRMWARE_DIR)/ti-linux-firmware/ti-sysfw/ti-fs-firmware-am62lx-hs-cert.bin
+TFA_BL31_am62lx=$(FIRMWARE_DIR)/am62lx-bl31.bin
 
 ## TI am62lx-EVM ##
-SYSFW_start_am62lx_evm.pblb.k3_am62lx_img=$(SYSFW_am62lx_hs_fs)
-SYSFWDATA_start_am62lx_evm.pblb.k3_am62lx_img=$(SYSFWDATA_am62lx)
-TFA_start_am62lx_evm.pblb.k3_am62lx_img=$(FIRMWARE_DIR)/am62lx-bl31.bin
-INNERDATA_start_am62lx_evm.pblb.k3_am62lx_img=$(INNERDATA_am62lx)
-KEY_start_am62lx_evm.pblb.k3_am62lx_img=$(KEY_custmpk)
-
-SYSFW_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(SYSFW_am62lx_hs_fs)
-INNERDATA_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(INNERDATA_am62lx)
 TFA_BL1_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(FIRMWARE_DIR)/am62lx-bl1.bin
-KEY_start_am62lx_evm.pblb.k3_am62lx_tiboot3_img=$(KEY_custmpk)
 
 pblb-$(CONFIG_MACH_AM62LX_EVM) += start_am62lx_evm
 FILE_barebox-am62lx-evm.img = start_am62lx_evm.pblb.k3_am62lx_img
@@ -104,37 +90,33 @@ quiet_cmd_k3_am62x_image = K3_am62x_IMG   $@
 		$(srctree)/scripts/k3img					\
 			$<:1:16:0:43c00000					\
 			$(SYSFW_$(@F)):2:0:0:00040000				\
-			$(SYSFWDATA_$(@F)):18:0:0:00067000			\
+			$(SYSFWDATA_am625):18:0:0:00067000			\
 			$$inner							\
-			$(DMDATA_$(@F)):17:16:0:43c3a800			\
+			$(DMDATA_am625):17:16:0:43c3a800			\
 			--key "$(KEY_$(@F))" --out $@
 
 quiet_cmd_k3_am62lx_image = K3_am62lx_IMG   $@
       cmd_k3_am62lx_image = \
-		if [ -n "$(INNERDATA_$(@F))" ]; then				\
-			inner="$(INNERDATA_$(@F)):3:0:0:00000000";		\
-		fi;								\
-										\
 		if [ -e "$(FIRMWARE_DIR)/am62lx-bl32.bin" ]; then		\
 			optee=$(FIRMWARE_DIR)/am62lx-bl32.bin:17:16:0:80200000;	\
 		fi;								\
 										\
 		$(srctree)/scripts/k3img					\
-			$(TFA_$(@F)):1:16:0:80000000				\
-			$(SYSFW_$(@F)):2:0:0:00040000				\
-			$(SYSFWDATA_$(@F)):18:0:0:0006c000			\
-			$$inner							\
+			$(TFA_BL31_am62lx):1:16:0:80000000			\
+			$(SYSFW_am62lx_hs_fs):2:0:0:00040000			\
+			$(SYSFWDATA_am62lx):18:0:0:0006c000			\
+			$(INNERDATA_am62lx):3:0:0:00000000			\
 			$$optee							\
 			$<:17:16:0:82000000					\
-			--key "$(KEY_$(@F))" --out $@
+			--key "$(KEY_custmpk)" --out $@
 
 quiet_cmd_k3_am62lx_tiboot3_image = K3_am62lx_tiboot3_IMG   $@
       cmd_k3_am62lx_tiboot3_image = \
 		$(srctree)/scripts/k3img					\
 			$(TFA_BL1_$(@F)):1:16:160:70800000			\
-			$(SYSFW_$(@F)):2:0:0:00040000				\
-			$(INNERDATA_$(@F)):3:0:0:00000000			\
-			--key "$(KEY_$(@F))"					\
+			$(SYSFW_am62lx_hs_fs):2:0:0:00040000			\
+			$(INNERDATA_am62lx):3:0:0:00000000			\
+			--key "$(KEY_custmpk)"					\
 			--out $@
 
 $(obj)/%.k3_am62x_img: $(obj)/% scripts/k3img FORCE

-- 
2.47.3




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

* [PATCH 3/4] ARM: k3: am62l: Add dedicated config option for OP-TEE
  2025-12-02 15:58 [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
  2025-12-02 15:58 ` [PATCH 1/4] ARM: K3: am62l: don't put sysfwdata into 1st stage image Sascha Hauer
  2025-12-02 15:58 ` [PATCH 2/4] ARM: k3: make some firmware files SoC specific Sascha Hauer
@ 2025-12-02 15:58 ` Sascha Hauer
  2025-12-02 15:58 ` [PATCH 4/4] ARM: k3: am62l: fix dependencies on k3img input files Sascha Hauer
  2025-12-03 11:56 ` [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2025-12-02 15:58 UTC (permalink / raw)
  To: BAREBOX

Until now we compiled in the OP-TEE binary into the AM62l images when it
exists. The when-it-exists part makes it hard to add a dependeny on the
file, so add a dedicated config option for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 firmware/Kconfig   | 4 ++++
 images/Makefile.k3 | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/firmware/Kconfig b/firmware/Kconfig
index a97a1e0dd324fa2ff95a0e77d1057bc45aa1ad07..3aeba3fc35e1142b33489b52a24e5e5532684c8f 100644
--- a/firmware/Kconfig
+++ b/firmware/Kconfig
@@ -116,6 +116,10 @@ config FIRMWARE_LS1028A_ATF
 config FIRMWARE_LS1046A_ATF
 	bool
 
+config FIRMWARE_K3_AM62L_OPTEE
+	bool "install OP-TEE on K3 AM62L boards"
+	depends on MACH_AM62LX
+
 config HAVE_FIRMWARE_VERIFY_NEXT_IMAGE
 	bool
 
diff --git a/images/Makefile.k3 b/images/Makefile.k3
index e0f79f1439f1340a09c09d236b5d7470caa4ad77..caaca1fbc9a1e90921ba873d61c7627d1e8f5e19 100644
--- a/images/Makefile.k3
+++ b/images/Makefile.k3
@@ -95,10 +95,14 @@ quiet_cmd_k3_am62x_image = K3_am62x_IMG   $@
 			$(DMDATA_am625):17:16:0:43c3a800			\
 			--key "$(KEY_$(@F))" --out $@
 
+ifdef CONFIG_FIRMWARE_K3_AM62L_OPTEE
+AM62L_TIBOOT3_OPTEE = $(FIRMWARE_DIR)/am62lx-bl32.bin
+endif
+
 quiet_cmd_k3_am62lx_image = K3_am62lx_IMG   $@
       cmd_k3_am62lx_image = \
-		if [ -e "$(FIRMWARE_DIR)/am62lx-bl32.bin" ]; then		\
-			optee=$(FIRMWARE_DIR)/am62lx-bl32.bin:17:16:0:80200000;	\
+		if [ -n "$(AM62L_TIBOOT3_OPTEE)" ]; then			\
+			optee=$(AM62L_TIBOOT3_OPTEE):17:16:0:80200000;		\
 		fi;								\
 										\
 		$(srctree)/scripts/k3img					\

-- 
2.47.3




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

* [PATCH 4/4] ARM: k3: am62l: fix dependencies on k3img input files
  2025-12-02 15:58 [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
                   ` (2 preceding siblings ...)
  2025-12-02 15:58 ` [PATCH 3/4] ARM: k3: am62l: Add dedicated config option for OP-TEE Sascha Hauer
@ 2025-12-02 15:58 ` Sascha Hauer
  2025-12-03 11:56 ` [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2025-12-02 15:58 UTC (permalink / raw)
  To: BAREBOX

Apart from the barebox image itself the k3img tool has several other
input files. Add proper dependencies on them to make sure the image
is rebuilt when one of the input files changes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 images/Makefile.k3 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/images/Makefile.k3 b/images/Makefile.k3
index caaca1fbc9a1e90921ba873d61c7627d1e8f5e19..789f77722abd4128fa2ed31ca5009da00a25cd61 100644
--- a/images/Makefile.k3
+++ b/images/Makefile.k3
@@ -126,8 +126,16 @@ quiet_cmd_k3_am62lx_tiboot3_image = K3_am62lx_tiboot3_IMG   $@
 $(obj)/%.k3_am62x_img: $(obj)/% scripts/k3img FORCE
 	$(call if_changed,k3_am62x_image)
 
-$(obj)/%.k3_am62lx_img: $(obj)/% scripts/k3img FORCE
+$(obj)/%.k3_am62lx_img: $(obj)/% scripts/k3img FORCE \
+		$(TFA_BL31_am62lx)				\
+		$(INNERDATA_am62lx)				\
+		$(SYSFW_am62lx_hs_fs)				\
+		$(SYSFWDATA_am62lx)				\
+		$(AM62L_TIBOOT3_OPTEE)
 	$(call if_changed,k3_am62lx_image)
 
-$(obj)/%.k3_am62lx_tiboot3_img: $(obj)/% scripts/k3img FORCE
+$(obj)/%.k3_am62lx_tiboot3_img: $(obj)/% scripts/k3img FORCE 	\
+		$(SYSFW_am62lx_hs_fs)				\
+		$$(TFA_BL1_$$(@F))				\
+		$(INNERDATA_am62lx)
 	$(call if_changed,k3_am62lx_tiboot3_image)

-- 
2.47.3




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

* Re: [PATCH 0/4] ARM: k3: fix k3img dependencies
  2025-12-02 15:58 [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
                   ` (3 preceding siblings ...)
  2025-12-02 15:58 ` [PATCH 4/4] ARM: k3: am62l: fix dependencies on k3img input files Sascha Hauer
@ 2025-12-03 11:56 ` Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2025-12-03 11:56 UTC (permalink / raw)
  To: BAREBOX, Sascha Hauer


On Tue, 02 Dec 2025 16:58:24 +0100, Sascha Hauer wrote:
> This series fixes a dependency problem in the K3 image generation. The
> k3img tool takes several files as input, but only the barebox image is
> actually a dependency, so when (only) one of the other files change the
> final image is not re-generated.
> 
> While at it we can make some input files SoC specific which means we no
> longer have to specify them per board, saving one line per board and
> file in Makefile.k3
> 
> [...]

Applied, thanks!

[1/4] ARM: K3: am62l: don't put sysfwdata into 1st stage image
      https://git.pengutronix.de/cgit/barebox/commit/?id=429f52b9f493 (link may not be stable)
[2/4] ARM: k3: make some firmware files SoC specific
      https://git.pengutronix.de/cgit/barebox/commit/?id=e7189c9722ab (link may not be stable)
[3/4] ARM: k3: am62l: Add dedicated config option for OP-TEE
      https://git.pengutronix.de/cgit/barebox/commit/?id=2711c4ca4fdc (link may not be stable)
[4/4] ARM: k3: am62l: fix dependencies on k3img input files
      https://git.pengutronix.de/cgit/barebox/commit/?id=f1739aa759f0 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-12-03 11:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-02 15:58 [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer
2025-12-02 15:58 ` [PATCH 1/4] ARM: K3: am62l: don't put sysfwdata into 1st stage image Sascha Hauer
2025-12-02 15:58 ` [PATCH 2/4] ARM: k3: make some firmware files SoC specific Sascha Hauer
2025-12-02 15:58 ` [PATCH 3/4] ARM: k3: am62l: Add dedicated config option for OP-TEE Sascha Hauer
2025-12-02 15:58 ` [PATCH 4/4] ARM: k3: am62l: fix dependencies on k3img input files Sascha Hauer
2025-12-03 11:56 ` [PATCH 0/4] ARM: k3: fix k3img dependencies Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox