All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-arm][PATCH 0/3] TF-A improvements
@ 2020-05-11 14:26 Joshua Watt
  2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-11 14:26 UTC (permalink / raw)
  To: meta-arm; +Cc: 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 (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

-- 
2.17.1


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

* [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree
  2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
@ 2020-05-11 14:26 ` Joshua Watt
  2020-05-11 17:53   ` Denys Dmytriyenko
  2020-05-11 14:26 ` [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 29+ messages in thread
From: Joshua Watt @ 2020-05-11 14:26 UTC (permalink / raw)
  To: meta-arm; +Cc: Joshua Watt

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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)

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 93ca199..197ab92 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
@@ -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"
-- 
2.17.1


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

* [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
  2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
@ 2020-05-11 14:26 ` Joshua Watt
  2020-05-11 17:45   ` Denys Dmytriyenko
  2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 29+ messages in thread
From: Joshua Watt @ 2020-05-11 14:26 UTC (permalink / raw)
  To: meta-arm; +Cc: 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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 197ab92..2eade9f 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
@@ -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"
-- 
2.17.1


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

* [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3
  2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
  2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
  2020-05-11 14:26 ` [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
@ 2020-05-11 14:26 ` Joshua Watt
  2020-05-11 17:41   ` Denys Dmytriyenko
  2020-05-12  0:24   ` Jon Mason
  2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
  2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
  4 siblings, 2 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-11 14:26 UTC (permalink / raw)
  To: meta-arm; +Cc: Joshua Watt

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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../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

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
new file mode 100644
index 0000000..0b66d5e
--- /dev/null
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
@@ -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
+
-- 
2.17.1


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

* Re: [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3
  2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
@ 2020-05-11 17:41   ` Denys Dmytriyenko
  2020-05-12  0:24   ` Jon Mason
  1 sibling, 0 replies; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-11 17:41 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Mon, May 11, 2020 at 09:26:04AM -0500, Joshua Watt wrote:
> Adds a recipe for the 2.3 version of TF-A.

Why not upgrade?


> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../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
> 
> diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
> new file mode 100644
> index 0000000..0b66d5e
> --- /dev/null
> +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
> @@ -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
> +
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-11 14:26 ` [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
@ 2020-05-11 17:45   ` Denys Dmytriyenko
  0 siblings, 0 replies; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-11 17:45 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Mon, May 11, 2020 at 09:26:03AM -0500, Joshua Watt wrote:
> 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

Acked-by: Denys Dmytriyenko <denys@ti.com>


> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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 197ab92..2eade9f 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
> @@ -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"
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree
  2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
@ 2020-05-11 17:53   ` Denys Dmytriyenko
  0 siblings, 0 replies; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-11 17:53 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Mon, May 11, 2020 at 09:26:02AM -0500, Joshua Watt wrote:
> Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
> the need to set the TFA_BUILD_DIR.

Reviewed-by: Denys Dmytriyenko <denys@ti.com>


> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
>  1 file changed, 16 insertions(+), 15 deletions(-)
> 
> 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 93ca199..197ab92 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
> @@ -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"
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3
  2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
  2020-05-11 17:41   ` Denys Dmytriyenko
@ 2020-05-12  0:24   ` Jon Mason
  2020-05-12  0:28     ` Denys Dmytriyenko
  1 sibling, 1 reply; 29+ messages in thread
From: Jon Mason @ 2020-05-12  0:24 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Mon, May 11, 2020 at 09:26:04AM -0500, Joshua Watt wrote:
> Adds a recipe for the 2.3 version of TF-A.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../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
> 
> diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
> new file mode 100644
> index 0000000..0b66d5e
> --- /dev/null
> +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
> @@ -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"

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

> +
> +S = "${WORKDIR}/git"
> +
> +require trusted-firmware-a.inc
> +
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3
  2020-05-12  0:24   ` Jon Mason
@ 2020-05-12  0:28     ` Denys Dmytriyenko
  0 siblings, 0 replies; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-12  0:28 UTC (permalink / raw)
  To: Jon Mason; +Cc: Joshua Watt, meta-arm

On Mon, May 11, 2020 at 08:24:42PM -0400, Jon Mason wrote:
> On Mon, May 11, 2020 at 09:26:04AM -0500, Joshua Watt wrote:
> > Adds a recipe for the 2.3 version of TF-A.
> > 
> > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> > ---
> >  .../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
> > 
> > diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
> > new file mode 100644
> > index 0000000..0b66d5e
> > --- /dev/null
> > +++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a_2.3.bb
> > @@ -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"
> 
> 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.

-- 
Denys


> Thanks,
> Jon
> 
> > +
> > +S = "${WORKDIR}/git"
> > +
> > +require trusted-firmware-a.inc
> > +
> > -- 
> > 2.17.1
> > 
> 
> > 
> 

> 


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

* [meta-arm][PATCH v2 0/2] TF-A Improvements
  2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
                   ` (2 preceding siblings ...)
  2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
@ 2020-05-12 21:12 ` Joshua Watt
  2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
  2020-05-12 21:12   ` [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
  2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
  4 siblings, 2 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-12 21:12 UTC (permalink / raw)
  To: meta-arm; +Cc: 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(-)

-- 
2.17.1


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

* [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
  2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
@ 2020-05-12 21:12   ` Joshua Watt
  2020-05-12 21:22     ` Ross Burton
  2020-05-13  6:22     ` Diego Sueiro
  2020-05-12 21:12   ` [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
  1 sibling, 2 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-12 21:12 UTC (permalink / raw)
  To: meta-arm; +Cc: Joshua Watt

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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)

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 e6d48e4..5600568 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
@@ -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"
-- 
2.17.1


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

* [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
  2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
@ 2020-05-12 21:12   ` Joshua Watt
  2020-05-13 17:31     ` Denys Dmytriyenko
  1 sibling, 1 reply; 29+ messages in thread
From: Joshua Watt @ 2020-05-12 21:12 UTC (permalink / raw)
  To: meta-arm; +Cc: 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.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 5600568..c0274f3 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
@@ -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"
-- 
2.17.1


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

* Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
  2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
@ 2020-05-12 21:22     ` Ross Burton
  2020-05-13  6:36       ` Diego Sueiro
  2020-05-13  6:22     ` Diego Sueiro
  1 sibling, 1 reply; 29+ messages in thread
From: Ross Burton @ 2020-05-12 21:22 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Tue, 12 May 2020 at 22:12, Joshua Watt <JPEWhacker@gmail.com> wrote:
> +B = "${WORKDIR}/build"

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

Ross

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

* Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
  2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
  2020-05-12 21:22     ` Ross Burton
@ 2020-05-13  6:22     ` Diego Sueiro
  1 sibling, 0 replies; 29+ messages in thread
From: Diego Sueiro @ 2020-05-13  6:22 UTC (permalink / raw)
  To: JPEWhacker, meta-arm

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Joshua Watt via lists.yoctoproject.org
> Sent: 12 May 2020 22:12
> To: meta-arm@lists.yoctoproject.org
> Cc: Joshua Watt <JPEWhacker@gmail.com>
> 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.
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../trusted-firmware-a/trusted-firmware-a.inc | 31 ++++++++++---------
>  1 file changed, 16 insertions(+), 15 deletions(-)
>
> 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 e6d48e4..5600568 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
> @@ -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})

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

>  }
>
>  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"
> --
> 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.

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

* Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
  2020-05-12 21:22     ` Ross Burton
@ 2020-05-13  6:36       ` Diego Sueiro
  2020-05-13 13:41         ` Ross Burton
  0 siblings, 1 reply; 29+ messages in thread
From: Diego Sueiro @ 2020-05-13  6:36 UTC (permalink / raw)
  To: ross, Joshua Watt; +Cc: meta-arm

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Ross Burton via lists.yoctoproject.org
> Sent: 12 May 2020 22:22
> To: Joshua Watt <JPEWhacker@gmail.com>
> Cc: meta-arm@lists.yoctoproject.org
> Subject: Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
>
> On Tue, 12 May 2020 at 22:12, Joshua Watt <JPEWhacker@gmail.com> wrote:
> > +B = "${WORKDIR}/build"
>
> You'll want to do_configure[cleandirs] = "${B}" too, right?

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

>
> 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.

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

* Re: [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree
  2020-05-13  6:36       ` Diego Sueiro
@ 2020-05-13 13:41         ` Ross Burton
  0 siblings, 0 replies; 29+ messages in thread
From: Ross Burton @ 2020-05-13 13:41 UTC (permalink / raw)
  To: Diego Sueiro; +Cc: Joshua Watt, meta-arm

On Wed, 13 May 2020 at 07:36, Diego Sueiro <Diego.Sueiro@arm.com> wrote:
> > > +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

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

* [meta-arm][PATCH v3 0/2] TF-A Improvement
  2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
                   ` (3 preceding siblings ...)
  2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
@ 2020-05-13 15:47 ` Joshua Watt
  2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
  2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
  4 siblings, 2 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-13 15:47 UTC (permalink / raw)
  To: meta-arm; +Cc: 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(-)

-- 
2.17.1


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

* [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
  2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
@ 2020-05-13 15:47   ` Joshua Watt
  2020-05-13 16:19     ` Diego Sueiro
                       ` (2 more replies)
  2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
  1 sibling, 3 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-13 15:47 UTC (permalink / raw)
  To: meta-arm; +Cc: Joshua Watt

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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
 1 file changed, 18 insertions(+), 14 deletions(-)

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 e6d48e4..febd8ce 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
@@ -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"
-- 
2.17.1


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

* [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
  2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
@ 2020-05-13 15:47   ` Joshua Watt
  2020-05-13 16:19     ` Diego Sueiro
  2020-05-13 17:33     ` Denys Dmytriyenko
  1 sibling, 2 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-13 15:47 UTC (permalink / raw)
  To: meta-arm; +Cc: 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

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 febd8ce..4b5da7a 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
@@ -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"
-- 
2.17.1


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

* Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
  2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
@ 2020-05-13 16:19     ` Diego Sueiro
  2020-05-13 17:27     ` Denys Dmytriyenko
       [not found]     ` <160EA693C79E8869.18093@lists.yoctoproject.org>
  2 siblings, 0 replies; 29+ messages in thread
From: Diego Sueiro @ 2020-05-13 16:19 UTC (permalink / raw)
  To: JPEWhacker, meta-arm

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

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Joshua Watt via lists.yoctoproject.org
> Sent: 13 May 2020 16:47
> To: meta-arm@lists.yoctoproject.org
> Cc: Joshua Watt <JPEWhacker@gmail.com>
> Subject: [meta-arm][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.
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
>  1 file changed, 18 insertions(+), 14 deletions(-)
>
> 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 e6d48e4..febd8ce 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
> @@ -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"
> --
> 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.

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

* Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
@ 2020-05-13 16:19     ` Diego Sueiro
  2020-05-13 17:33     ` Denys Dmytriyenko
  1 sibling, 0 replies; 29+ messages in thread
From: Diego Sueiro @ 2020-05-13 16:19 UTC (permalink / raw)
  To: JPEWhacker, meta-arm

> -----Original Message-----
> From: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>
> On Behalf Of Joshua Watt via lists.yoctoproject.org
> Sent: 13 May 2020 16:47
> To: meta-arm@lists.yoctoproject.org
> Cc: Joshua Watt <JPEWhacker@gmail.com>
> Subject: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from
> subdirectory
>
> 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
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>

Reviewed-by: Diego Sueiro <diego.sueiro@arm.com>

> ---
>  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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 febd8ce..4b5da7a 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
> @@ -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"
> --
> 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.

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

* Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
  2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
  2020-05-13 16:19     ` Diego Sueiro
@ 2020-05-13 17:27     ` Denys Dmytriyenko
  2020-05-13 17:57       ` Joshua Watt
       [not found]     ` <160EA693C79E8869.18093@lists.yoctoproject.org>
  2 siblings, 1 reply; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-13 17:27 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Wed, May 13, 2020 at 10:47:06AM -0500, Joshua Watt wrote:
> Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
> the need to set the TFA_BUILD_DIR.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---

What are the changes between v1, v2 and v3?


>  .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
>  1 file changed, 18 insertions(+), 14 deletions(-)
> 
> 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 e6d48e4..febd8ce 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
> @@ -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"
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-12 21:12   ` [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
@ 2020-05-13 17:31     ` Denys Dmytriyenko
  0 siblings, 0 replies; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-13 17:31 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Tue, May 12, 2020 at 04:12:19PM -0500, Joshua Watt wrote:
> 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:

Reviewed-by: Denys Dmytriyenko <denys@ti.com>


> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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 5600568..c0274f3 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
> @@ -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"
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
  2020-05-13 16:19     ` Diego Sueiro
@ 2020-05-13 17:33     ` Denys Dmytriyenko
  2020-05-13 17:54       ` Joshua Watt
  1 sibling, 1 reply; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-13 17:33 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Wed, May 13, 2020 at 10:47:07AM -0500, Joshua Watt wrote:
> 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...


> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> 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 febd8ce..4b5da7a 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
> @@ -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"
> -- 
> 2.17.1
> 

> 


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

* Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
       [not found]     ` <160EA693C79E8869.18093@lists.yoctoproject.org>
@ 2020-05-13 17:37       ` Denys Dmytriyenko
  2020-05-13 21:49         ` Jon Mason
  0 siblings, 1 reply; 29+ messages in thread
From: Denys Dmytriyenko @ 2020-05-13 17:37 UTC (permalink / raw)
  To: Joshua Watt; +Cc: meta-arm

On Wed, May 13, 2020 at 01:27:48PM -0400, Denys Dmytriyenko wrote:
> On Wed, May 13, 2020 at 10:47:06AM -0500, Joshua Watt wrote:
> > Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
> > the need to set the TFA_BUILD_DIR.
> > 
> > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> > ---
> 
> What are the changes between v1, v2 and v3?

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

Reviewed-by: Denys Dmytriyenko <denys@ti.com>


> >  .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
> >  1 file changed, 18 insertions(+), 14 deletions(-)
> > 
> > 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 e6d48e4..febd8ce 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
> > @@ -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"
> > -- 
> > 2.17.1
> > 
> 
> > 
> 

> 


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

* Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-13 17:33     ` Denys Dmytriyenko
@ 2020-05-13 17:54       ` Joshua Watt
  2020-05-13 21:50         ` Jon Mason
  0 siblings, 1 reply; 29+ messages in thread
From: Joshua Watt @ 2020-05-13 17:54 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-arm


On 5/13/20 12:33 PM, Denys Dmytriyenko wrote:
> On Wed, May 13, 2020 at 10:47:07AM -0500, Joshua Watt wrote:
>> 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 :(

>
>
>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>> ---
>>   .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> 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 febd8ce..4b5da7a 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
>> @@ -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"
>> -- 
>> 2.17.1
>>
>> 

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

* Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
  2020-05-13 17:27     ` Denys Dmytriyenko
@ 2020-05-13 17:57       ` Joshua Watt
  0 siblings, 0 replies; 29+ messages in thread
From: Joshua Watt @ 2020-05-13 17:57 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: meta-arm


On 5/13/20 12:27 PM, Denys Dmytriyenko wrote:
> On Wed, May 13, 2020 at 10:47:06AM -0500, Joshua Watt wrote:
>> Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
>> the need to set the TFA_BUILD_DIR.
>>
>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>> ---
> 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}"


>
>
>>   .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
>>   1 file changed, 18 insertions(+), 14 deletions(-)
>>
>> 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 e6d48e4..febd8ce 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
>> @@ -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"
>> -- 
>> 2.17.1
>>
>> 

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

* Re: [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree
  2020-05-13 17:37       ` Denys Dmytriyenko
@ 2020-05-13 21:49         ` Jon Mason
  0 siblings, 0 replies; 29+ messages in thread
From: Jon Mason @ 2020-05-13 21:49 UTC (permalink / raw)
  To: Denys Dmytriyenko; +Cc: Joshua Watt, meta-arm

On Wed, May 13, 2020 at 01:37:13PM -0400, Denys Dmytriyenko wrote:
> On Wed, May 13, 2020 at 01:27:48PM -0400, Denys Dmytriyenko wrote:
> > On Wed, May 13, 2020 at 10:47:06AM -0500, Joshua Watt wrote:
> > > Use the BUILD_BASE variable to specify an out-of-tree build. Eliminates
> > > the need to set the TFA_BUILD_DIR.
> > > 
> > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> > > ---
> > 
> > What are the changes between v1, v2 and v3?
> 
> I only noticed cd $S; make split...
> 
> Reviewed-by: Denys Dmytriyenko <denys@ti.com>

Pulled in to the master branch.

Thanks,
Jon

> 
> 
> > >  .../trusted-firmware-a/trusted-firmware-a.inc | 32 +++++++++++--------
> > >  1 file changed, 18 insertions(+), 14 deletions(-)
> > > 
> > > 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 e6d48e4..febd8ce 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
> > > @@ -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"
> > > -- 
> > > 2.17.1
> > > 
> > 
> > > 
> > 
> 
> > 
> 

> 


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

* Re: [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory
  2020-05-13 17:54       ` Joshua Watt
@ 2020-05-13 21:50         ` Jon Mason
  0 siblings, 0 replies; 29+ messages in thread
From: Jon Mason @ 2020-05-13 21:50 UTC (permalink / raw)
  To: Joshua Watt; +Cc: Denys Dmytriyenko, meta-arm

On Wed, May 13, 2020 at 12:54:16PM -0500, Joshua Watt wrote:
> 
> On 5/13/20 12:33 PM, Denys Dmytriyenko wrote:
> > On Wed, May 13, 2020 at 10:47:07AM -0500, Joshua Watt wrote:
> > > 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 :(

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

Thanks,
Jon

> 
> > 
> > 
> > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> > > ---
> > >   .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > 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 febd8ce..4b5da7a 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
> > > @@ -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"
> > > -- 
> > > 2.17.1
> > > 
> > > 

> 


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

end of thread, other threads:[~2020-05-13 21:50 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 14:26 [meta-arm][PATCH 0/3] TF-A improvements Joshua Watt
2020-05-11 14:26 ` [meta-arm][PATCH 1/3] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-11 17:53   ` Denys Dmytriyenko
2020-05-11 14:26 ` [meta-arm][PATCH 2/3] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-11 17:45   ` Denys Dmytriyenko
2020-05-11 14:26 ` [meta-arm][PATCH 3/3] trusted-firmware-a: Add recipe for version 2.3 Joshua Watt
2020-05-11 17:41   ` Denys Dmytriyenko
2020-05-12  0:24   ` Jon Mason
2020-05-12  0:28     ` Denys Dmytriyenko
2020-05-12 21:12 ` [meta-arm][PATCH v2 0/2] TF-A Improvements Joshua Watt
2020-05-12 21:12   ` [meta-arm][PATCH v2 1/2] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-12 21:22     ` Ross Burton
2020-05-13  6:36       ` Diego Sueiro
2020-05-13 13:41         ` Ross Burton
2020-05-13  6:22     ` Diego Sueiro
2020-05-12 21:12   ` [meta-arm][PATCH v2 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-13 17:31     ` Denys Dmytriyenko
2020-05-13 15:47 ` [meta-arm][PATCH v3 0/2] TF-A Improvement Joshua Watt
2020-05-13 15:47   ` [meta-arm][PATCH v3 1/2] trusted-firmware-a: Build out of tree Joshua Watt
2020-05-13 16:19     ` Diego Sueiro
2020-05-13 17:27     ` Denys Dmytriyenko
2020-05-13 17:57       ` Joshua Watt
     [not found]     ` <160EA693C79E8869.18093@lists.yoctoproject.org>
2020-05-13 17:37       ` Denys Dmytriyenko
2020-05-13 21:49         ` Jon Mason
2020-05-13 15:47   ` [meta-arm][PATCH v3 2/2] trusted-firmware-a: Install .elf file from subdirectory Joshua Watt
2020-05-13 16:19     ` Diego Sueiro
2020-05-13 17:33     ` Denys Dmytriyenko
2020-05-13 17:54       ` Joshua Watt
2020-05-13 21:50         ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.