This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDS64GPEVM: Does AM64x crypto hardware accelarators support u-boot and u-boot spl?

Part Number: TMDS64GPEVM

Hi TI Experts

I am using TMDS64GPEVM with ti-processor-sdk-linux-am64xx-evm-09.00.00.03 sdk version. 

I did a decryption operation with u-boot's AES library on u-boot phase. The size of the data that I'm trying to decrypt is 1mb. Problem is that this decryption process takes too long. I want to accelarate this process with some modules like SA2UL if it is supported in u-boot. (I know that there are some examples in mcu_plus_sdk for baremetal  )

How can I accelarate this? Does am64x crypto hardware accelarators supports u-boot? 

Thanks...

  • Hello,
    SA2_UL crypto IP is not supported @u-boot.
    Best,
    -Hong

  • Hi 

    Is there any way to accelarate this in u-boot? Or Is there a plan for u-boot support?

    Thanks 

  • I did a decryption operation with u-boot's AES library on u-boot phase. The size of the data that I'm trying to decrypt is 1mb. Problem is that this decryption process takes too long.

    1/. Is the profile data shareable when running AES in SW?
    2/. Is running AES lib on R5 or A53?

    Best,
    -Hong

  • Hi 

    1/. Is the profile data shareable when running AES in SW?

    I cannot understand this question. What does "profile data" mean?

    2/. Is running AES lib on R5 or A53?

    Actually, In order to decrypt my data(1 megabyte ), I am using aes_cbc_decrypt_blocks() function in ti-u-boot/lib/aes.c source file. When I invoke this function in ti-u-boot/common/spl/spl_spi.c spl_spi_load_image() function so in the u-boot-spl phase, the decryption process takes too long(approximetly 7-8 second).

    However, when I invoke this function in ti-u-boot/board/ti/am64x/evm.c board_late_init() function so in the u-boot phase, the decryption process takes approximetly 1 second for same 1mb data.

    What is the reason of this difference between u-boot-spl phase and u-boot phase? I know that u-boot-spl is running A53 core.

    Btw I am working on ti-u-boot-2021.01 version

    These are my code implementations.

    spl_spi.c file

    evm.c file

  • Hello Ahmet,
    Thanks for your reply.
    The "profile data" implies the time measurement in your last reply.
    1/. how the data_buffer is allocated in the two cases?
    2/. will you share the full boot log showing measurements of ~7.8s and ~1s?
    Best,
    -Hong

  • Hello  

    1/. how the data_buffer is allocated in the two cases?

    data_buffer is allocated in DDR's unallocated area in both cases. DDR's unallocated area is starting from 0xA4000000. This area is shown in am64x_mcu_plus_sdk document as follows.

    2/. will you share the full boot log showing measurements of ~7.8s and ~1s?

    I didn't actually take a measurement. I said what I observed. 

    Actually, In order to decrypt my data(1 megabyte ), I am using aes_cbc_decrypt_blocks() function in ti-u-boot/lib/aes.c source file. When I invoke this function in ti-u-boot/common/spl/spl_spi.c spl_spi_load_image() function so in the u-boot-spl phase, the decryption process takes too long(approximetly 7-8 second).

    In this case, aes_cbc_decrypt_blocks() takes 7-8 second to run.

    Thanks

  • Hello Ahmet,
    You may refer to the link on AM64x Linux kernel cryto driver data here.
    software-dl.ti.com/.../Crypto.html
    Best,
    -Hong

  • Hi 

    You may refer to the link on AM64x Linux kernel cryto driver data here.

    I guess, since the problem I encountered is in u-boot and u-boot-spl, looking at the kernel crypto module documentation does not mean anything.

    I asked why the same piece of code gives different results when running on the same core(A53) and how I can solve it.

    If there is no solution, Can you provide support for u-boot and u-boot-spl SA2UL crypto hardware accelerator module??

    Thanks...

  • Hello Ahmet,

    SA2_UL crypto IP is not supported @u-boot.

    Here're some options for you.
    - use SW crypto lib as you were testing.
    - port MCU+SDK sa2_ul example to u-boot
    software-dl.ti.com/.../SECURITY_SA2UL_MODULE_PAGE.html

    Alternatively depending on your use case, there's TISCI API available on HS SoC for binary blob integrity verification, plus optional decryption.
    software-dl.ti.com/.../authentication.html
    I'm attaching three log files I captured on AM64x EVM for your reference, where the sample app size is ~59Kbytes
    - am64_sbl_app_gp.log: SBL booting a sample app on GP
    [BOOTLOADER PROFILE] CPU load : 29034us
    - am64_sbl_app_se.log: SBL booting a sample app on HS-SE (app integrity check only)
    [BOOTLOADER PROFILE] CPU load : 128111us
    - am64_sbl_app_se_dec.log: SBL booting a sample app on HS-SE (app integrity check + decryption)
    [BOOTLOADER PROFILE] CPU load : 130072us

    Best,
    -Hong

    DMSC Firmware Version 8.5.3--v08.05.03 (Chill Capybar
    DMSC Firmware revision 0x8
    DMSC ABI revision 3.1
    
    [BOOTLOADER_PROFILE] Boot Media       : SD Card 
    [BOOTLOADER_PROFILE] Boot Image Size  : 59 KB 
    [BOOTLOADER_PROFILE] Cores present    : 
    r5f0-0
    [BOOTLOADER PROFILE] SYSFW init                       :     222124us 
    [BOOTLOADER PROFILE] System_init                      :     594371us 
    [BOOTLOADER PROFILE] Drivers_open                     :      19828us 
    [BOOTLOADER PROFILE] Board_driversOpen                :          0us 
    [BOOTLOADER PROFILE] Sciclient Get Version            :      13137us 
    [BOOTLOADER PROFILE] File read from SD card           :      17672us 
    [BOOTLOADER PROFILE] CPU load                         :      29034us 
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :     896169us 
    
    Image loading done, switching to application ...
    [CRYPTO] AES CBC-256 example started ...
    [CRYPTO] AES CBC-256 example completed!!
    All tests have passed!!
    

    �
    DMSC Firmware Version 8.6.4-v08.06.04 (Chill Capybara
    DMSC Firmware revision 0x8
    DMSC ABI revision 3.1
    
    [BOOTLOADER_PROFILE] Boot Media       : SD Card 
    [BOOTLOADER_PROFILE] Boot Image Size  : 59 KB 
    [BOOTLOADER_PROFILE] Cores present    : 
    r5f0-0
    [BOOTLOADER PROFILE] SYSFW init                       :     228782us 
    [BOOTLOADER PROFILE] System_init                      :     626881us 
    [BOOTLOADER PROFILE] Drivers_open                     :      20989us 
    [BOOTLOADER PROFILE] Board_driversOpen                :          0us 
    [BOOTLOADER PROFILE] Sciclient Get Version            :      13140us 
    [BOOTLOADER PROFILE] File read from SD card           :       8802us 
    [BOOTLOADER PROFILE] CPU load                         :     128111us 
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :    1026710us 
    
    Image loading done, switching to application ...
    [CRYPTO] AES CBC-256 example started ...
    [CRYPTO] AES CBC-256 example completed!!
    All tests have passed!!
    

    �
    DMSC Firmware Version 8.6.4-v08.06.04 (Chill Capybara
    DMSC Firmware revision 0x8
    DMSC ABI revision 3.1
    
    [BOOTLOADER_PROFILE] Boot Media       : SD Card 
    [BOOTLOADER_PROFILE] Boot Image Size  : 59 KB 
    [BOOTLOADER_PROFILE] Cores present    : 
    r5f0-0
    [BOOTLOADER PROFILE] SYSFW init                       :     228782us 
    [BOOTLOADER PROFILE] System_init                      :     620174us 
    [BOOTLOADER PROFILE] Drivers_open                     :      20432us 
    [BOOTLOADER PROFILE] Board_driversOpen                :          0us 
    [BOOTLOADER PROFILE] Sciclient Get Version            :      13146us 
    [BOOTLOADER PROFILE] File read from SD card           :      18214us 
    [BOOTLOADER PROFILE] CPU load                         :     130072us 
    [BOOTLOADER_PROFILE] SBL Total Time Taken             :    1030824us 
    
    Image loading done, switching to application ...
    [CRYPTO] AES CBC-256 example started ...
    [CRYPTO] AES CBC-256 example completed!!
    All tests have passed!!
    

  • Hi

    use SW crypto lib as you were testing.

    Do you mean the crypto lib in the /ti-u-boot/lib//crypto directory? If so, It does not contain anything related to the AES standard in that directory. If not I guess you mean kernel crypto lib. How can I use kernel crypto driver in u-boot's source code? Can you please explain a little more about this?

    port MCU+SDK sa2_ul example to u-boot

    I know that, sa2ul examples is supported for R core. How can I port sa2ul example to u-boot? The link you shared above does not contain any information about u-boot. 

    Thanks

  • In order to decrypt my data(1 megabyte ), I am using aes_cbc_decrypt_blocks() function in ti-u-boot/lib/aes.c source file.

    I thought aes_cbc_decrypt is needed.

    There's no SA2_UL crypto support @u-boot (R5/A53), user need to port it as necessary.
    Best,
    -Hong

  • Hi

    There's no SA2_UL crypto support @u-boot (R5/A53), user need to port it as necessary.

    Why isn't it considered to provide u-boot support? If it is considered, When will this support be provided? I really need this.

    Thanks...

  • Hello Ahmet,
    SAx_UL crypto support @u-boot is not in the current SDK support plan.
    Best,
    -Hong