Skip to contentSkip to conversation

trusted-firmware-a: install/deploy multiple variants of the target

PATCH In review Denys Dmytriyenko 2 participants 4 messages May 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 trusted-firmware-a: install/deploy multiple variants of the target

From: Denys Dmytriyenko <[email protected]>

Installing and deploying .bin and .elf shouldn't be mutually exclusive. There are scenarios where both can be useful - .bin for booting and .elf for debugging.

---
 .../trusted-firmware-a/trusted-firmware-a.inc        | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +15 -5
index 0804689..3ec8c2c 100644
@@ -116,29 +116,39 @@ do_install() {
 
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
+        processes="0"
         if [ "$atfbin" = "all" ]; then
             # Target all is not handled by default
             bberror "all as TFA_INSTALL_TARGET is not handled by do_install"
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
+        fi
+
+        if [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
+            processes="1"
+        fi
+        if [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
             install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f $BUILD_PLAT/$atfbin ]; then
+            processes="1"
+        fi
+        if [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
             install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
-        elif [ "$atfbin" = "dtbs" ]; then
+            processes="1"
+        fi
+
+        if [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
         elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
-        else
+        elif [ "$processed" = "0" ]; then
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
             exit 1
         fi
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 trusted-firmware-a: provide symlinks for canonical names

From: Denys Dmytriyenko <[email protected]>

Some platforms expect canonical names, like bl31.bin, instead of bl31-<plat>.bin Provide symlinks for those as well.

---
 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | 3 +++
 1 file changed, 3 insertions(+)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +3 -0
index 3ec8c2c..2b6cf0a 100644
@@ -129,18 +129,21 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
+            ln -sf $atfbin-${TFA_PLATFORM}.bin ${D}/firmware/$atfbin.bin
             processes="1"
         fi
         if [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
             install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
+            ln -sf $atfbin-${TFA_PLATFORM}.elf ${D}/firmware/$atfbin.elf
             processes="1"
         fi
         if [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
             install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
+            ln -sf $atfbin-${TFA_PLATFORM} ${D}/firmware/$atfbin
             processes="1"
         fi
 
Signature · 1 line
2.7.4
Reviewed-by on v1 2/2
#2 lore raw

Re: [meta-arm] [PATCH 2/2] trusted-firmware-a: provide symlinks for canonical names

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

Quoted 9 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Denys Dmytriyenko via lists.yoctoproject.org
Sent: 14 May 2020 01:00
To: [email protected]
Cc: Denys Dmytriyenko <[email protected]>
Subject: [meta-arm] [PATCH 2/2] trusted-firmware-a: provide symlinks for canonical names

Quoted 6 lines

From: Denys Dmytriyenko <[email protected]>

Some platforms expect canonical names, like bl31.bin, instead of bl31- <plat>.bin Provide symlinks for those as well.

Quoted 35 lines
---
 meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc | 3 +++
 1 file changed, 3 insertions(+)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +5 -1
index 3ec8c2c..2b6cf0a 100644
@@ -129,18 +129,21 @@ do_install() {
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
+            ln -sf $atfbin-${TFA_PLATFORM}.bin
+ ${D}/firmware/$atfbin.bin
             processes="1"
         fi
         if [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
             install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
+            ln -sf $atfbin-${TFA_PLATFORM}.elf
+ ${D}/firmware/$atfbin.elf
             processes="1"
         fi
         if [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
             install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
+            ln -sf $atfbin-${TFA_PLATFORM} ${D}/firmware/$atfbin
             processes="1"
         fi
 
--

2.7.4

Reviewed-by on v1 1/2
#3 lore raw
In reply to Denys Dmytriyenko

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

Quoted 9 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Denys Dmytriyenko via lists.yoctoproject.org
Sent: 14 May 2020 01:00
To: [email protected]
Cc: Denys Dmytriyenko <[email protected]>
Subject: [meta-arm] [PATCH 1/2] trusted-firmware-a: install/deploy multiple variants of the target

Quoted 7 lines

From: Denys Dmytriyenko <[email protected]>

Installing and deploying .bin and .elf shouldn't be mutually exclusive. There are scenarios where both can be useful - .bin for booting and .elf for debugging.

Quoted 55 lines
---
 .../trusted-firmware-a/trusted-firmware-a.inc        | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +15 -6
index 0804689..3ec8c2c 100644
@@ -116,29 +116,39 @@ do_install() {
 
     install -d -m 755 ${D}/firmware
     for atfbin in ${TFA_INSTALL_TARGET}; do
+        processes="0"
         if [ "$atfbin" = "all" ]; then
             # Target all is not handled by default
             bberror "all as TFA_INSTALL_TARGET is not handled by do_install"
             bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
             bberror "rewrite or turn off do_install"
             exit 1
-        elif [ -f $BUILD_PLAT/$atfbin.bin ]; then
+        fi
+
+        if [ -f $BUILD_PLAT/$atfbin.bin ]; then
             echo "Install $atfbin.bin"
             install -m 0644 $BUILD_PLAT/$atfbin.bin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
-        elif [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
+            processes="1"
+        fi
+        if [ -f $BUILD_PLAT/$atfbin/$atfbin.elf ]; then
             echo "Install $atfbin.elf"
             install -m 0644 $BUILD_PLAT/$atfbin/$atfbin.elf \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
-        elif [ -f $BUILD_PLAT/$atfbin ]; then
+            processes="1"
+        fi
+        if [ -f $BUILD_PLAT/$atfbin ]; then
             echo "Install $atfbin"
             install -m 0644 $BUILD_PLAT/$atfbin \
                 ${D}/firmware/$atfbin-${TFA_PLATFORM}
-        elif [ "$atfbin" = "dtbs" ]; then
+            processes="1"
+        fi
+
+        if [ "$atfbin" = "dtbs" ]; then
             echo "dtbs install, skipped"
         elif [ -f ${B}/tools/$atfbin/$atfbin ]; then
             echo "Tools $atfbin install, skipped"
-        else
+        elif [ "$processed" = "0" ]; then
             bberror "Unsupported TFA_INSTALL_TARGET target $atfbin"
             exit 1
         fi
--
Quoted 1 line

2.7.4

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.