arm-bsp/musca: remove trusted-firmware-m statements
PATCH 1/7 arm-bsp/musca: remove trusted-firmware-m statements
Musca doesn't build 'images' in the traditional sense yet, just trusted-firmware-m or Zephyr, so remove EXTRA_IMAGEDEPENDS.
Remove the preferred version for TF-M as we only ship one currently.
--- meta-arm-bsp/conf/machine/musca-b1.conf | 3 --- meta-arm-bsp/conf/machine/musca-s1.conf | 3 --- 2 files changed, 6 deletions(-)
meta-arm-bsp/conf/machine/musca-b1.conf +0 -3
@@ -4,9 +4,6 @@ #@NAME: Musca-B1 machine #@DESCRIPTION: Machine configuration for Musca-B1 -EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m" -PREFERRED_VERSION_trusted-firmware-m = "1.0" - DEFAULTTUNE ?= "armv8m-main" require conf/machine/include/tune-cortexm33.inc
meta-arm-bsp/conf/machine/musca-s1.conf +0 -3
@@ -4,9 +4,6 @@ #@NAME: Musca-S1 machine #@DESCRIPTION: Machine configuration for Musca-S1 -EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-m" -PREFERRED_VERSION_trusted-firmware-m = "1.0" - require conf/machine/include/tune-cortexm33.inc # GLIBC will not work with Cortex-M.
Signature · 1 line
2.25.1
PATCH 2/7 arm/trusted-firmware-m: don't use COMPATIBLE_MACHINE directly
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.
--- .../trusted-firmware-m/trusted-firmware-m_1.0.bb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb +7 -4
@@ -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.
Signature · 1 line
2.25.1
PATCH 3/7 arm-bsp/trusted-firmware-m: move TFM_PLATFORM to machine configuration
In reply to Ross BurtonNow this can be easily set in the machine, do so.
--- 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
meta-arm-bsp/conf/machine/musca-b1.conf +2 -0
@@ -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"
meta-arm-bsp/conf/machine/musca-s1.conf +2 -0
@@ -8,3 +8,5 @@ require conf/machine/include/tune-cortexm33.inc # GLIBC will not work with Cortex-M. TCLIBC = "newlib" + +TFM_PLATFORM = "MUSCA_S1"
meta-arm-bsp/recipes-bsp/trusted-firmware-m/trusted-firmware-m_%.bbappend deleted +0 -4
@@ -1,4 +0,0 @@ -COMPATIBLE_MACHINE = "musca-b1|musca-s1" - -TFM_PLATFORM_musca-b1 = "MUSCA_B1" -TFM_PLATFORM_musca-s1 = "MUSCA_S1"
Signature · 1 line
2.25.1
PATCH 4/7 arm/trusted-firmware-m: remove more unneeded build dependencies
In reply to Ross BurtonTF-M uses the binary Arm toolchains currently, so we can inhibit all of the default dependencies.
--- .../recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb +2 -2
@@ -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"
Signature · 1 line
2.25.1
PATCH 5/7 arm/trusted-firmware-m: improve CMake calls
In reply to Ross BurtonUse cmake more idiomatically, and enable verbose builds.
--- .../trusted-firmware-m/trusted-firmware-m_1.0.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb +5 -2
@@ -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() {
Signature · 1 line
2.25.1
PATCH 6/7 arm/trusted-firmware-m: set PACKAGE_ARCH
In reply to Ross BurtonAs this is machine-specific, set PACKAGE_ARCH to MACHINE.
--- .../recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb | 2 ++ 1 file changed, 2 insertions(+)
meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb +2 -0
@@ -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"
Signature · 1 line
2.25.1
PATCH 7/7 arm/trusted-firmware-m: upgrade to 1.1
In reply to Ross Burton---
.../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%)meta-arm/recipes-bsp/trusted-firmware-m/files/objcopy.patch new file +20 -0
@@ -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 <[email protected]> + +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
meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.1.bb renamed from meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.0.bb +21 -21
62 lines not on this page · raw message
Signature · 1 line
2.25.1