diff mbox series

[meta-ti,dunfell] am62xx: Add support for secure RTOS IPC Firmware images

Message ID 20230112112755.10791-1-c-shilwant@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-ti,dunfell] am62xx: Add support for secure RTOS IPC Firmware images | expand

Commit Message

Chirag Shilwant Jan. 12, 2023, 11:27 a.m. UTC
- Let's add support for secure RTOS IPC Firmware images for am62xx. This will sign RTOS IPC Firmware for all EVMs based on am62xx (i.e AM62X and AM62X-LP-EVM)

Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
---
 recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb | 28 +++++++---------------
 1 file changed, 8 insertions(+), 20 deletions(-)

Comments

Ryan Eatmon Jan. 17, 2023, 3:32 p.m. UTC | #1
On 1/12/2023 5:27, Chirag Shilwant wrote:
> - Let's add support for secure RTOS IPC Firmware images for am62xx. This will sign RTOS IPC Firmware for all EVMs based on am62xx (i.e AM62X and AM62X-LP-EVM)
> 
> Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
> ---
>   recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb | 28 +++++++---------------
>   1 file changed, 8 insertions(+), 20 deletions(-)
> 
> diff --git a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
> index 47b29632..72d85a6b 100644
> --- a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
> +++ b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
> @@ -174,20 +174,18 @@ do_install_prepend_am64xx() {
>           )
>   }
>   
> -# Update the am62xx ipc binaries to be consistent with other platforms
> -do_install_prepend_am62xx() {
> -        ( cd ${RTOS_IPC_FW_DIR}; \
> -                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
> -        )
> -}
> -

Why are we removing am62xx-lp-evm?  Is this part of the move to remove 
am62xx-lp-evm and merge everything into am62x-evm?


>   # AM62Q HS-SE support
> -do_install_prepend_am62xx-lp-evm() {
> +do_install_prepend_am62xx() {
>           export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
>           ( cd ${RTOS_DM_FW_DIR}; \
>                   mv ${DM_FIRMWARE} ${DM_FIRMWARE}.unsigned; \
>                   ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${DM_FIRMWARE}.unsigned ${DM_FIRMWARE}; \
>           )
> +        ( cd ${RTOS_IPC_FW_DIR}; \
> +                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
> +                ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f \
> +                    ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed; \
> +        )
>   }
>   
>   #Install all R5 & DSP ipc echo test binaries in lib/firmware/pdk-ipc, with softlinks up a level
> @@ -361,13 +359,8 @@ do_install_am64xx() {
>   do_install_am62xx() {
>       install -d ${LEGACY_IPC_FW_DIR}
>       install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
> -    # DM Firmware
> -    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
> -}
> -
> -do_install_am62xx-lp-evm() {
> -    install -d ${LEGACY_IPC_FW_DIR}
> -    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
> +    # Signed Firmware
> +    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed ${LEGACY_IPC_FW_DIR}
>       # DM Firmware
>       install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
>   }
> @@ -389,11 +382,6 @@ do_deploy_am62xx() {
>       install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
>   }
>   
> -do_deploy_am62xx-lp-evm() {
> -    install -d ${DEPLOYDIR}
> -    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
> -}
> -
>   do_deploy_am62axx() {
>       install -d ${DEPLOYDIR}
>       install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
Chirag Shilwant Jan. 18, 2023, 4:58 a.m. UTC | #2
> Why are we removing am62xx-lp-evm?  Is this part of the move to remove am62xx-lp-evm and merge everything into am62x-evm?

- The SOC for both platforms am62xx-evm and am62xx-lp-evm are same (i.e am62xx). So if we have 2 separate functions and we build am62xx-lp-evm it will execute both do_install_prepend_am62xx() and do_install_prepend_am62xx-lp-evm() resulting in build failure as we have the same 
		"mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f;" 
in both function (the first function executing used to rename the ipc fw and the second function won't find it).

- As the content are same for both the platforms, combining them as a single function with SOC will apply the same changes to both am62xx-lp-evm (as PLAT_SFX_am62xx-lp-evm = "am62xx") and am62xx-evm.

-----Original Message-----
From: Eatmon, Ryan <reatmon@ti.com> 
Sent: Tuesday, January 17, 2023 9:02 PM
To: Shilwant, Chirag <c-shilwant@ti.com>; Bajjuri, Praneeth <praneeth@ti.com>; Denys Dmytriyenko <denis@denix.org>; meta-ti@lists.yoctoproject.org
Cc: Adivi, Sai Sree Kartheek <s-adivi@ti.com>; Bhagat, Paresh <p-bhagat@ti.com>; Gupta, Gyan <g-gupta@ti.com>
Subject: Re: [meta-ti][dunfell][PATCH] am62xx: Add support for secure RTOS IPC Firmware images



On 1/12/2023 5:27, Chirag Shilwant wrote:
> - Let's add support for secure RTOS IPC Firmware images for am62xx. 
> This will sign RTOS IPC Firmware for all EVMs based on am62xx (i.e 
> AM62X and AM62X-LP-EVM)
> 
> Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
> ---
>   recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb | 28 +++++++---------------
>   1 file changed, 8 insertions(+), 20 deletions(-)
> 
> diff --git a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb 
> b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
> index 47b29632..72d85a6b 100644
> --- a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
> +++ b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
> @@ -174,20 +174,18 @@ do_install_prepend_am64xx() {
>           )
>   }
>   
> -# Update the am62xx ipc binaries to be consistent with other 
> platforms
> -do_install_prepend_am62xx() {
> -        ( cd ${RTOS_IPC_FW_DIR}; \
> -                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
> -        )
> -}
> -

Why are we removing am62xx-lp-evm?  Is this part of the move to remove am62xx-lp-evm and merge everything into am62x-evm?


>   # AM62Q HS-SE support
> -do_install_prepend_am62xx-lp-evm() {
> +do_install_prepend_am62xx() {
>           export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
>           ( cd ${RTOS_DM_FW_DIR}; \
>                   mv ${DM_FIRMWARE} ${DM_FIRMWARE}.unsigned; \
>                   ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${DM_FIRMWARE}.unsigned ${DM_FIRMWARE}; \
>           )
> +        ( cd ${RTOS_IPC_FW_DIR}; \
> +                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
> +                ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f \
> +                    ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed; \
> +        )
>   }
>   
>   #Install all R5 & DSP ipc echo test binaries in lib/firmware/pdk-ipc, with softlinks up a level
> @@ -361,13 +359,8 @@ do_install_am64xx() {
>   do_install_am62xx() {
>       install -d ${LEGACY_IPC_FW_DIR}
>       install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
> -    # DM Firmware
> -    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
> -}
> -
> -do_install_am62xx-lp-evm() {
> -    install -d ${LEGACY_IPC_FW_DIR}
> -    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
> +    # Signed Firmware
> +    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed ${LEGACY_IPC_FW_DIR}
>       # DM Firmware
>       install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
>   }
> @@ -389,11 +382,6 @@ do_deploy_am62xx() {
>       install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
>   }
>   
> -do_deploy_am62xx-lp-evm() {
> -    install -d ${DEPLOYDIR}
> -    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
> -}
> -
>   do_deploy_am62axx() {
>       install -d ${DEPLOYDIR}
>       install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}

-- 
Ryan Eatmon                reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
Ryan Eatmon Jan. 18, 2023, 4:54 p.m. UTC | #3
On 1/17/2023 22:58, Shilwant, Chirag wrote:
>> Why are we removing am62xx-lp-evm?  Is this part of the move to remove am62xx-lp-evm and merge everything into am62x-evm?
> 
> - The SOC for both platforms am62xx-evm and am62xx-lp-evm are same (i.e am62xx). So if we have 2 separate functions and we build am62xx-lp-evm it will execute both do_install_prepend_am62xx() and do_install_prepend_am62xx-lp-evm() resulting in build failure as we have the same
> 		"mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f;"
> in both function (the first function executing used to rename the ipc fw and the second function won't find it).
> 
> - As the content are same for both the platforms, combining them as a single function with SOC will apply the same changes to both am62xx-lp-evm (as PLAT_SFX_am62xx-lp-evm = "am62xx") and am62xx-evm.

Thanks.


> -----Original Message-----
> From: Eatmon, Ryan <reatmon@ti.com>
> Sent: Tuesday, January 17, 2023 9:02 PM
> To: Shilwant, Chirag <c-shilwant@ti.com>; Bajjuri, Praneeth <praneeth@ti.com>; Denys Dmytriyenko <denis@denix.org>; meta-ti@lists.yoctoproject.org
> Cc: Adivi, Sai Sree Kartheek <s-adivi@ti.com>; Bhagat, Paresh <p-bhagat@ti.com>; Gupta, Gyan <g-gupta@ti.com>
> Subject: Re: [meta-ti][dunfell][PATCH] am62xx: Add support for secure RTOS IPC Firmware images
> 
> 
> 
> On 1/12/2023 5:27, Chirag Shilwant wrote:
>> - Let's add support for secure RTOS IPC Firmware images for am62xx.
>> This will sign RTOS IPC Firmware for all EVMs based on am62xx (i.e
>> AM62X and AM62X-LP-EVM)
>>
>> Signed-off-by: Chirag Shilwant <c-shilwant@ti.com>
>> ---
>>    recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb | 28 +++++++---------------
>>    1 file changed, 8 insertions(+), 20 deletions(-)
>>
>> diff --git a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
>> b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
>> index 47b29632..72d85a6b 100644
>> --- a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
>> +++ b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
>> @@ -174,20 +174,18 @@ do_install_prepend_am64xx() {
>>            )
>>    }
>>    
>> -# Update the am62xx ipc binaries to be consistent with other
>> platforms
>> -do_install_prepend_am62xx() {
>> -        ( cd ${RTOS_IPC_FW_DIR}; \
>> -                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
>> -        )
>> -}
>> -
> 
> Why are we removing am62xx-lp-evm?  Is this part of the move to remove am62xx-lp-evm and merge everything into am62x-evm?
> 
> 
>>    # AM62Q HS-SE support
>> -do_install_prepend_am62xx-lp-evm() {
>> +do_install_prepend_am62xx() {
>>            export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
>>            ( cd ${RTOS_DM_FW_DIR}; \
>>                    mv ${DM_FIRMWARE} ${DM_FIRMWARE}.unsigned; \
>>                    ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${DM_FIRMWARE}.unsigned ${DM_FIRMWARE}; \
>>            )
>> +        ( cd ${RTOS_IPC_FW_DIR}; \
>> +                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
>> +                ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f \
>> +                    ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed; \
>> +        )
>>    }
>>    
>>    #Install all R5 & DSP ipc echo test binaries in lib/firmware/pdk-ipc, with softlinks up a level
>> @@ -361,13 +359,8 @@ do_install_am64xx() {
>>    do_install_am62xx() {
>>        install -d ${LEGACY_IPC_FW_DIR}
>>        install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
>> -    # DM Firmware
>> -    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
>> -}
>> -
>> -do_install_am62xx-lp-evm() {
>> -    install -d ${LEGACY_IPC_FW_DIR}
>> -    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
>> +    # Signed Firmware
>> +    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed ${LEGACY_IPC_FW_DIR}
>>        # DM Firmware
>>        install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
>>    }
>> @@ -389,11 +382,6 @@ do_deploy_am62xx() {
>>        install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
>>    }
>>    
>> -do_deploy_am62xx-lp-evm() {
>> -    install -d ${DEPLOYDIR}
>> -    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
>> -}
>> -
>>    do_deploy_am62axx() {
>>        install -d ${DEPLOYDIR}
>>        install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
>
diff mbox series

Patch

diff --git a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
index 47b29632..72d85a6b 100644
--- a/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
+++ b/recipes-ti/ti-rtos-bin/ti-rtos-firmware.bb
@@ -174,20 +174,18 @@  do_install_prepend_am64xx() {
         )
 }
 
-# Update the am62xx ipc binaries to be consistent with other platforms
-do_install_prepend_am62xx() {
-        ( cd ${RTOS_IPC_FW_DIR}; \
-                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
-        )
-}
-
 # AM62Q HS-SE support
-do_install_prepend_am62xx-lp-evm() {
+do_install_prepend_am62xx() {
         export TI_SECURE_DEV_PKG=${TI_SECURE_DEV_PKG}
         ( cd ${RTOS_DM_FW_DIR}; \
                 mv ${DM_FIRMWARE} ${DM_FIRMWARE}.unsigned; \
                 ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ${DM_FIRMWARE}.unsigned ${DM_FIRMWARE}; \
         )
+        ( cd ${RTOS_IPC_FW_DIR}; \
+                mv am62-mcu-m4f0_0-fw ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f; \
+                ${TI_SECURE_DEV_PKG}/scripts/secure-binary-image.sh ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f \
+                    ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed; \
+        )
 }
 
 #Install all R5 & DSP ipc echo test binaries in lib/firmware/pdk-ipc, with softlinks up a level
@@ -361,13 +359,8 @@  do_install_am64xx() {
 do_install_am62xx() {
     install -d ${LEGACY_IPC_FW_DIR}
     install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
-    # DM Firmware
-    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR}
-}
-
-do_install_am62xx-lp-evm() {
-    install -d ${LEGACY_IPC_FW_DIR}
-    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f ${LEGACY_IPC_FW_DIR}
+    # Signed Firmware
+    install -m 0644 ${RTOS_IPC_FW_DIR}/ipc_echo_baremetal_test_mcu2_0_release_strip.xer5f.signed ${LEGACY_IPC_FW_DIR}
     # DM Firmware
     install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${LEGACY_DM_FW_DIR} 
 }
@@ -389,11 +382,6 @@  do_deploy_am62xx() {
     install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
 }
 
-do_deploy_am62xx-lp-evm() {
-    install -d ${DEPLOYDIR}
-    install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}
-}
-
 do_deploy_am62axx() {
     install -d ${DEPLOYDIR}
     install -m 0644 ${RTOS_DM_FW_DIR}/ipc_echo_testb_mcu1_0_release_strip.xer5f ${DEPLOYDIR}