diff mbox series

[master/kirkstone,64/65] trusted-firmware-a: Allow build to continue without TI_SECURE_DEV_PKG set

Message ID 20220913035541.2364351-65-denis@denix.org
State Under Review
Delegated to: Ryan Eatmon
Headers show
Series Latest 2022.09 sync-up with Dunfell #1 | expand

Commit Message

Denys Dmytriyenko Sept. 13, 2022, 3:55 a.m. UTC
From: Andrew Davis <afd@ti.com>

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 .../trusted-firmware-a_%.bbappend             | 38 ++++++++-----------
 1 file changed, 16 insertions(+), 22 deletions(-)
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
index 41241a57..14463846 100644
--- a/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
+++ b/meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -9,42 +9,36 @@  TFA_SPD:k3 = "opteed"
 EXTRA_OEMAKE:append:k3 = "${@ ' K3_USART=' + d.getVar('TFA_K3_USART') if d.getVar('TFA_K3_USART') else ''}"
 EXTRA_OEMAKE:append:k3 = "${@ ' K3_PM_SYSTEM_SUSPEND=' + d.getVar('TFA_K3_SYSTEM_SUSPEND') if d.getVar('TFA_K3_SYSTEM_SUSPEND') else ''}"
 
-do_compile:append:am65xx-hs-evm() {
+# Signing procedure for K3 HS devices
+tfa_sign_k3hs() {
 	export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
 	( cd ${BUILD_DIR}; \
 		mv bl31.bin bl31.bin.unsigned; \
-		${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
+		if [ -f ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ]; then \
+			${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
+		else \
+			echo "Warning: TI_SECURE_DEV_PKG not set, TF-A not signed."; \
+			cp bl31.bin.unsigned bl31.bin; \
+		fi; \
 	)
 }
 
+do_compile:append:am65xx-hs-evm() {
+	tfa_sign_k3hs
+}
+
 do_compile:append:am64xx-hs-evm() {
-	export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
-	( cd ${BUILD_DIR}; \
-		mv bl31.bin bl31.bin.unsigned; \
-		${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
-	)
+	tfa_sign_k3hs
 }
 
 do_compile:append:j721e-hs-evm() {
-	export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
-	( cd ${BUILD_DIR}; \
-		mv bl31.bin bl31.bin.unsigned; \
-		${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
-	)
+	tfa_sign_k3hs
 }
 
 do_compile:append:j7200-hs-evm() {
-	export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
-	( cd ${BUILD_DIR}; \
-		mv bl31.bin bl31.bin.unsigned; \
-		${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
-	)
+	tfa_sign_k3hs
 }
 
 do_compile:append:j721s2-hs-evm() {
-	export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
-	( cd ${B}/${BUILD_DIR}/release/; \
-		mv bl31.bin bl31.bin.unsigned; \
-		${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh bl31.bin.unsigned bl31.bin; \
-	)
+	tfa_sign_k3hs
 }