meta-arm.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] arm-bsp/trusted-firmware-a: remove TARGET_FPU build argument
@ 2021-10-25 15:42 Ross Burton
  2021-10-25 15:42 ` [PATCH 2/5] arm/trusted-firmware-a: remove obsolete TF-A 1.5 Ross Burton
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ross Burton @ 2021-10-25 15:42 UTC (permalink / raw)
  To: meta-arm

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

TARGET_FPU passed to TF-A Makefile but is not used in TF-A source code.

Change-Id: I7c275711ed1e9fb9ee4e4df2b9c1606cacc4138c
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
index a1e59d88..f5aed675 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
@@ -143,7 +143,6 @@ EXTRA_OEMAKE += "OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
 
 # Runtime variables
 EXTRA_OEMAKE += "RUNTIME_SYSROOT=${STAGING_DIR_HOST}"
-EXTRA_OEMAKE += "TARGET_FPU=${TARGET_FPU}"
 
 BUILD_DIR = "${B}/${TFA_PLATFORM}"
 BUILD_DIR .= "${@'/${TFA_BOARD}' if d.getVar('TFA_BOARD') else ''}"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/5] arm/trusted-firmware-a: remove obsolete TF-A 1.5
  2021-10-25 15:42 [PATCH 1/5] arm-bsp/trusted-firmware-a: remove TARGET_FPU build argument Ross Burton
@ 2021-10-25 15:42 ` Ross Burton
  2021-10-25 15:42 ` [PATCH 3/5] arm/fiptool-native: bumping the version to v2.5 Ross Burton
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2021-10-25 15:42 UTC (permalink / raw)
  To: meta-arm

TF-A 1.5 is very old, remove. People who still need 1.5 will likely be
using older releases.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../trusted-firmware-a_1.5.bb                 | 28 -------------------
 1 file changed, 28 deletions(-)
 delete mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_1.5.bb

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_1.5.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_1.5.bb
deleted file mode 100644
index 56d3507e..00000000
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_1.5.bb
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Trusted firmware-A 1.5
-#
-
-require trusted-firmware-a.inc
-
-# Use TF-A for version
-SRCREV_FORMAT = "tfa"
-
-# TF-A v1.5
-SRCREV_tfa = "ed8112606c54d85781fc8429160883d6310ece32"
-
-LIC_FILES_CHKSUM += "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443"
-
-#
-# mbed TLS source
-# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1
-#
-
-SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls;branch=mbedtls-2.16"
-
-# mbed TLS v2.16.2
-SRCREV_mbedtls = "d81c11b8ab61fd5b2da8133aa73c5fe33a0633eb"
-
-LIC_FILES_CHKSUM_MBEDTLS = " \
-    file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
-    file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
-    "
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/5] arm/fiptool-native: bumping the version to v2.5
  2021-10-25 15:42 [PATCH 1/5] arm-bsp/trusted-firmware-a: remove TARGET_FPU build argument Ross Burton
  2021-10-25 15:42 ` [PATCH 2/5] arm/trusted-firmware-a: remove obsolete TF-A 1.5 Ross Burton
@ 2021-10-25 15:42 ` Ross Burton
  2021-10-25 15:42 ` [PATCH 4/5] arm/fiptool-native: improve OpenSSL build fix Ross Burton
  2021-10-25 15:42 ` [PATCH 5/5] arm/trusted-firmware-a: " Ross Burton
  3 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2021-10-25 15:42 UTC (permalink / raw)
  To: meta-arm

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

The commit provides the v2.5 recipe for fiptool-native
and removes the older versions.

Change-Id: Ie87ca97bc63bfe7ba2337b1bf05d9658921bab83
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
---
 .../fiptool/fiptool-native_1.5.bb             | 31 -------------------
 ...ol-native_2.3.bb => fiptool-native_2.5.bb} |  9 +++---
 2 files changed, 4 insertions(+), 36 deletions(-)
 delete mode 100644 meta-arm/recipes-devtools/fiptool/fiptool-native_1.5.bb
 rename meta-arm/recipes-devtools/fiptool/{fiptool-native_2.3.bb => fiptool-native_2.5.bb} (73%)

diff --git a/meta-arm/recipes-devtools/fiptool/fiptool-native_1.5.bb b/meta-arm/recipes-devtools/fiptool/fiptool-native_1.5.bb
deleted file mode 100644
index 925542c8..00000000
--- a/meta-arm/recipes-devtools/fiptool/fiptool-native_1.5.bb
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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 = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https"
-LIC_FILES_CHKSUM = "file://license.rst;md5=e927e02bca647e14efd87e9e914b2443"
-
-# Use fiptool from TF-A v1.5
-SRCREV = "ed8112606c54d85781fc8429160883d6310ece32"
-
-DEPENDS += "openssl-native"
-
-inherit native
-
-S = "${WORKDIR}/git"
-
-do_compile () {
-    # These changes are needed to have the fiptool compiling and executing properly
-    sed -i '/^LDLIBS/ 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 ${D}${bindir}/
-    install -m 0755 tools/fiptool/fiptool ${D}${bindir}
-}
diff --git a/meta-arm/recipes-devtools/fiptool/fiptool-native_2.3.bb b/meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb
similarity index 73%
rename from meta-arm/recipes-devtools/fiptool/fiptool-native_2.3.bb
rename to meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb
index 25ca111e..2d0f333a 100644
--- a/meta-arm/recipes-devtools/fiptool/fiptool-native_2.3.bb
+++ b/meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb
@@ -6,10 +6,10 @@ DESCRIPTION = "fiptool - Trusted Firmware tool for packaging"
 LICENSE = "BSD-3-Clause"
 
 SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;destsuffix=fiptool-${PV};protocol=https;"
-LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=713afe122abbe07f067f939ca3c480c5"
 
-# Use fiptool from TF-A v2.3
-SRCREV = "ecd27ad85f1eba29f6bf92c39dc002c85b07dad5"
+# Use fiptool from TF-A v2.5
+SRCREV = "c158878249f1bd930906ebd744b90d3f2a8265f1"
 
 DEPENDS += "openssl-native"
 
@@ -24,6 +24,5 @@ do_compile () {
 }
 
 do_install () {
-    install -d ${D}${bindir}/
-    install -m 0755 tools/fiptool/fiptool ${D}${bindir}
+    install -D -p -m 0755 tools/fiptool/fiptool ${D}${bindir}/fiptool
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/5] arm/fiptool-native: improve OpenSSL build fix
  2021-10-25 15:42 [PATCH 1/5] arm-bsp/trusted-firmware-a: remove TARGET_FPU build argument Ross Burton
  2021-10-25 15:42 ` [PATCH 2/5] arm/trusted-firmware-a: remove obsolete TF-A 1.5 Ross Burton
  2021-10-25 15:42 ` [PATCH 3/5] arm/fiptool-native: bumping the version to v2.5 Ross Burton
@ 2021-10-25 15:42 ` Ross Burton
  2021-10-25 15:42 ` [PATCH 5/5] arm/trusted-firmware-a: " Ross Burton
  3 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2021-10-25 15:42 UTC (permalink / raw)
  To: meta-arm

Take a patch that is heading upstream to pass OPENSSL_DIR to the fiptool
build, removing the need to alter the Makefiles at build time.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../recipes-devtools/fiptool/files/ssl.patch  | 52 +++++++++++++++++++
 .../fiptool/fiptool-native_2.5.bb             |  9 ++--
 2 files changed, 56 insertions(+), 5 deletions(-)
 create mode 100644 meta-arm/recipes-devtools/fiptool/files/ssl.patch

diff --git a/meta-arm/recipes-devtools/fiptool/files/ssl.patch b/meta-arm/recipes-devtools/fiptool/files/ssl.patch
new file mode 100644
index 00000000..cdabd1b7
--- /dev/null
+++ b/meta-arm/recipes-devtools/fiptool/files/ssl.patch
@@ -0,0 +1,52 @@
+fiptool: respect OPENSSL_DIR
+
+fiptool links to libcrypto, so as with the other tools it should respect
+OPENSSL_DIR for include/library paths.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/Makefile b/Makefile
+index ec6f88585..2d3b9fc26 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1388,7 +1388,7 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
+ 
+ ${FIPTOOL}: FORCE
+ ifdef UNIX_MK
+-	${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} --no-print-directory -C ${FIPTOOLPATH}
++	${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} --no-print-directory -C ${FIPTOOLPATH}
+ else
+ # Clear the MAKEFLAGS as we do not want
+ # to pass the gnumake flags to nmake.
+diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
+index 11d2e7b0b..7c2a08379 100644
+--- a/tools/fiptool/Makefile
++++ b/tools/fiptool/Makefile
+@@ -12,6 +12,8 @@ FIPTOOL ?= fiptool${BIN_EXT}
+ PROJECT := $(notdir ${FIPTOOL})
+ OBJECTS := fiptool.o tbbr_config.o
+ V ?= 0
++OPENSSL_DIR := /usr
++
+ 
+ override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700
+ HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99
+@@ -20,7 +22,7 @@ ifeq (${DEBUG},1)
+ else
+   HOSTCCFLAGS += -O2
+ endif
+-LDLIBS := -lcrypto
++LDLIBS := -L${OPENSSL_DIR}/lib -lcrypto
+ 
+ ifeq (${V},0)
+   Q := @
+@@ -28,7 +30,7 @@ else
+   Q :=
+ endif
+ 
+-INCLUDE_PATHS := -I../../include/tools_share
++INCLUDE_PATHS := -I../../include/tools_share  -I${OPENSSL_DIR}/include
+ 
+ HOSTCC ?= gcc
+ 
diff --git a/meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb b/meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb
index 2d0f333a..e733ff1e 100644
--- a/meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb
+++ b/meta-arm/recipes-devtools/fiptool/fiptool-native_2.5.bb
@@ -5,7 +5,8 @@
 DESCRIPTION = "fiptool - Trusted Firmware tool for packaging"
 LICENSE = "BSD-3-Clause"
 
-SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;destsuffix=fiptool-${PV};protocol=https;"
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;destsuffix=fiptool-${PV};protocol=https \
+           file://ssl.patch"
 LIC_FILES_CHKSUM = "file://docs/license.rst;md5=713afe122abbe07f067f939ca3c480c5"
 
 # Use fiptool from TF-A v2.5
@@ -15,11 +16,9 @@ DEPENDS += "openssl-native"
 
 inherit native
 
-do_compile () {
-    # These changes are needed to have the fiptool compiling and executing properly
-    sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
-    sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
+EXTRA_OEMAKE = "V=1 HOSTCC='${BUILD_CC}' OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
 
+do_compile () {
     oe_runmake fiptool
 }
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 5/5] arm/trusted-firmware-a: improve OpenSSL build fix
  2021-10-25 15:42 [PATCH 1/5] arm-bsp/trusted-firmware-a: remove TARGET_FPU build argument Ross Burton
                   ` (2 preceding siblings ...)
  2021-10-25 15:42 ` [PATCH 4/5] arm/fiptool-native: improve OpenSSL build fix Ross Burton
@ 2021-10-25 15:42 ` Ross Burton
  3 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2021-10-25 15:42 UTC (permalink / raw)
  To: meta-arm

Take a patch that is heading upstream to pass OPENSSL_DIR to the fiptool
build, removing the need to alter the Makefiles at build time.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../trusted-firmware-a/files/ssl.patch        | 52 +++++++++++++++++++
 .../trusted-firmware-a/trusted-firmware-a.inc | 18 ++-----
 2 files changed, 57 insertions(+), 13 deletions(-)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/files/ssl.patch

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/files/ssl.patch b/meta-arm/recipes-bsp/trusted-firmware-a/files/ssl.patch
new file mode 100644
index 00000000..cdabd1b7
--- /dev/null
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/files/ssl.patch
@@ -0,0 +1,52 @@
+fiptool: respect OPENSSL_DIR
+
+fiptool links to libcrypto, so as with the other tools it should respect
+OPENSSL_DIR for include/library paths.
+
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/Makefile b/Makefile
+index ec6f88585..2d3b9fc26 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1388,7 +1388,7 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
+ 
+ ${FIPTOOL}: FORCE
+ ifdef UNIX_MK
+-	${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} --no-print-directory -C ${FIPTOOLPATH}
++	${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} --no-print-directory -C ${FIPTOOLPATH}
+ else
+ # Clear the MAKEFLAGS as we do not want
+ # to pass the gnumake flags to nmake.
+diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
+index 11d2e7b0b..7c2a08379 100644
+--- a/tools/fiptool/Makefile
++++ b/tools/fiptool/Makefile
+@@ -12,6 +12,8 @@ FIPTOOL ?= fiptool${BIN_EXT}
+ PROJECT := $(notdir ${FIPTOOL})
+ OBJECTS := fiptool.o tbbr_config.o
+ V ?= 0
++OPENSSL_DIR := /usr
++
+ 
+ override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700
+ HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99
+@@ -20,7 +22,7 @@ ifeq (${DEBUG},1)
+ else
+   HOSTCCFLAGS += -O2
+ endif
+-LDLIBS := -lcrypto
++LDLIBS := -L${OPENSSL_DIR}/lib -lcrypto
+ 
+ ifeq (${V},0)
+   Q := @
+@@ -28,7 +30,7 @@ else
+   Q :=
+ endif
+ 
+-INCLUDE_PATHS := -I../../include/tools_share
++INCLUDE_PATHS := -I../../include/tools_share  -I${OPENSSL_DIR}/include
+ 
+ HOSTCC ?= gcc
+ 
diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
index f5aed675..36bd0376 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
@@ -7,7 +7,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 inherit deploy
 
-SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa"
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa \
+           file://ssl.patch"
 UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$"
 
 COMPATIBLE_MACHINE ?= "invalid"
@@ -140,6 +141,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('SEL2_SPMC', '1', 'ARM_SPMC_MANIFEST_DTS=$
 
 # Tell the tools where the native OpenSSL is located
 EXTRA_OEMAKE += "OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
+# Use the correct native compiler
+EXTRA_OEMAKE += "HOSTCC='${BUILD_CC}'"
 
 # Runtime variables
 EXTRA_OEMAKE += "RUNTIME_SYSROOT=${STAGING_DIR_HOST}"
@@ -148,21 +151,10 @@ BUILD_DIR = "${B}/${TFA_PLATFORM}"
 BUILD_DIR .= "${@'/${TFA_BOARD}' if d.getVar('TFA_BOARD') else ''}"
 BUILD_DIR .= "/${@'debug' if d.getVar("TFA_DEBUG") == '1' else 'release'}"
 
-# The following hack is needed to fit properly in yocto build environment
-# TFA is forcing the host compiler and its flags in the Makefile using :=
-# assignment for GCC and CFLAGS.
 do_compile() {
-    cd ${S}
-
-    # These changes are needed to have the native tools compiling and executing properly
-    sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
-    sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
-    # This can be removed when only TF-A 2.4 onwards is supported
-    sed -i 's^OPENSSL_DIR.*=.*$^OPENSSL_DIR = ${STAGING_DIR_NATIVE}/${prefix_native}^' ${S}/tools/*/Makefile
-
     # Currently there are races if you build all the targets at once in parallel
     for T in ${TFA_BUILD_TARGET}; do
-        oe_runmake $T
+        oe_runmake -C ${S} $T
     done
 }
 do_compile[cleandirs] = "${B}"
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-25 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 15:42 [PATCH 1/5] arm-bsp/trusted-firmware-a: remove TARGET_FPU build argument Ross Burton
2021-10-25 15:42 ` [PATCH 2/5] arm/trusted-firmware-a: remove obsolete TF-A 1.5 Ross Burton
2021-10-25 15:42 ` [PATCH 3/5] arm/fiptool-native: bumping the version to v2.5 Ross Burton
2021-10-25 15:42 ` [PATCH 4/5] arm/fiptool-native: improve OpenSSL build fix Ross Burton
2021-10-25 15:42 ` [PATCH 5/5] arm/trusted-firmware-a: " Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).