Skip to contentSkip to conversation

arm/trusted-firmware-a: actually add mbedtls to SRC_URI

PATCH In review Ross Burton 2 participants 5 messages Aug 28, 2020 – Aug 31, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 arm/trusted-firmware-a: actually add mbedtls to SRC_URI

From: Ross Burton <[email protected]>

trusted-firmware-a.inc was conditionally adding the Mbed TLS tarball to SRC_URI, but all of the versioned recipes subsequently assigned over the top of it so the Mbed TLS tarball was never actually in SRC_URI. This resulted in machine overrides needing to add the tarball themselves.

Solve by using _append so that the SRC_URI is actually changed.

Change-Id I05cf1dec2c6422a40a42c615fb2b9b6e8d6f1cb0
---
 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +1 -1
index e1cffdf..7845dac 100644
@@ -38,7 +38,7 @@ SRC_URI_MBEDTLS ??= ""
 # This should be set to MBEDTLS LIC FILES checksum
 LIC_FILES_CHKSUM_MBEDTLS ??= ""
 # add MBEDTLS to our sources if activated
-SRC_URI += "${@bb.utils.contains('TFA_MBEDTLS', '1', '${SRC_URI_MBEDTLS}', '', d)}"
+SRC_URI_append = " ${@bb.utils.contains('TFA_MBEDTLS', '1', '${SRC_URI_MBEDTLS}', '', d)}"
 # add mbed TLS chksum
 LIC_FILES_CHKSUM += "${@bb.utils.contains('TFA_MBEDTLS', '1', '${LIC_FILES_CHKSUM_MBEDTLS}', '', d)}"
 # add mbed TLS to version
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/4 arm-bsp/trusted-firmware-a: remove duplicated Mbed TLS tarball

From: Ross Burton <[email protected]>

Now that trusted-firmware-a is actually adding the Mbed TLS tarball, the machine-specific includes can stop doing it themselves.

Change-Id I45754b8a4eba99c8fbf7c99e61d01f2a27da1b4a
---
 .../trusted-firmware-a/trusted-firmware-a-sgi575.inc            | 2 --
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a-tc0.inc   | 2 --
 2 files changed, 4 deletions(-)
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc +0 -2
index 6d04fa3..5020dea 100644
@@ -1,7 +1,5 @@
 # SGI575 specific TFA support
 
-SRC_URI_append = " ${SRC_URI_MBEDTLS}"
-
 COMPATIBLE_MACHINE = "sgi575"
 TFA_PLATFORM       = "sgi575"
 TFA_BUILD_TARGET   = "all fip"
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-tc0.inc +0 -2
index d22108a..6049947 100644
@@ -3,8 +3,6 @@
 # Intermediate SHA with 2.3 baseline version
 SRCREV_tfa = "2fe7d18b0d99fdf4c4dbf84863bb2036dfebc537"
 
-SRC_URI_append = " ${SRC_URI_MBEDTLS}"
-
 DEPENDS += "scp-firmware"
 
 COMPATIBLE_MACHINE = "tc0"
Signature · 1 line
2.28.0
#2 lore raw

PATCH 3/4 arm/trusted-firmware-a: don't build all targets in parallel

In reply to Ross Burton

From: Ross Burton <[email protected]>

There are build races in the Makefiles when you build all targets at once (missing dependencies):

| tools/fiptool/fiptool create [...]
| ERROR: fopen WORKDIR/build/juno/debug/fdts/juno_fw_config.dtb: No such file or directory

These are non-trivial to fix so whilst upstream works on this we can just build each target serially.

Change-Id Iba0d0ae7de6faf199efea073135fd3b7232b81a1
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +4 -1
index 7845dac..8b19d68 100644
@@ -122,7 +122,10 @@ do_compile() {
     sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
     sed -i 's^OPENSSL_DIR.*=.*$^OPENSSL_DIR = ${STAGING_DIR_NATIVE}/${prefix_native}^' ${S}/tools/*/Makefile
 
-    oe_runmake ${TFA_BUILD_TARGET}
+    # Currently there are races if you build all the targets at once in parallel
+    for T in ${TFA_BUILD_TARGET}; do
+        oe_runmake $T
+    done
 }
 do_compile[cleandirs] = "${B}"
 
Signature · 1 line
2.28.0
#3 lore raw

PATCH 4/4 arm-bsp/trusted-firmware-a: remove redundant MBEDTLS_DIR assignment

In reply to Ross Burton

From: Ross Burton <[email protected]>

The base recipe already does this, so there's no need to do it again.

Change-Id I04f679ab267db3bcdbb812dce6be2efc8a25b633
---
 .../trusted-firmware-a/trusted-firmware-a-sgi575.inc            | 2 +-
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a-tc0.inc   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-sgi575.inc +1 -1
index 5020dea..e63be96 100644
@@ -12,5 +12,5 @@ TFA_UBOOT          = "0"
 DEPENDS += "virtual/uefi-firmware"
 
 EXTRA_OEMAKE += "BL33=${RECIPE_SYSROOT}/firmware/uefi.bin"
-EXTRA_OEMAKE += "MBEDTLS_DIR=mbedtls TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
+EXTRA_OEMAKE += "TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
                      ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem"
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a-tc0.inc +1 -1
index 6049947..e2f41f1 100644
@@ -15,5 +15,5 @@ TFA_MBEDTLS = "1"
 TFA_DEBUG = "1"
 
 EXTRA_OEMAKE += "SCP_BL2=${RECIPE_SYSROOT}/firmware/scp_ramfw.bin"
-EXTRA_OEMAKE += "MBEDTLS_DIR=mbedtls TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
+EXTRA_OEMAKE += "TRUSTED_BOARD_BOOT=1 GENERATE_COT=1 ARM_ROTPK_LOCATION=devel_rsa \
                      ROT_KEY=plat/arm/board/common/rotpk/arm_rotprivk_rsa.pem"
Signature · 1 line
2.28.0
#4 lore raw
In reply to Ross Burton
Quoted 11 lines · Ross Burton

From: Ross Burton <[email protected]>

trusted-firmware-a.inc was conditionally adding the Mbed TLS tarball to SRC_URI, but all of the versioned recipes subsequently assigned over the top of it so the Mbed TLS tarball was never actually in SRC_URI. This resulted in machine overrides needing to add the tarball themselves.

Solve by using _append so that the SRC_URI is actually changed.

Change-Id I05cf1dec2c6422a40a42c615fb2b9b6e8d6f1cb0

Series pulled into master.

Thanks,
Jon

Quoted 22 lines
---
 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +1 -1
index e1cffdf..7845dac 100644
@@ -38,7 +38,7 @@ SRC_URI_MBEDTLS ??= ""
 # This should be set to MBEDTLS LIC FILES checksum
 LIC_FILES_CHKSUM_MBEDTLS ??= ""
 # add MBEDTLS to our sources if activated
-SRC_URI += "${@bb.utils.contains('TFA_MBEDTLS', '1', '${SRC_URI_MBEDTLS}', '', d)}"
+SRC_URI_append = " ${@bb.utils.contains('TFA_MBEDTLS', '1', '${SRC_URI_MBEDTLS}', '', d)}"
 # add mbed TLS chksum
 LIC_FILES_CHKSUM += "${@bb.utils.contains('TFA_MBEDTLS', '1', '${LIC_FILES_CHKSUM_MBEDTLS}', '', d)}"
 # add mbed TLS to version
Signature · 1 line
2.28.0