diff mbox series

[master,53/53] ti-rtos-firmware: numerous fixes and cleanups

Message ID 20230320112452.2813505-54-denis@denix.org
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series 2023.03 sync up with Dunfell | expand

Commit Message

Denys Dmytriyenko March 20, 2023, 11:24 a.m. UTC
From: Denys Dmytriyenko <denys@konsulko.com>

Doing multiple do_install:prepend overrides does not guarantee the
order - it was observed that signing could fail as it was happening
prior to symlinking to the correct name. Move signing code inside the
main do_install, so the machine-specific do_install:prepend works
correctly.

Also, pass -f flag for symlinking, otherwise it could fail with "file
already exists" error when trying to re-build the recipe again.

Several IPC list/matrix fixes:
* j721e was missing MCU_1_1_FW entry
* j721s2 was also missing MCU_1_1_FW entry
* j721s2 had a second MCU_2_0_FW in place of MCU_3_0_FW
* j784s4 was missing MCU_4_0_FW and MCU_4_1_FW entries

Other minor cleanups and indentation fixes.

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 .../ti-rtos-bin/ti-rtos-firmware.bb           | 63 +++++++++----------
 1 file changed, 31 insertions(+), 32 deletions(-)
diff mbox series

Patch

diff --git a/meta-ti-bsp/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb b/meta-ti-bsp/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
index 9b94a61e..ae7bdb81 100644
--- a/meta-ti-bsp/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
+++ b/meta-ti-bsp/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
@@ -64,105 +64,103 @@  C7X_4_FW   = "ipc_echo_test_c7x_4_release_strip.xe71"
 ETH_FW = "app_remoteswitchcfg_server_strip.xer5f"
 
 DM_FW_LIST = ""
-DM_FW_LIST:am65xx =  ""
 DM_FW_LIST:j721e =   "${DM_FIRMWARE}"
 DM_FW_LIST:j7200 =   "${DM_FIRMWARE}"
 DM_FW_LIST:j721s2 =  "${DM_FIRMWARE}"
+DM_FW_LIST:j784s4 =  "${DM_FIRMWARE}"
+DM_FW_LIST:am65xx =  ""
 DM_FW_LIST:am64xx =  ""
 DM_FW_LIST:am62xx =  "${DM_FIRMWARE}"
 DM_FW_LIST:am62axx = "${DM_FIRMWARE}"
-DM_FW_LIST:j784s4 =  "${DM_FIRMWARE}"
 
 IPC_FW_LIST = ""
-IPC_FW_LIST:am65xx =  "${MCU_1_0_FW} ${MCU_1_1_FW}"
-IPC_FW_LIST:j721e =   "                            ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_3_0_FW} ${MCU_3_1_FW} ${C66_1_FW} ${C66_2_FW} ${C7X_1_FW}"
+IPC_FW_LIST:j721e =   "              ${MCU_1_1_FW} ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_3_0_FW} ${MCU_3_1_FW}                             ${C66_1_FW} ${C66_2_FW} ${C7X_1_FW}"
 IPC_FW_LIST:j7200 =   "              ${MCU_1_1_FW} ${MCU_2_0_FW} ${MCU_2_1_FW}"
-IPC_FW_LIST:j721s2 =  "                            ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_2_0_FW} ${MCU_3_1_FW}                         ${C7X_1_FW} ${C7X_2_FW}"
+IPC_FW_LIST:j721s2 =  "              ${MCU_1_1_FW} ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_3_0_FW} ${MCU_3_1_FW}                                                     ${C7X_1_FW} ${C7X_2_FW}"
+IPC_FW_LIST:j784s4 =  "              ${MCU_1_1_FW} ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_3_0_FW} ${MCU_3_1_FW} ${MCU_4_0_FW} ${MCU_4_1_FW}                         ${C7X_1_FW} ${C7X_2_FW} ${C7X_3_FW} ${C7X_4_FW}"
+IPC_FW_LIST:am65xx =  "${MCU_1_0_FW} ${MCU_1_1_FW}"
 IPC_FW_LIST:am64xx =  "${MCU_1_0_FW} ${MCU_1_1_FW} ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_3_0_FW}"
 IPC_FW_LIST:am62xx =  "                            ${MCU_2_0_FW}"
-IPC_FW_LIST:am62axx = "                            ${MCU_2_0_FW}                                                                   ${C7X_1_FW}"
-IPC_FW_LIST:j784s4 =  "              ${MCU_1_1_FW} ${MCU_2_0_FW} ${MCU_2_1_FW} ${MCU_3_0_FW} ${MCU_3_1_FW}                         ${C7X_1_FW} ${C7X_2_FW} ${C7X_3_FW} ${C7X_4_FW}"
+IPC_FW_LIST:am62axx = "                            ${MCU_2_0_FW}                                                                                               ${C7X_1_FW}"
 
 ETH_FW_LIST = ""
-ETH_FW_LIST:am65xx =  ""
 ETH_FW_LIST:j721e =   "${ETH_FW}"
 ETH_FW_LIST:j7200 =   "${ETH_FW}"
 ETH_FW_LIST:j721s2 =  ""
+ETH_FW_LIST:j784s4 =  "${ETH_FW}"
+ETH_FW_LIST:am65xx =  ""
 ETH_FW_LIST:am64xx =  ""
 ETH_FW_LIST:am62xx =  ""
 ETH_FW_LIST:am62axx = ""
-ETH_FW_LIST:j784s4 =  "${ETH_FW}"
 
 # Update the am64xx ipc binaries to be consistent with other platforms
 do_install:prepend:am64xx() {
         ( cd ${RTOS_IPC_FW_DIR}; \
-                ln -s am64-main-r5f0_0-fw ${MCU_1_0_FW}; \
-                ln -s am64-main-r5f0_1-fw ${MCU_1_1_FW}; \
-                ln -s am64-main-r5f1_0-fw ${MCU_2_0_FW}; \
-                ln -s am64-main-r5f1_1-fw ${MCU_2_1_FW}; \
-                ln -s am64-mcu-m4f0_0-fw ${MCU_3_0_FW}; \
+                ln -sf am64-main-r5f0_0-fw ${MCU_1_0_FW}; \
+                ln -sf am64-main-r5f0_1-fw ${MCU_1_1_FW}; \
+                ln -sf am64-main-r5f1_0-fw ${MCU_2_0_FW}; \
+                ln -sf am64-main-r5f1_1-fw ${MCU_2_1_FW}; \
+                ln -sf am64-mcu-m4f0_0-fw ${MCU_3_0_FW}; \
         )
 }
 
 # Update the am62xx ipc binaries to be consistent with other platforms
 do_install:prepend:am62xx() {
         ( cd ${RTOS_IPC_FW_DIR}; \
-                ln -s am62-mcu-m4f0_0-fw ${MCU_2_0_FW}; \
+                ln -sf am62-mcu-m4f0_0-fw ${MCU_2_0_FW}; \
         )
 }
 
 # Update the am62axx ipc binaries to be consistent with other platforms
 do_install:prepend:am62axx() {
         ( cd ${RTOS_IPC_FW_DIR}; \
-                ln -s am62a-mcu-r5f0_0-fw ${MCU_1_0_FW}; \
+                ln -sf am62a-mcu-r5f0_0-fw ${MCU_2_0_FW}; \
         )
 }
 
-# Sign the firmware
-do_install:prepend() {
+do_install() {
+    # Sign the firmware
     # DM Firmware
     for FW_NAME in ${DM_FW_LIST}
     do
-      ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${RTOS_DM_FW_DIR}/${FW_NAME} ${RTOS_DM_FW_DIR}/${FW_NAME}.signed
+        ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${RTOS_DM_FW_DIR}/${FW_NAME} ${RTOS_DM_FW_DIR}/${FW_NAME}.signed
     done
 
     # IPC Firmware
     for FW_NAME in ${IPC_FW_LIST}
     do
-      ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${RTOS_IPC_FW_DIR}/${FW_NAME} ${RTOS_IPC_FW_DIR}/${FW_NAME}.signed
+        ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${RTOS_IPC_FW_DIR}/${FW_NAME} ${RTOS_IPC_FW_DIR}/${FW_NAME}.signed
     done
 
     # ETH firmware
     for FW_NAME in ${ETH_FW_LIST}
     do
-        ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${RTOS_ETH_FW_DIR}/${FW_NAME} ${RTOS_ETH_FW_DIR}/${FW_NAME}.signed;
+        ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${RTOS_ETH_FW_DIR}/${FW_NAME} ${RTOS_ETH_FW_DIR}/${FW_NAME}.signed
     done
-}
 
-#Install all R5 & DSP ipc echo test binaries in lib/firmware/pdk-ipc, with softlinks up a level
-do_install() {
+    # Install all R5 & DSP ipc echo test binaries in lib/firmware/pdk-ipc, with softlinks up a level
     # DM Firmware
     install -d ${LEGACY_DM_FW_DIR}
     for FW_NAME in ${DM_FW_LIST}
     do
-      install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}        ${LEGACY_DM_FW_DIR}/${FW_NAME}.unsigned
-      install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}.signed ${LEGACY_DM_FW_DIR}/${FW_NAME}
+        install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}        ${LEGACY_DM_FW_DIR}/${FW_NAME}.unsigned
+        install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}.signed ${LEGACY_DM_FW_DIR}/${FW_NAME}
     done
 
     # IPC Firmware
     install -d ${LEGACY_IPC_FW_DIR}
     for FW_NAME in ${IPC_FW_LIST}
     do
-      install -m 0644 ${RTOS_IPC_FW_DIR}/${FW_NAME}        ${LEGACY_IPC_FW_DIR}
-      install -m 0644 ${RTOS_IPC_FW_DIR}/${FW_NAME}.signed ${LEGACY_IPC_FW_DIR}
+        install -m 0644 ${RTOS_IPC_FW_DIR}/${FW_NAME}        ${LEGACY_IPC_FW_DIR}
+        install -m 0644 ${RTOS_IPC_FW_DIR}/${FW_NAME}.signed ${LEGACY_IPC_FW_DIR}
     done
 
     # ETH firmware
     install -d ${LEGACY_ETH_FW_DIR}
     for FW_NAME in ${ETH_FW_LIST}
     do
-      install -m 0644 ${RTOS_ETH_FW_DIR}/${FW_NAME}        ${LEGACY_ETH_FW_DIR}
-      install -m 0644 ${RTOS_ETH_FW_DIR}/${FW_NAME}.signed ${LEGACY_ETH_FW_DIR}
+        install -m 0644 ${RTOS_ETH_FW_DIR}/${FW_NAME}        ${LEGACY_ETH_FW_DIR}
+        install -m 0644 ${RTOS_ETH_FW_DIR}/${FW_NAME}.signed ${LEGACY_ETH_FW_DIR}
     done
 }
 
@@ -171,8 +169,8 @@  do_deploy() {
     install -d ${DEPLOYDIR}
     for FW_NAME in ${DM_FW_LIST}
     do
-      install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}        ${DEPLOYDIR}/${FW_NAME}.unsigned
-      install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}.signed ${DEPLOYDIR}/${FW_NAME}
+        install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}        ${DEPLOYDIR}/${FW_NAME}.unsigned
+        install -m 0644 ${RTOS_DM_FW_DIR}/${FW_NAME}.signed ${DEPLOYDIR}/${FW_NAME}
     done
 }
 
@@ -189,6 +187,7 @@  ALTERNATIVE:${PN}:am64xx = "\
                     am64-main-r5f1_1-fw \
                     am64-mcu-m4f0_0-fw \
                     "
+
 ALTERNATIVE:${PN}:am62xx = "\
                     am62-mcu-m4f0_0-fw \
                     am62-main-r5f0_0-fw \