Skip to contentSkip to conversation

TF-A improvements

PATCH Superseded Joshua Watt 5 participants 29 messages May 11, 2020 – May 13, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover TF-A improvements

Makes several improvements to the TF-A recipe which should aid in it being the canonical source of TF-A that other BSP layers can pull in instead of replicating the recipe.

Joshua Watt (3):
trusted-firmware-a: Build out of tree
trusted-firmware-a: Install .elf file from subdirectory
trusted-firmware-a: Add recipe for version 2.3

 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 .../trusted-firmware-a_2.3.bb                 | 25 +++++++++++++++
 2 files changed, 41 insertions(+), 15 deletions(-)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/3 trusted-firmware-a: Build out of tree

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---
 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +16 -15
index 93ca199..197ab92 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -83,10 +78,16 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
 
 
 do_compile() {
-    oe_runmake ${TFA_BUILD_TARGET}
+    (cd ${S} && oe_runmake ${TFA_BUILD_TARGET})
 }
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -95,21 +96,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree

Quoted 2 lines · Joshua Watt

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

Quoted 84 lines
---
 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +16 -15
index 93ca199..197ab92 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -83,10 +78,16 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
 
 
 do_compile() {
-    oe_runmake ${TFA_BUILD_TARGET}
+    (cd ${S} && oe_runmake ${TFA_BUILD_TARGET})
 }
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -95,21 +96,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
#3 lore raw

PATCH 2/3 trusted-firmware-a: Install .elf file from subdirectory

In reply to Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index 197ab92..2eade9f 100644
@@ -100,9 +100,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
Signature · 1 line
2.17.1
Acked-by on v1 2/3
#4 lore raw

Re: [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory

Quoted 5 lines · Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

I don't think this is specific to Rockchip - for TI K3 platforms it is also bl31/bl31.elf

Quoted 26 lines
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index 197ab92..2eade9f 100644
@@ -100,9 +100,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
Signature · 1 line
2.17.1
#5 lore raw

PATCH 3/3 trusted-firmware-a: Add recipe for version 2.3

In reply to Joshua Watt

Adds a recipe for the 2.3 version of TF-A.

---
 .../trusted-firmware-a_2.3.bb                 | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +25 -0
new file mode 100644
index 0000000..0b66d5e
@@ -0,0 +1,25 @@
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa"
+SRCREV_FORMAT = "tfa"
+# Trusted firmware-A 2.3
+SRCREV_tfa = "8ff55a9e14a23d7c7f89f52465bcc6307850aa33"
+
+#
+# mbed TLS source
+# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1
+#
+
+LIC_FILES_CHKSUM_MBEDTLS += " \
+    file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+    file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
+    "
+
+SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls"
+# mbed TLS v2.16.2
+SRCREV_mbedtls = "d81c11b8ab61fd5b2da8133aa73c5fe33a0633eb"
+
+S = "${WORKDIR}/git"
+
+require trusted-firmware-a.inc
+
Signature · 1 line
2.17.1
#6 lore raw

Re: [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3

Quoted 1 line · Joshua Watt

Adds a recipe for the 2.3 version of TF-A.

Why not upgrade?

Quoted 42 lines
---
 .../trusted-firmware-a_2.3.bb                 | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +25 -0
new file mode 100644
index 0000000..0b66d5e
@@ -0,0 +1,25 @@
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa"
+SRCREV_FORMAT = "tfa"
+# Trusted firmware-A 2.3
+SRCREV_tfa = "8ff55a9e14a23d7c7f89f52465bcc6307850aa33"
+
+#
+# mbed TLS source
+# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1
+#
+
+LIC_FILES_CHKSUM_MBEDTLS += " \
+    file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+    file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
+    "
+
+SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls"
+# mbed TLS v2.16.2
+SRCREV_mbedtls = "d81c11b8ab61fd5b2da8133aa73c5fe33a0633eb"
+
+S = "${WORKDIR}/git"
+
+require trusted-firmware-a.inc
+
Signature · 1 line
2.17.1
#7 lore raw

Re: [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3

In reply to Joshua Watt
Quoted 24 lines · Joshua Watt

Adds a recipe for the 2.3 version of TF-A.

---
 .../trusted-firmware-a_2.3.bb                 | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +10 -0
new file mode 100644
index 0000000..0b66d5e
@@ -0,0 +1,25 @@
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa"
+SRCREV_FORMAT = "tfa"
+# Trusted firmware-A 2.3
+SRCREV_tfa = "8ff55a9e14a23d7c7f89f52465bcc6307850aa33"
+
+#
+# mbed TLS source
+# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb line 20

Quoted 10 lines
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +10 -0
+#
+
+LIC_FILES_CHKSUM_MBEDTLS += " \
+    file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+    file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
+    "
+
+SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls"
+# mbed TLS v2.16.2
+SRCREV_mbedtls = "d81c11b8ab61fd5b2da8133aa73c5fe33a0633eb"

As Diego pointed out to me in an internal review of the patch I just sent out, this needs to be v2.18, per the MBED TLS docs. Assuming my patch is acceptable, let's use that one instead of this one (also it adds v2.2 and does some mild code reorg). :)

Thanks,
Jon

Quoted 10 lines
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +5 -0
+
+S = "${WORKDIR}/git"
+
+require trusted-firmware-a.inc
+
Signature · 1 line
2.17.1
#8 lore raw

Re: [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3

Quoted 32 lines · Jon Mason
Quoted 31 lines · Joshua Watt

Adds a recipe for the 2.3 version of TF-A.

---
 .../trusted-firmware-a_2.3.bb                 | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +17 -0
new file mode 100644
index 0000000..0b66d5e
@@ -0,0 +1,25 @@
+LIC_FILES_CHKSUM = "file://docs/license.rst;md5=189505435dbcdcc8caa63c46fe93fa89"
+
+SRC_URI = "git://git.trustedfirmware.org/TF-A/trusted-firmware-a.git;protocol=https;name=tfa"
+SRCREV_FORMAT = "tfa"
+# Trusted firmware-A 2.3
+SRCREV_tfa = "8ff55a9e14a23d7c7f89f52465bcc6307850aa33"
+
+#
+# mbed TLS source
+# Those are used in trusted-firmware-a.inc if TFA_MBEDTLS is set to 1
+#
+
+LIC_FILES_CHKSUM_MBEDTLS += " \
+    file://mbedtls/apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \
+    file://mbedtls/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
+    "
+
Quoted 8 lines

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb line 20

Quoted 3 lines
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +3 -0
+SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;name=mbedtls;protocol=https;destsuffix=git/mbedtls"
+# mbed TLS v2.16.2
+SRCREV_mbedtls = "d81c11b8ab61fd5b2da8133aa73c5fe33a0633eb"

As Diego pointed out to me in an internal review of the patch I just sent out, this needs to be v2.18, per the MBED TLS docs. Assuming my patch is acceptable, let's use that one instead of this one (also it adds v2.2 and does some mild code reorg). :)

I would suggest starting from scratch here - push all your pending fixes and Joshua and I will rebase on top of that as consumers. Thoughts? Thanks.

Signature · 1 line
Denys
Quoted 16 lines

Thanks,
Jon

Quoted 10 lines
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb new file +5 -0
+
+S = "${WORKDIR}/git"
+
+require trusted-firmware-a.inc
+
Signature · 1 line
2.17.1
#9 lore raw

v2 cover TF-A Improvements

In reply to Joshua Watt

Makes several improvements to the TF-A recipe which should aid in it being the canonical source of TF-A that other BSP layers can pull in instead of replicating the recipe.

Joshua Watt (2):
trusted-firmware-a: Build out of tree
trusted-firmware-a: Install .elf file from subdirectory

 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)
Signature · 1 line
2.17.1
#10 lore raw

PATCH v2 1/2 trusted-firmware-a: Build out of tree

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---
 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +16 -15
index e6d48e4..5600568 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -90,10 +85,16 @@ do_compile() {
     sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
     export LD_LIBRARY_PATH=${STAGING_DIR_NATIVE}${libdir}:$LD_LIBRARY_PATH
 
-    oe_runmake ${TFA_BUILD_TARGET}
+    (cd ${S} && oe_runmake ${TFA_BUILD_TARGET})
 }
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +103,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
#11 lore raw

Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree

Quoted 1 line · Joshua Watt

+B = "${WORKDIR}/build"

You'll want to do_configure[cleandirs] = "${B}" too, right?

Ross

#12 lore raw

Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree

Quoted 8 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Ross Burton via lists.yoctoproject.org
Sent: 12 May 2020 22:22
To: Joshua Watt <[email protected]>
Cc: [email protected]
Subject: Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree

Quoted 4 lines
Quoted 1 line · Joshua Watt

+B = "${WORKDIR}/build"

You'll want to do_configure[cleandirs] = "${B}" too, right?

Since we have do_configure[noexec] = "1", will this work?

Quoted 2 lines

Ross

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#13 lore raw

Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree

Quoted 5 lines · Diego Sueiro
Quoted 3 lines
Quoted 1 line

+B = "${WORKDIR}/build"

You'll want to do_configure[cleandirs] = "${B}" too, right?

Since we have do_configure[noexec] = "1", will this work?

Good point. Probably not, use do_compile then.

Ross

#14 lore raw

Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree

In reply to Joshua Watt
Quoted 50 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Joshua Watt via lists.yoctoproject.org
Sent: 12 May 2020 22:12
To: [email protected]
Cc: Joshua Watt <[email protected]>
Subject: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---
 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +0 -2
index e6d48e4..5600568 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)  TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy

can find -# the produced binaries -TFA_BUILD_DIR ?= "build- ${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR -EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"

 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)  TFA_MBEDTLS ?=
"0"
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +1 -1
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', '

DEBUG=${TFA_DEBUG}', '', d)}"

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +0 -0
@@ -90,10 +85,16 @@ do_compile() {
     sed -i '/^INCLUDE_PATHS/ s,$, \-

I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
export
LD_LIBRARY_PATH=${STAGING_DIR_NATIVE}${libdir}:$LD_LIBRARY_PATH

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc do_compile() { · line 88

Quoted 2 lines
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +1 -1
-    oe_runmake ${TFA_BUILD_TARGET}
+    (cd ${S} && oe_runmake ${TFA_BUILD_TARGET})

I'm just wondering, why you need to run this in a subshell?

Quoted 42 lines

}

do_install() {

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +13 -8
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +103,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
--
Quoted 1 line

2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#15 lore raw

PATCH v2 2/2 trusted-firmware-a: Install .elf file from subdirectory

In reply to Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index 5600568..c0274f3 100644
@@ -107,9 +107,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
Signature · 1 line
2.17.1
Reviewed-by on v2 2/2
#16 lore raw

Re: [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory

Quoted 2 lines · Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Hey, you dropped my ack... :) Anyway:

Quoted 26 lines
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index 5600568..c0274f3 100644
@@ -107,9 +107,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
Signature · 1 line
2.17.1
#17 lore raw

v3 cover TF-A Improvement

In reply to Joshua Watt

Makes several improvements to the TF-A recipe which should aid in it being the canonical source of TF-A that other BSP layers can pull in instead of replicating the recipe.

Joshua Watt (2):
trusted-firmware-a: Build out of tree
trusted-firmware-a: Install .elf file from subdirectory

 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)
Signature · 1 line
2.17.1
#18 lore raw

PATCH v3 1/2 trusted-firmware-a: Build out of tree

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---
 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +18 -14
index e6d48e4..febd8ce 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
 # 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 fiptool compiling and executing properly
     sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
@@ -92,8 +89,15 @@ do_compile() {
 
     oe_runmake ${TFA_BUILD_TARGET}
 }
+do_compile[cleandirs] = "${B}"
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +106,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
Reviewed-by on v3 1/2
#19 lore raw

Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree

The patch itself looks good to me but I haven't tested it (a.k.a build & run).

Quoted 8 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Joshua Watt via lists.yoctoproject.org
Sent: 13 May 2020 16:47
To: [email protected]
Cc: Joshua Watt <[email protected]>
Subject: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree

Quoted 4 lines

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

Quoted 90 lines
---
 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +0 -2
index e6d48e4..febd8ce 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)  TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy

can find -# the produced binaries -TFA_BUILD_DIR ?= "build- ${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR -EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"

 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)  TFA_MBEDTLS ?=
"0"
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +1 -1
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', '

DEBUG=${TFA_DEBUG}', '', d)}"

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +0 -0
@@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT',

'1', ' BL33=${DEPLOY_DIR_IMAG # TFA is forcing the host compiler and its flags in the Makefile using := # assignment for GCC and CFLAGS.
do_compile() {

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -0
+    cd ${S}
+
     # These changes are needed to have the fiptool compiling and executing

properly

     sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},'
${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \-

I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile @@ - 92,8 +89,15 @@ do_compile() {

     oe_runmake ${TFA_BUILD_TARGET}

}

meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +14 -8
+do_compile[cleandirs] = "${B}"
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +106,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
--
Quoted 1 line

2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#20 lore raw

Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree

In reply to Joshua Watt
Quoted 5 lines · Joshua Watt

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---

What are the changes between v1, v2 and v3?

Quoted 89 lines
 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +18 -14
index e6d48e4..febd8ce 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
 # 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 fiptool compiling and executing properly
     sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
@@ -92,8 +89,15 @@ do_compile() {
 
     oe_runmake ${TFA_BUILD_TARGET}
 }
+do_compile[cleandirs] = "${B}"
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +106,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
#21 lore raw

Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree

Quoted 7 lines · Denys Dmytriyenko
Quoted 5 lines · Joshua Watt

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---

What are the changes between v1, v2 and v3?

v2 was a rebase on the latest HEAD

v3 changes used "cd ${S}" at the beginning of do_compile instead of in a subshell and also added the do_compile[cleandirs] = "${B}"

Quoted 90 lines
Quoted 90 lines

  .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
  1 file changed, 18 insertions(+), 14 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +18 -14
index e6d48e4..febd8ce 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
  # Build for debug (set TFA_DEBUG to 1 to activate)
  TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
  # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
  TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
  DEPENDS_append = " dtc-native openssl-native"
 
  # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
  # Handle TFA_DEBUG parameter
  EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
  # 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 fiptool compiling and executing properly
      sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile
      sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
@@ -92,8 +89,15 @@ do_compile() {
 
      oe_runmake ${TFA_BUILD_TARGET}
  }
+do_compile[cleandirs] = "${B}"
 
  do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
      install -d -m 755 ${D}/firmware
      for atfbin in ${TFA_INSTALL_TARGET}; do
          if [ "$atfbin" = "all" ]; then
@@ -102,21 +106,21 @@ do_install() {
              bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
              bberror "rewrite or turn off do_install"
              exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
              echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
              echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
              echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}
          elif [ "$atfbin" = "dtbs" ]; then
              echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
              echo "Tools $atfbin install, skipped"
          else
              bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#23 lore raw

Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree

Quoted 8 lines · Denys Dmytriyenko
Quoted 5 lines · Joshua Watt

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

---

What are the changes between v1, v2 and v3?

I only noticed cd $S; make split...

Quoted 92 lines
Quoted 89 lines
 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +18 -14
index e6d48e4..febd8ce 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
 # 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 fiptool compiling and executing properly
     sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
@@ -92,8 +89,15 @@ do_compile() {
 
     oe_runmake ${TFA_BUILD_TARGET}
 }
+do_compile[cleandirs] = "${B}"
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +106,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
#24 lore raw

Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree

Quoted 5 lines · Denys Dmytriyenko
Quoted 4 lines · Denys Dmytriyenko
Quoted 3 lines · Joshua Watt

Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates the need to set the TFA_BUILD_DIR.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

---

What are the changes between v1, v2 and v3?

I only noticed cd $S; make split...

Pulled in to the master branch.

Thanks,
Jon

Quoted 97 lines
Quoted 94 lines
Quoted 91 lines

 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +18 -14
index e6d48e4..febd8ce 100644
@@ -15,12 +15,7 @@ TFA_PLATFORM ?= "invalid"
 # Build for debug (set TFA_DEBUG to 1 to activate)
 TFA_DEBUG ?= "0"
 
-# Sub-directory in which to build.
-# This must be coherent with BUILD_PLAT make parameter so that deploy can find
-# the produced binaries
-TFA_BUILD_DIR ?= "build-${TFA_PLATFORM}"
-# set BUILD_PLAT depending on configured BUILD_DIR
-EXTRA_OEMAKE += "BUILD_PLAT=${TFA_BUILD_DIR}"
+B = "${WORKDIR}/build"
 
 # mbed TLS support (set TFA_MBEDTLS to 1 to activate)
 TFA_MBEDTLS ?= "0"
@@ -68,7 +63,7 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 
 # Add platform parameter
-EXTRA_OEMAKE += "PLAT=${TFA_PLATFORM}"
+EXTRA_OEMAKE += "BUILD_BASE=${B} PLAT=${TFA_PLATFORM}"
 
 # Handle TFA_DEBUG parameter
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_DEBUG', '1', ' DEBUG=${TFA_DEBUG}', '', d)}"
@@ -85,6 +80,8 @@ EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', ' BL33=${DEPLOY_DIR_IMAG
 # 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 fiptool compiling and executing properly
     sed -i '/^LDLIBS/ s,$, \-L${RECIPE_SYSROOT_NATIVE}${libdir},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \-I${RECIPE_SYSROOT_NATIVE}${includedir},' ${S}/tools/fiptool/Makefile
@@ -92,8 +89,15 @@ do_compile() {
 
     oe_runmake ${TFA_BUILD_TARGET}
 }
+do_compile[cleandirs] = "${B}"
 
 do_install() {
+    if ${@"true" if d.getVar('TFA_DEBUG') == '1' else "false"}; then
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/debug/
+    else
+        BUILD_PLAT=${B}/${TFA_PLATFORM}/release/
+    fi
+
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
         if [ "$atfbin" = "all" ]; then
@@ -102,21 +106,21 @@ do_install() {
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
+            install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
+        elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
-            install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
+            install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
         elif [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
-        elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
+        elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
         else
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
Signature · 1 line
2.17.1
#25 lore raw

PATCH v3 2/2 trusted-firmware-a: Install .elf file from subdirectory

In reply to Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index febd8ce..4b5da7a 100644
@@ -110,9 +110,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
Signature · 1 line
2.17.1
Reviewed-by on v3 2/2
#26 lore raw

Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory

Quoted 9 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Joshua Watt via lists.yoctoproject.org
Sent: 13 May 2020 16:47
To: [email protected]
Cc: Joshua Watt <[email protected]>
Subject: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory

Quoted 7 lines

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

Quoted 22 lines
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -3
index febd8ce..4b5da7a 100644
@@ -110,9 +110,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
--
Quoted 1 line

2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#27 lore raw

Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory

In reply to Joshua Watt
Quoted 5 lines · Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

I thought you dropped this sentence in v2...

Quoted 26 lines
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index febd8ce..4b5da7a 100644
@@ -110,9 +110,9 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
         elif [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
Signature · 1 line
2.17.1
#28 lore raw

Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory

Quoted 7 lines · Denys Dmytriyenko
Quoted 5 lines · Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

I thought you dropped this sentence in v2...

I stupidly assumed that V2 would be the last patch and edited it in the git patch editor before sending, so it came back when I sent another series :(

Quoted 27 lines
Quoted 27 lines
---
  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index febd8ce..4b5da7a 100644
@@ -110,9 +110,9 @@ do_install() {
              echo "Install $atfbin.bin"
              install -m 0644 $BUILD_PLAT/$atfbin.bin \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
              echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
          elif [ -f $BUILD_PLAT/$atfbin ]; then
              echo "Install $atfbin"
Signature · 1 line
2.17.1
#29 lore raw

Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory

Quoted 6 lines · Joshua Watt
Quoted 4 lines · Denys Dmytriyenko
Quoted 3 lines · Joshua Watt

The ELF files produced are in a subdirectory named by the build target (e.g. "bl31/bl31.elf") instead of the BUILD_PLAT directory.

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

Specifically allows this recipe to correctly install ATF for Rockchip RK3399

I thought you dropped this sentence in v2...

I stupidly assumed that V2 would be the last patch and edited it in the git patch editor before sending, so it came back when I sent another series :(

I removed the offending line above and applied the patch to the master branch.

Thanks,
Jon

Quoted 30 lines
Quoted 28 lines
Quoted 28 lines
---
  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +2 -2
index febd8ce..4b5da7a 100644
@@ -110,9 +110,9 @@ do_install() {
              echo "Install $atfbin.bin"
              install -m 0644 $BUILD_PLAT/$atfbin.bin \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin.elf ]; then
+        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
              echo "Install $atfbin.elf"
-            install -m 0644 $BUILD_PLAT/$atfbin.elf \
+            install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                  ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
          elif [ -f $BUILD_PLAT/$atfbin ]; then
              echo "Install $atfbin"
Signature · 1 line
2.17.1