* [PATCH 2/7] arm/trusted-firmware-m: don't use COMPATIBLE_MACHINE directly
2020-12-18 17:34 [PATCH 1/7] arm-bsp/musca: remove trusted-firmware-m statements Ross Burton
@ 2020-12-18 17:34 ` Ross Burton
2020-12-18 17:34 ` [PATCH 3/7] arm-bsp/trusted-firmware-m: move TFM_PLATFORM to machine configuration Ross Burton
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2020-12-18 17:34 UTC (permalink / raw)
To: meta-arm
COMPATIBLE_MACHINE is a wrapper around raising SkipRecipe, and as this
recipe basically just needs TFM_PLATFORM set we can raise that if the
variable is not set. This allows BSPs to set TFM_PLATFORM in their
machine configuration instead of needing to bbappend.
Change-Id: I8544ff14ac4689bfbea1f0ac68364b673abde6f1
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
.../trusted-firmware-m/trusted-firmware-m_1.0.bb | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
index 9b204b8..906f2f0 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
@@ -46,14 +46,17 @@ DEPENDS += "python3-cryptography-native python3-pyasn1-native python3-cbor-nativ
S = "${WORKDIR}/git/tfm"
B = "${WORKDIR}/build"
-COMPATIBLE_MACHINE ?= "invalid"
-
# Build for debug (set TFA_DEBUG to 1 to activate)
TFM_DEBUG ?= "0"
# Set target config
TFM_CONFIG ?= "ConfigDefault.cmake"
-# Platform must be set for each machine
-TFM_PLATFORM ?= "invalid"
+
+# Platform must be set, ideally in the machine configuration.
+TFM_PLATFORM ?= ""
+python() {
+ if not d.getVar("TFM_PLATFORM"):
+ raise bb.parse.SkipRecipe("TFM_PLATFORM needs to be set")
+}
# Uncomment, or copy these lines to your local.conf to use the Arm Clang compiler
# from meta-arm-toolchain.
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/7] arm-bsp/trusted-firmware-m: move TFM_PLATFORM to machine configuration
2020-12-18 17:34 [PATCH 1/7] arm-bsp/musca: remove trusted-firmware-m statements Ross Burton
2020-12-18 17:34 ` [PATCH 2/7] arm/trusted-firmware-m: don't use COMPATIBLE_MACHINE directly Ross Burton
@ 2020-12-18 17:34 ` Ross Burton
2020-12-18 17:34 ` [PATCH 4/7] arm/trusted-firmware-m: remove more unneeded build dependencies Ross Burton
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2020-12-18 17:34 UTC (permalink / raw)
To: meta-arm
Now this can be easily set in the machine, do so.
Change-Id: I964c78c8e1e8f845cc2c95193c4a795e12089d1a
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta-arm-bsp/conf/machine/musca-b1.conf | 2 ++
meta-arm-bsp/conf/machine/musca-s1.conf | 2 ++
.../trusted-firmware-m/trusted-firmware-m_%.bbappend | 4 ----
3 files changed, 4 insertions(+), 4 deletions(-)
delete mode 100644 meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_%.bbappend
diff --git a/meta-arm-bsp/conf/machine/musca-b1.conf b/meta-arm-bsp/conf/machine/musca-b1.conf
index ac0bea0..5300b75 100644
--- a/meta-arm-bsp/conf/machine/musca-b1.conf
+++ b/meta-arm-bsp/conf/machine/musca-b1.conf
@@ -23,3 +23,5 @@ QB_MEM = "512k"
ZEPHYR_BOARD = "v2m_musca_b1"
ZEPHYR_INHERIT_CLASSES += "zephyr-qemuboot"
ARCH_musca-b1 = "arm"
+
+TFM_PLATFORM = "MUSCA_B1"
diff --git a/meta-arm-bsp/conf/machine/musca-s1.conf b/meta-arm-bsp/conf/machine/musca-s1.conf
index 2dcdb50..c4131a8 100644
--- a/meta-arm-bsp/conf/machine/musca-s1.conf
+++ b/meta-arm-bsp/conf/machine/musca-s1.conf
@@ -8,3 +8,5 @@ require conf/machine/include/tune-cortexm33.inc
# GLIBC will not work with Cortex-M.
TCLIBC = "newlib"
+
+TFM_PLATFORM = "MUSCA_S1"
diff --git a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_%.bbappend b/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_%.bbappend
deleted file mode 100644
index d7a099e..0000000
--- a/meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_%.bbappend
+++ /dev/null
@@ -1,4 +0,0 @@
-COMPATIBLE_MACHINE = "musca-b1|musca-s1"
-
-TFM_PLATFORM_musca-b1 = "MUSCA_B1"
-TFM_PLATFORM_musca-s1 = "MUSCA_S1"
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/7] arm/trusted-firmware-m: remove more unneeded build dependencies
2020-12-18 17:34 [PATCH 1/7] arm-bsp/musca: remove trusted-firmware-m statements Ross Burton
2020-12-18 17:34 ` [PATCH 2/7] arm/trusted-firmware-m: don't use COMPATIBLE_MACHINE directly Ross Burton
2020-12-18 17:34 ` [PATCH 3/7] arm-bsp/trusted-firmware-m: move TFM_PLATFORM to machine configuration Ross Burton
@ 2020-12-18 17:34 ` Ross Burton
2020-12-18 17:34 ` [PATCH 5/7] arm/trusted-firmware-m: improve CMake calls Ross Burton
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2020-12-18 17:34 UTC (permalink / raw)
To: meta-arm
TF-M uses the binary Arm toolchains currently, so we can inhibit
all of the default dependencies.
Change-Id: I38a7bda9570d9d63d3d81f0886c437f29929a0f5
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
.../recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
index 906f2f0..d35099d 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
@@ -37,8 +37,8 @@ UPSTREAM_CHECK_GITTAGREGEX = "^TF-Mv(?P<pver>\d+(\.\d+)+)$"
inherit python3native deploy
-# Baremetal, just need a compiler
-DEPENDS_remove = "virtual/${TARGET_PREFIX}compilerlibs virtual/libc"
+# Baremetal and we bring a compiler below
+INHIBIT_DEFAULT_DEPS = "1"
DEPENDS += "cmake-native"
DEPENDS += "python3-cryptography-native python3-pyasn1-native python3-cbor-native"
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/7] arm/trusted-firmware-m: improve CMake calls
2020-12-18 17:34 [PATCH 1/7] arm-bsp/musca: remove trusted-firmware-m statements Ross Burton
` (2 preceding siblings ...)
2020-12-18 17:34 ` [PATCH 4/7] arm/trusted-firmware-m: remove more unneeded build dependencies Ross Burton
@ 2020-12-18 17:34 ` Ross Burton
2020-12-18 17:34 ` [PATCH 6/7] arm/trusted-firmware-m: set PACKAGE_ARCH Ross Burton
2020-12-18 17:34 ` [PATCH 7/7] arm/trusted-firmware-m: upgrade to 1.1 Ross Burton
5 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2020-12-18 17:34 UTC (permalink / raw)
To: meta-arm
Use cmake more idiomatically, and enable verbose builds.
Change-Id: I908af71f4662fab1dde9de86fc7a56ca3701e0c5
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
.../trusted-firmware-m/trusted-firmware-m_1.0.bb | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
index d35099d..630379a 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
@@ -80,6 +80,9 @@ EXTRA_OECMAKE += "-DCOMPILER=${TFM_COMPILER}"
EXTRA_OECMAKE += "${@bb.utils.contains('TFM_DEBUG', '1', '-DCMAKE_BUILD_TYPE=Debug', '', d)}"
EXTRA_OECMAKE += "-DPROJ_CONFIG=${S}/configs/${TFM_CONFIG}"
+# Verbose builds
+EXTRA_OECMAKE += "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
+
# Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application
CFLAGS[unexport] = "1"
LDFLAGS[unexport] = "1"
@@ -99,7 +102,7 @@ do_check_config() {
do_configure[cleandirs] = "${B}"
do_configure() {
- cmake -G"Unix Makefiles" --build ${S} ${EXTRA_OECMAKE}
+ cmake -G"Unix Makefiles" ${S} ${EXTRA_OECMAKE}
}
# Invoke install here as there's no point in splitting compile from install: the
@@ -107,7 +110,7 @@ do_configure() {
# rebuild. It also overrides the install prefix to be in the build tree, so you
# can't use the usual install prefix variables.
do_compile() {
- oe_runmake install
+ cmake --build ./ -- install
}
do_install() {
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 6/7] arm/trusted-firmware-m: set PACKAGE_ARCH
2020-12-18 17:34 [PATCH 1/7] arm-bsp/musca: remove trusted-firmware-m statements Ross Burton
` (3 preceding siblings ...)
2020-12-18 17:34 ` [PATCH 5/7] arm/trusted-firmware-m: improve CMake calls Ross Burton
@ 2020-12-18 17:34 ` Ross Burton
2020-12-18 17:34 ` [PATCH 7/7] arm/trusted-firmware-m: upgrade to 1.1 Ross Burton
5 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2020-12-18 17:34 UTC (permalink / raw)
To: meta-arm
As this is machine-specific, set PACKAGE_ARCH to MACHINE.
Change-Id: I4569bce706de8dea4ba98770960c0d40348a3fa2
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
.../recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
index 630379a..9a56f53 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
@@ -40,6 +40,8 @@ inherit python3native deploy
# Baremetal and we bring a compiler below
INHIBIT_DEFAULT_DEPS = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
DEPENDS += "cmake-native"
DEPENDS += "python3-cryptography-native python3-pyasn1-native python3-cbor-native"
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 7/7] arm/trusted-firmware-m: upgrade to 1.1
2020-12-18 17:34 [PATCH 1/7] arm-bsp/musca: remove trusted-firmware-m statements Ross Burton
` (4 preceding siblings ...)
2020-12-18 17:34 ` [PATCH 6/7] arm/trusted-firmware-m: set PACKAGE_ARCH Ross Burton
@ 2020-12-18 17:34 ` Ross Burton
5 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2020-12-18 17:34 UTC (permalink / raw)
To: meta-arm
Change-Id: Id0c37b291b32072ebe61abcd908ed9a2ebf79365
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
.../trusted-firmware-m/files/objcopy.patch | 20 +++++++++
...are-m_1.0.bb => trusted-firmware-m_1.1.bb} | 42 +++++++++----------
2 files changed, 41 insertions(+), 21 deletions(-)
create mode 100644 meta-arm/recipes-bsp/trusted-firmware-m/files/objcopy.patch
rename meta-arm/recipes-bsp/trusted-firmware-m/{trusted-firmware-m_1.0.bb => trusted-firmware-m_1.1.bb} (74%)
diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/files/objcopy.patch b/meta-arm/recipes-bsp/trusted-firmware-m/files/objcopy.patch
new file mode 100644
index 0000000..5734c13
--- /dev/null
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/files/objcopy.patch
@@ -0,0 +1,20 @@
+The BFD target elf32-little has no specified machine, which trips the
+architecture sanity test. Use elf32-littlearm to set the machine
+correctly.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/cmake/Common/CompilerGNUARMCommon.cmake b/cmake/Common/CompilerGNUARMCommon.cmake
+index 32e805bb..2d3ea8e4 100644
+--- a/cmake/Common/CompilerGNUARMCommon.cmake
++++ b/cmake/Common/CompilerGNUARMCommon.cmake
+@@ -196,7 +196,7 @@ function(compiler_generate_hex_output TARGET)
+ endfunction()
+
+ function(compiler_generate_elf_output TARGET)
+- add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_GNUARM_OBJCOPY} ARGS -O elf32-little $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.elf)
++ add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_GNUARM_OBJCOPY} ARGS -O elf32-littlearm $<TARGET_FILE:${TARGET}> $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.elf)
+ endfunction()
+
+ # Function for creating a new target that preprocesses a .c file
diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.1.bb
similarity index 74%
rename from meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
rename to meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.1.bb
index 9a56f53..17c3f4b 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.1.bb
@@ -10,23 +10,25 @@ PROVIDES = "virtual/trusted-firmware-m"
LICENSE = "BSD-3-Clause & Apachev2"
-LIC_FILES_CHKSUM ?= "file://license.rst;md5=07f368487da347f3c7bd0fc3085f3afa"
-LIC_FILES_CHKSUM += "file://../mbed-crypto/LICENSE;md5=302d50a6369f5f22efdb674db908167a"
-LIC_FILES_CHKSUM += "file://../CMSIS_5/LICENSE.txt;md5=c4082b6c254c9fb71136710391d9728b"
-
-SRC_URI = "git://git.trustedfirmware.org/trusted-firmware-m.git;protocol=https;branch=master;name=tfm;destsuffix=${S}"
-SRC_URI += "git://github.com/ARMmbed/mbed-crypto.git;protocol=https;branch=development;name=mbed-crypto;destsuffix=${S}/../mbed-crypto"
-SRC_URI += "https://github.com/ARM-software/CMSIS_5/releases/download/5.5.0/ARM.CMSIS.5.5.0.pack;name=cmsis;subdir=${S}/../CMSIS_5;downloadfilename=ARM.CMSIS.5.5.0.zip"
-
-SRC_URI[cmsis.md5sum] = "73b6cf6b4ab06ac099478e6cf983c08e"
-SRC_URI[cmsis.sha256sum] = "fc6e46c77de29ed05ef3bfd4846a2da49b024bc8854c876ac053aaa8d348ac52"
-
-SRCREV_FORMAT = "tfm_mbed-crypto_cmsis"
-# TF-Mv1.0
-SRCREV_tfm = "0768982ea41b5e7d207445f19ee23e5d67d9c89b"
+LIC_FILES_CHKSUM = "file://license.rst;md5=07f368487da347f3c7bd0fc3085f3afa \
+ file://../tf-m-tests/license.rst;md5=02d06ffb8d9f099ff4961c0cb0183a18 \
+ file://../mbed-crypto/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
+ file://../mcuboot/LICENSE;md5=b6ee33f1d12a5e6ee3de1e82fb51eeb8"
+
+SRC_URI = "git://git.trustedfirmware.org/TF-M/trusted-firmware-m.git;protocol=https;branch=master;name=tfm;destsuffix=${S} \
+ git://git.trustedfirmware.org/TF-M/tf-m-tests.git;protocol=https;branch=master;name=tfm-tests;destsuffix=${S}/../tf-m-tests \
+ git://github.com/ARMmbed/mbed-crypto.git;protocol=https;branch=development;name=mbed-crypto;destsuffix=${S}/../mbed-crypto \
+ git://github.com/JuulLabs-OSS/mcuboot.git;protocol=https;name=mcuboot;destsuffix=${S}/../mcuboot \
+ file://objcopy.patch"
+
+# TF-Mv1.1
+SRCREV_tfm = "a6b336c1509fd5f5522450e3cec0fcd6c060f9c8"
# mbedcrypto-3.0.1
SRCREV_mbed-crypto = "1146b4e06011b69a6437e6b728f2af043a06ec19"
-SRCREV_cmsis = "5.5.0"
+# TF-Mv1.1
+SRCREV_tfm-tests = "5a571808e7841f15cc966661a64dd6adb3b40f6c"
+# v1.6.0
+SRCREV_mcuboot = "50d24a57516f558dac72bef634723b60c5cfb46b"
UPSTREAM_CHECK_GITTAGREGEX = "^TF-Mv(?P<pver>\d+(\.\d+)+)$"
@@ -42,8 +44,10 @@ INHIBIT_DEFAULT_DEPS = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
-DEPENDS += "cmake-native"
-DEPENDS += "python3-cryptography-native python3-pyasn1-native python3-cbor-native"
+DEPENDS += "cmake-native \
+ python3-cryptography-native \
+ python3-pyasn1-native \
+ python3-cbor-native"
S = "${WORKDIR}/git/tfm"
B = "${WORKDIR}/build"
@@ -91,10 +95,6 @@ LDFLAGS[unexport] = "1"
AS[unexport] = "1"
LD[unexport] = "1"
-# This is needed because CMSIS_5 source package originally has .pack extension not .zip
-# and bitbake checks this dependency based on file extension
-do_unpack[depends] += "unzip-native:do_populate_sysroot"
-
do_configure[prefuncs] += "do_check_config"
do_check_config() {
if [ ! -f "${S}/configs/${TFM_CONFIG}" ]; then
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread