Skip to contentSkip to conversation

arm/trusted-firmware-a: move patch file to bbappend

PATCH Applied Jon Mason 2 participants 4 messages Dec 5, 2023 – Dec 6, 2023

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/3 arm/trusted-firmware-a: move patch file to bbappend

TF-A is being patched in the recipe for qemuarm64-secureboot. This should be done in the bbappend.

---
 .../trusted-firmware-a/trusted-firmware-a_%.bbappend        | 6 ++++++
 .../trusted-firmware-a/trusted-firmware-a_2.9.0.bb          | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +6 -0
index e58a0902..ca0448f5 100644
@@ -6,6 +6,12 @@ COMPATIBLE_MACHINE:qemuarm-secureboot = "qemuarm-secureboot"
 # arm/aarch32.  This is a known testing hole in TF-A.
 TOOLCHAIN:qemuarm-secureboot = "gcc"
 
+# Enable passing TOS_FW_CONFIG from FIP package to Trusted OS.
+FILESEXTRAPATHS:prepend:qemuarm64-secureboot := "${THISDIR}/files:"
+SRC_URI:append:qemuarm64-secureboot = " \
+            file://0001-Add-spmc_manifest-for-qemu.patch \
+        "
+
 TFA_PLATFORM:qemuarm64-secureboot = "qemu"
 TFA_PLATFORM:qemu-generic-arm64 = "qemu_sbsa"
 TFA_PLATFORM:qemuarm-secureboot = "qemu"
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.9.0.bb +0 -5
index 5e526958..31a6a909 100644
@@ -3,11 +3,6 @@ require trusted-firmware-a.inc
 # TF-A v2.9.0
 SRCREV_tfa = "d3e71ead6ea5bc3555ac90a446efec84ef6c6122"
 
-# Enable passing TOS_FW_CONFIG from FIP package to Trusted OS.
-SRC_URI:append:qemuarm64-secureboot = " \
-            file://0001-Add-spmc_manifest-for-qemu.patch \
-        "
-
 LIC_FILES_CHKSUM += "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde"
 
 # mbedtls-3.4.0
Signature · 1 line
2.30.2
author
#1 lore raw

PATCH 2/3 arm/trusted-firmware-a: update to 2.10

Update tf-a and mbedtls to the latest versions. Also, migrate the previous version to meta-arm-bsp for corstone1000.

NOTE: in v2.10, the fiptool makefile was changed to reference LDOPTS instead of LDLIBS.

NOTE: commit 408cde8a59080ac2caa11c4d99474b2ef09f90df in tf-a modifies the qemu_sbsa starting offset, and per the commit comment, it requires the edk2 same change. This is why the edk-platforms SHA has been changed. There are only 19 patches between the previous SHA and this one (most of which are adding a single platform). So, it shouldn't be too impactful to bump the SHA (instead of making it a patch to apply on top of the existing SHA).

NOTE: tf-a-tests added LDFLAGS to the makefile, causing the need for it to be removed in the recipe.

---
 meta-arm-bsp/conf/machine/n1sdp.conf          |  1 +
 meta-arm-bsp/conf/machine/sgi575.conf         |  1 +
 .../fiptool-native_2.9.0.bb                   |  0
 .../trusted-firmware-a/tf-a-tests_2.9.0.bb    |  0
 .../trusted-firmware-a_2.8.6.bb               |  4 ++
 .../trusted-firmware-a_2.9.0.bb               |  6 +-
 ...ert-usage-of-plat_ic_has_interrupt_t.patch | 38 +++++++++++++
 .../fiptool-native_2.10.0.bb                  | 33 +++++++++++
 .../trusted-firmware-a/tf-a-tests_2.10.0.bb   | 55 +++++++++++++++++++
 .../trusted-firmware-a/trusted-firmware-a.inc |  2 +-
 .../trusted-firmware-a_%.bbappend             |  1 +
 .../trusted-firmware-a_2.10.0.bb              | 12 ++++
 .../recipes-bsp/uefi/edk2-firmware_202308.bb  |  2 +-
 13 files changed, 152 insertions(+), 3 deletions(-)
 rename {meta-arm => meta-arm-bsp}/recipes-bsp/trusted-firmware-a/fiptool-native_2.9.0.bb (100%)
 rename {meta-arm => meta-arm-bsp}/recipes-bsp/trusted-firmware-a/tf-a-tests_2.9.0.bb (100%)
 rename {meta-arm => meta-arm-bsp}/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.9.0.bb (73%)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/0001-bl31_runtime-revert-usage-of-plat_ic_has_interrupt_t.patch
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/fiptool-native_2.10.0.bb
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.10.0.bb
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.0.bb
meta-arm-bsp/conf/machine/n1sdp.conf +1 -0
index 74a0a66f..2a246de0 100644
@@ -27,6 +27,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
 # TF-A
 EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
 TFA_PLATFORM = "n1sdp"
+PREFERRED_VERSION_trusted-firmware-a ?= "2.9.%"
 
 # SCP
 EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
meta-arm-bsp/conf/machine/sgi575.conf +1 -0
index 3c2c94b6..7f2a285a 100644
@@ -9,6 +9,7 @@ require conf/machine/include/arm/armv8-2a/tune-cortexa75.inc
 EXTRA_IMAGEDEPENDS += "virtual/control-processor-firmware"
 
 EXTRA_IMAGEDEPENDS += "trusted-firmware-a"
+PREFERRED_VERSION_trusted-firmware-a ?= "2.9.%"
 
 KERNEL_IMAGETYPE ?= "Image"
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
meta-arm-bsp/recipes-bsp/trusted-firmware-a/fiptool-native_2.9.0.bb renamed from meta-arm/recipes-bsp/trusted-firmware-a/fiptool-native_2.9.0.bb +0 -0
similarity index 100%
rename from meta-arm/recipes-bsp/trusted-firmware-a/fiptool-native_2.9.0.bb
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-a/fiptool-native_2.9.0.bb
meta-arm-bsp/recipes-bsp/trusted-firmware-a/tf-a-tests_2.9.0.bb renamed from meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.9.0.bb +0 -0
similarity index 100%
rename from meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.9.0.bb
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-a/tf-a-tests_2.9.0.bb
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.8.6.bb +4 -0
index cffc6db1..ef7ea598 100644
@@ -13,3 +13,7 @@ SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=ht
 SRCREV_mbedtls = "89f040a5c938985c5f30728baed21e49d0846a53"
 
 LIC_FILES_CHKSUM_MBEDTLS = "file://mbedtls/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+do_compile:prepend() {
+    sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
+}
meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.9.0.bb renamed from meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.9.0.bb +5 -1
similarity index 73%
rename from meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.9.0.bb
rename to meta-arm-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.9.0.bb
index 31a6a909..d9fdf329 100644
@@ -1,4 +1,4 @@
-require trusted-firmware-a.inc
+require recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
 
 # TF-A v2.9.0
 SRCREV_tfa = "d3e71ead6ea5bc3555ac90a446efec84ef6c6122"
@@ -10,3 +10,7 @@ SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=ht
 SRCREV_mbedtls = "1873d3bfc2da771672bd8e7e8f41f57e0af77f33"
 
 LIC_FILES_CHKSUM_MBEDTLS = "file://mbedtls/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+do_compile:prepend() {
+    sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
+}
meta-arm/recipes-bsp/trusted-firmware-a/files/0001-bl31_runtime-revert-usage-of-plat_ic_has_interrupt_t.patch new file +38 -0
new file mode 100644
index 00000000..f6f054df
@@ -0,0 +1,38 @@
+From fd13a4d304da4233cb954329bf287ec9dfbb7367 Mon Sep 17 00:00:00 2001
+From: Jon Mason <[email protected]>
+Date: Mon, 4 Dec 2023 10:20:21 -0500
+Subject: [PATCH] bl31_runtime: revert usage of plat_ic_has_interrupt_type
+
+There is a regression caused by commit
+1f6bb41dd951714b47bf07bb9a332346ca261033 for the trusted services tests.
+This is due to the fact that the referenced commit changes the behavior
+from checking for both INTR_TYPE_EL3 and INTR_TYPE_S_EL1, to referencing
+an existing function that #if for _either_ INTR_TYPE_EL3 or
+INTR_TYPE_S_EL1 (depending on the value of GICV2_G0_FOR_EL3).  To work
+around this issue, revert the check back to its original form.
+
+Signed-off-by: Jon Mason <[email protected]>
+Upstream-Status: Pending
+---
+ bl31/interrupt_mgmt.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bl31/interrupt_mgmt.c b/bl31/interrupt_mgmt.c
+index 68c7f10add21..8e888b676b35 100644
+--- a/bl31/interrupt_mgmt.c
++++ b/bl31/interrupt_mgmt.c
+@@ -47,9 +47,9 @@ static intr_type_desc_t intr_type_descs[MAX_INTR_TYPES];
+  ******************************************************************************/
+ static int32_t validate_interrupt_type(uint32_t type)
+ {
+-	if (plat_ic_has_interrupt_type(type)) {
++	if ((type == INTR_TYPE_S_EL1) || (type == INTR_TYPE_NS) ||
++	    (type == INTR_TYPE_EL3))
+ 		return 0;
+-	}
+ 
+ 	return -EINVAL;
+ }
+-- 
+2.30.2
+
meta-arm/recipes-bsp/trusted-firmware-a/fiptool-native_2.10.0.bb new file +33 -0
new file mode 100644
index 00000000..e45ea9c4
@@ -0,0 +1,33 @@
+# Firmware Image Package (FIP)
+# It is a packaging format used by TF-A to package the
+# firmware images in a single binary.
+
+DESCRIPTION = "fiptool - Trusted Firmware tool for packaging"
+LICENSE = "BSD-3-Clause"
+
+SRC_URI_TRUSTED_FIRMWARE_A ?= "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https"
+SRC_URI = "${SRC_URI_TRUSTED_FIRMWARE_A};destsuffix=fiptool-${PV};branch=${SRCBRANCH}"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde"
+
+# Use fiptool from TF-A v2.10.0
+SRCREV = "b6c0948400594e3cc4dbb5a4ef04b815d2675808"
+SRCBRANCH = "master"
+
+DEPENDS += "openssl-native"
+
+inherit native
+
+EXTRA_OEMAKE = "V=1 HOSTCC='${BUILD_CC}' OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
+
+do_compile () {
+    # This is still needed to have the native fiptool executing properly by
+    # setting the RPATH
+    sed -i '/^LDOPTS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
+    sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
+
+    oe_runmake fiptool
+}
+
+do_install () {
+    install -D -p -m 0755 tools/fiptool/fiptool ${D}${bindir}/fiptool
+}
meta-arm/recipes-bsp/trusted-firmware-a/tf-a-tests_2.10.0.bb new file +55 -0

55 lines not on this page · raw message

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +1 -1
index 2bdf2211..922c0a34 100644
@@ -168,7 +168,7 @@ BUILD_DIR .= "/${@'debug' if d.getVar("TFA_DEBUG") == '1' else 'release'}"
 do_compile() {
     # This is still needed to have the native tools executing properly by
     # setting the RPATH
-    sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
+    sed -i '/^LDOPTS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
     sed -i '/^LIB/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/cert_create/Makefile
 
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +1 -0
index ca0448f5..b3624bb3 100644
@@ -10,6 +10,7 @@ TOOLCHAIN:qemuarm-secureboot = "gcc"
 FILESEXTRAPATHS:prepend:qemuarm64-secureboot := "${THISDIR}/files:"
 SRC_URI:append:qemuarm64-secureboot = " \
             file://0001-Add-spmc_manifest-for-qemu.patch \
+            file://0001-bl31_runtime-revert-usage-of-plat_ic_has_interrupt_t.patch \
         "
 
 TFA_PLATFORM:qemuarm64-secureboot = "qemu"
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.10.0.bb new file +12 -0
new file mode 100644
index 00000000..4f019844
@@ -0,0 +1,12 @@
+require recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
+
+# TF-A v2.10.0
+SRCREV_tfa = "b6c0948400594e3cc4dbb5a4ef04b815d2675808"
+
+LIC_FILES_CHKSUM += "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde"
+
+# mbedtls-3.5.1
+SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls;branch=master"
+SRCREV_mbedtls = "edb8fec9882084344a314368ac7fd957a187519c"
+
+LIC_FILES_CHKSUM_MBEDTLS = "file://mbedtls/LICENSE;md5=379d5819937a6c2f1ef1630d341e026d"
meta-arm/recipes-bsp/uefi/edk2-firmware_202308.bb +1 -1
index 8620a67b..2619f2fd 100644
@@ -1,5 +1,5 @@
 SRCREV_edk2           ?= "819cfc6b42a68790a23509e4fcc58ceb70e1965e"
-SRCREV_edk2-platforms ?= "bb6841e3fd1c60b3f8510b4fc0a380784e05d326"
+SRCREV_edk2-platforms ?= "88ea1c2b62d44d6a4ebf2626ddaeecbc74f96877"
 
 # FIXME - clang is having issues with antlr
 TOOLCHAIN:aarch64 = "gcc"
Signature · 1 line
2.30.2
author
#2 lore raw

PATCH 3/3 arm/hafnium: update to v2.10

In reply to Jon Mason
---
 .../recipes-bsp/hafnium/{hafnium_2.9.bb => hafnium_2.10.bb}     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-arm/recipes-bsp/hafnium/{hafnium_2.9.bb => hafnium_2.10.bb} (97%)
meta-arm/recipes-bsp/hafnium/hafnium_2.10.bb renamed from meta-arm/recipes-bsp/hafnium/hafnium_2.9.bb +1 -1
similarity index 97%
rename from meta-arm/recipes-bsp/hafnium/hafnium_2.9.bb
rename to meta-arm/recipes-bsp/hafnium/hafnium_2.10.bb
index 0997448f..dea1bdcb 100644
@@ -18,7 +18,7 @@ SRC_URI = "gitsm://git.trustedfirmware.org/hafnium/hafnium.git;protocol=https;br
            file://0001-Use-pkg-config-native-to-find-the-libssl-headers.patch;patchdir=third_party/linux \
            file://0001-work-around-visibility-issue.patch;patchdir=third_party/dtc \
           "
-SRCREV = "0715b8e002cdfb92e6b7efb71128cb24557b70cb"
+SRCREV = "946fde92bedc95e1320684b0bc2dc752bc1e1bc7"
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
 
Signature · 1 line
2.30.2
Applied
#3 lore raw
In reply to Jon Mason
Quoted 4 lines · Jon Mason

TF-A is being patched in the recipe for qemuarm64-secureboot. This should be done in the bbappend.

Applied, thanks!

[1/3] arm/trusted-firmware-a: move patch file to bbappend

      commit: f0d7b9db317e72300b71184014573564a2787cd0
[2/3] arm/trusted-firmware-a: update to 2.10
      commit: 3835b78f03ab7c396323b6f5b0d52184e2ea3ca7
[3/3] arm/hafnium: update to v2.10
      commit: 560075f050cecd1591834efd9a4d949dbc6ff355

Best regards,

Signature · 1 line
Jon Mason <[email protected]>