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.

AM6421: AM64x secure boot supported in SDK 10.00

Part Number: AM6421
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

We are using AM6421 with SDK 10.00.

We need to develop secure boot feature on AM6421 with SDK 10.00. But we got information from TI expert: The encrypted boot is supported starting the SDK v10_01_00_32.

All our designs were based on SDK10.00. If we update SDK with latest version, we need unacceptable efforts to retest our designs.

Supports needs:

Could TI experts explain the method of SDK upgrade for some special features, like secure boot?

We want to have secure boot features in TI SDK. How to upgrade secure boot feature in TI SDK v10.00.00?

Thanks in advance.

  • Hello,

    The following patches brings the support for encrypted boot from OSPI in the SDK v10.1.

    MCU_PLUS_SDK

    https://github.com/TexasInstruments/mcupsdk-core

    ❯ pwd
    /home/p-shivhare/ti/github/mcupsdk-core
    ❯ git log --oneline --grep "SITSW-5228" | cat
    167b8def56 am64x/am243x: docs: Update documentation for secure ospi boot
    59a8fd38f2 am64x: tools: Update linux image generation makefile
    4232d4c2e8 am243x: sbl_ospi: Fix issue in encrypted secure boot
    b9ae2a094c am64x: sbl_ospi: Fix issue in encrypted secure boot
    eb75014082 am64x/am243x: bootloader: Add ospi secure boot support

    SYSCONFIG

    https://github.com/TexasInstruments/mcupsdk-sysconfig

    ❯ pwd
    /home/p-shivhare/ti/github/mcupsdk-sysconfig
    ❯ git log --oneline --grep "SITSW-5228" | cat
    66f788f am64x/am243x: bootloader: Fix sbl ospi issue in hsse devices

    You may backport these patches to whichever SDK version you are using.

    Regards,

    Prashant

  • Hi Prashant,

    two questions:

    1. I can support secure boot with just these modifications winthin SDK? with no need change on dmsc's related code? 

    ❯ git log --oneline --grep "SITSW-5228" | cat
    167b8def56 am64x/am243x: docs: Update documentation for secure ospi boot
    59a8fd38f2 am64x: tools: Update linux image generation makefile
    4232d4c2e8 am243x: sbl_ospi: Fix issue in encrypted secure boot
    b9ae2a094c am64x: sbl_ospi: Fix issue in encrypted secure boot
    eb75014082 am64x/am243x: bootloader: Add ospi secure boot support

    2. with step 1's changes, which version of sysconfig I can use to get secure boot support? can I use 'sysconfig_1.22.0'?

  • 1. I can support secure boot with just these modifications winthin SDK? with no need change on dmsc's related code? 

    Yes, the limitation was from the SDK only not SYSFW.

    2. with step 1's changes, which version of sysconfig I can use to get secure boot support? can I use 'sysconfig_1.22.0'?

    That SYSCONFIG did not mean the Sysconfig tool. That repository contains the metadata files for the sysconfig tool. These files tells sysconfig what all to show and how to autogenerate the code. That repository is integrated in the SDK (source/sysconfig) at the release time.

  • Hi Prashant,

    For 'https://github.com/TexasInstruments/mcupsdk-sysconfig'

    I don't know how to patch this change into my local environment. 

  • Hi Prashant,

    I tried to patch 'eb75014082 am64x/am243x: bootloader: Add ospi secure boot support', because the pre-commit is far more way to our SDK, there's risk for me to directly patch it.

    As you are expert to the secure boot functionality, would you help to give me all-in-one secure-boot patch, which suits for our SDK(mcu_plus_sdk_am64x_10_00_00_20) and sysCfg(sysconfig_1.20.0).

  • Hello,

    The following patches brings the support for encrypted boot from OSPI in the SDK v10.1.

    Those patches (only the relevant ones as the commits 167b8def56 updates the documentation only and the commit 4232d4c2e8 is for AM243) are directly applicable to the SDK v10.00.00.20.

    However, it seems that there are more commits (not tagged with the JIRA ID SITSW-5228) that are required here. So, I have backported all the required patches to the SDK v10.00.00.20.

    PFA the one patch that should enable the feature:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_am64x_2D00_ospi_2D00_enable_2D00_encrypted_2D00_boot_2D00_support.patch

    From d45389165dc5ba1c8150df392de549ff7ae16c49 Mon Sep 17 00:00:00 2001
    From: Prashant Shivhare <p-shivhare@ti.com>
    Date: Fri, 9 May 2025 12:44:22 +0530
    Subject: [PATCH] am64x: ospi: enable encrypted boot support
    
    In the MCU+ SDK v10.01.00.32, the encrypted boot support from OSPI is
    added with the following patches:
    
    MCUPSDK-CORE: https://github.com/TexasInstruments/mcupsdk-core
        - 59a8fd38f2 am64x: tools: Update linux image generation makefile
        - b9ae2a094c am64x: sbl_ospi: Fix issue in encrypted secure boot
        - eb75014082 am64x/am243x: bootloader: Add ospi secure boot support
        - a598226760 am65x: r5f: Add sbl ospi support.
    
    SYSCONFIG: https://github.com/TexasInstruments/mcupsdk-sysconfig
        - 66f788f am64x/am243x: bootloader: Fix sbl ospi issue in hsse devices
        - 5f947be am65x: r5f: Enable bootloader scratch memory
    
    This commit backports these pathces to the MCU+ SDK v10.00.00.20.
    
    Signed-off-by: Prashant Shivhare <p-shivhare@ti.com>
    ---
     .../am64x-evm/r5fss0-0_nortos/example.syscfg  | 29 ++++++-
     .../sbl_ospi/am64x-evm/r5fss0-0_nortos/main.c |  9 ++
     .../default_sbl_ospi_linux.cfg                |  3 +
     .../default_sbl_ospi_linux_hs.cfg             |  3 +
     .../am64x-evm/r5fss0-0_nortos/example.syscfg  | 85 +++++++++++-------
     .../am64x-evm/r5fss0-0_nortos/main.c          | 87 +++++--------------
     .../am64x-evm/r5fss0-0_nortos/example.syscfg  | 23 ++++-
     .../am64x-evm/r5fss0-0_nortos/main.c          | 13 +++
     source/drivers/bootloader.h                   |  8 +-
     source/drivers/bootloader/bootloader.c        | 14 ++-
     .../soc/am64x_am243x/bootloader_soc.h         |  3 +
     .../templates/bootloader_config.c.xdt         |  5 ++
     tools/boot/linuxAppimageGen/config.mak        |  7 +-
     tools/boot/linuxAppimageGen/makefile          |  4 +
     14 files changed, 183 insertions(+), 110 deletions(-)
    
    diff --git a/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/example.syscfg b/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/example.syscfg
    index 9f5e30531c..857d38ce12 100644
    --- a/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/example.syscfg
    +++ b/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/example.syscfg
    @@ -1,8 +1,9 @@
     /**
      * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
      * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    - * @cliArgs --device "AM64x" --package "ALV" --part "Default" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    - * @versions {"tool":"1.17.0+3128"}
    + * @cliArgs --device "AM64x" --part "Default" --package "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    + * @v2CliArgs --device "AM6442" --package "FCBGA (ALV)" --variant "AM6442-D" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    + * @versions {"tool":"1.21.0+3721"}
      */
     
     /**
    @@ -15,7 +16,7 @@ const bootloader1     = bootloader.addInstance();
     const ddr             = scripting.addModule("/drivers/ddr/ddr", {}, false);
     const ddr1            = ddr.addInstance();
     const debug_log       = scripting.addModule("/kernel/dpl/debug_log");
    -const dpl_cfg = scripting.addModule("/kernel/dpl/dpl_cfg");
    +const dpl_cfg         = scripting.addModule("/kernel/dpl/dpl_cfg");
     const mpu_armv7       = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
     const mpu_armv71      = mpu_armv7.addInstance();
     const mpu_armv72      = mpu_armv7.addInstance();
    @@ -33,6 +34,7 @@ const section1        = section.addInstance();
     const section2        = section.addInstance();
     const section3        = section.addInstance();
     const section4        = section.addInstance();
    +const section5        = section.addInstance();
     
     /**
      * Write custom configuration values to the imported modules.
    @@ -62,6 +64,11 @@ debug_log.uartLog.$name        = "CONFIG_UART0";
     debug_log.uartLog.intrEnable   = "DISABLE";
     debug_log.uartLog.UART.$assign = "USART0";
     
    +const uart_v0_template  = scripting.addModule("/drivers/uart/v0/uart_v0_template", {}, false);
    +const uart_v0_template1 = uart_v0_template.addInstance({}, false);
    +uart_v0_template1.$name = "drivers_uart_v0_uart_v0_template0";
    +debug_log.uartLog.child = uart_v0_template1;
    +
     mpu_armv71.$name             = "CONFIG_MPU_REGION0";
     mpu_armv71.size              = 31;
     mpu_armv71.attributes        = "Device";
    @@ -95,7 +102,7 @@ general1.svc_stack_size = 256;
     general1.linker.$name   = "TIARMCLANG0";
     
     region1.$name                               = "MEMORY_REGION_CONFIGURATION0";
    -region1.memory_region.create(6);
    +region1.memory_region.create(7);
     region1.memory_region[0].type               = "TCMA_R5F";
     region1.memory_region[0].$name              = "R5F_VECS";
     region1.memory_region[0].size               = 0x40;
    @@ -117,6 +124,11 @@ region1.memory_region[5].$name              = "MSRAM_1";
     region1.memory_region[5].auto               = false;
     region1.memory_region[5].size               = 0x10000;
     region1.memory_region[5].manualStartAddress = 0x70070000;
    +region1.memory_region[6].size               = 0x800000;
    +region1.memory_region[6].type               = "CUSTOM_ALL";
    +region1.memory_region[6].auto               = false;
    +region1.memory_region[6].manualStartAddress = 0x82000000;
    +region1.memory_region[6].$name              = "APPIMAGE";
     
     section1.$name                        = "Vector Table";
     section1.group                        = false;
    @@ -185,6 +197,15 @@ section4.output_section[4].output_sections_end    = "__UNDEFINED_STACK_END";
     section4.output_section[4].input_section.create(1);
     section4.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;";
     
    +section5.type                         = "NOLOAD";
    +section5.load_memory                  = "APPIMAGE";
    +section5.$name                        = "DDR";
    +section5.group                        = false;
    +section5.output_section.create(1);
    +section5.output_section[0].$name      = ".bss.app";
    +section5.output_section[0].alignment  = 0;
    +section5.output_section[0].macro_name = "BSSAPP_SECTION";
    +
     /**
      * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
      * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
    diff --git a/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/main.c b/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/main.c
    index 4c5d8a256e..6c2e27e7be 100644
    --- a/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/main.c
    +++ b/examples/drivers/boot/sbl_ospi/am64x-evm/r5fss0-0_nortos/main.c
    @@ -40,6 +40,12 @@
     
     #define FLASH_RESET_USEC (100U)
     
    +/* This buffer needs to be defined for OSPI boot in case of HS device for
    + * image decryption and authentication
    + * The size of the buffer should be large enough to accomodate the appimage
    + */
    +uint8_t gAppimage[0x800000] __attribute__ ((section (".app"), aligned (4096)));
    +
     void flashFixUpOspiBoot(OSPI_Handle oHandle);
     
     /* call this API to stop the booting process and spin, do that you can connect
    @@ -131,6 +137,7 @@ int main(void)
             Bootloader_BootImageInfo bootImageInfo;
             Bootloader_Params bootParams;
             Bootloader_Handle bootHandle;
    +        Bootloader_Config *bootConfig;
     
             Bootloader_Params_init(&bootParams);
             Bootloader_BootImageInfo_init(&bootImageInfo);
    @@ -140,6 +147,8 @@ int main(void)
             {
                 /* Initialize PRU Cores if applicable */
                 Bootloader_Config *cfg = (Bootloader_Config *)bootHandle;
    +            bootConfig = (Bootloader_Config *)bootHandle;
    +            bootConfig->scratchMemPtr = gAppimage;
                 if(TRUE == cfg->initICSSCores)
                 {
                     status = Bootloader_socEnableICSSCores(BOOTLOADER_ICSS_CORE_DEFAULT_FREQUENCY);
    diff --git a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux.cfg b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux.cfg
    index 678c3ff9b3..5cf2e15368 100644
    --- a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux.cfg
    +++ b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux.cfg
    @@ -29,6 +29,9 @@
     # Linux image is flashed at 0x800000 or to whatever offset your bootloader is configured for
     --file=../../tools/boot/linuxAppimageGen/linux.appimage --operation=flash --flash-offset=0x800000
     
    +# u-boot.img is flashed at 0x300000
    +--file=../../tools/boot/linuxAppimageGen/u-boot.img --operation=flash --flash-offset=0x300000
    +
     # send the XIP image for this application, no need to specify flash offset since flash offset is specified within the image itself
     #--file=../../examples/drivers/ipc/ipc_rpmsg_echo/am64x-evm/system_freertos_nortos/ipc_rpmsg_echo_system.release.appimage_xip --operation=flash-xip
     
    diff --git a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux_hs.cfg b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux_hs.cfg
    index 8061b09182..bc79a24658 100644
    --- a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux_hs.cfg
    +++ b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/default_sbl_ospi_linux_hs.cfg
    @@ -30,6 +30,9 @@
     # Linux image is flashed at 0x800000 or to whatever offset your bootloader is configured for
     --file=../../tools/boot/linuxAppimageGen/linux.appimage.hs --operation=flash --flash-offset=0x800000
     
    +# u-boot.img is flashed at 0x300000
    +--file=../../tools/boot/linuxAppimageGen/u-boot.img --operation=flash --flash-offset=0x300000
    +
     # send the XIP image for this application, no need to specify flash offset since flash offset is specified within the image itself
     #--file=../../examples/drivers/ipc/ipc_rpmsg_echo/am64x-evm/system_freertos_nortos/ipc_rpmsg_echo_system.release.appimage_xip --operation=flash-xip
     
    diff --git a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/example.syscfg b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/example.syscfg
    index 253acd49b8..f965aa587f 100644
    --- a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/example.syscfg
    +++ b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/example.syscfg
    @@ -1,30 +1,30 @@
     /**
      * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
      * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    - * @cliArgs --device "AM64x" --package "ALV" --part "Default" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    - * @versions {"tool":"1.17.0+3128"}
    + * @cliArgs --device "AM64x" --part "Default" --package "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    + * @v2CliArgs --device "AM6442" --package "FCBGA (ALV)" --variant "AM6442-D" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    + * @versions {"tool":"1.21.0+3721"}
      */
     
     /**
      * Import the modules used in this configuration.
      */
    -const flash       = scripting.addModule("/board/flash/flash", {}, false);
    -const flash1      = flash.addInstance();
    -const bootloader  = scripting.addModule("/drivers/bootloader/bootloader", {}, false);
    -const bootloader1 = bootloader.addInstance();
    -const bootloader2 = bootloader.addInstance();
    -const ddr         = scripting.addModule("/drivers/ddr/ddr", {}, false);
    -const ddr1        = ddr.addInstance();
    -const gtc         = scripting.addModule("/drivers/gtc/gtc");
    -const debug_log   = scripting.addModule("/kernel/dpl/debug_log");
    -const dpl_cfg = scripting.addModule("/kernel/dpl/dpl_cfg");
    -const mpu_armv7   = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    -const mpu_armv71  = mpu_armv7.addInstance();
    -const mpu_armv72  = mpu_armv7.addInstance();
    -const mpu_armv73  = mpu_armv7.addInstance();
    -const mpu_armv74  = mpu_armv7.addInstance();
    -const mpu_armv75  = mpu_armv7.addInstance();
    -
    +const flash           = scripting.addModule("/board/flash/flash", {}, false);
    +const flash1          = flash.addInstance();
    +const bootloader      = scripting.addModule("/drivers/bootloader/bootloader", {}, false);
    +const bootloader1     = bootloader.addInstance();
    +const bootloader2     = bootloader.addInstance();
    +const ddr             = scripting.addModule("/drivers/ddr/ddr", {}, false);
    +const ddr1            = ddr.addInstance();
    +const gtc             = scripting.addModule("/drivers/gtc/gtc");
    +const debug_log       = scripting.addModule("/kernel/dpl/debug_log");
    +const dpl_cfg         = scripting.addModule("/kernel/dpl/dpl_cfg");
    +const mpu_armv7       = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    +const mpu_armv71      = mpu_armv7.addInstance();
    +const mpu_armv72      = mpu_armv7.addInstance();
    +const mpu_armv73      = mpu_armv7.addInstance();
    +const mpu_armv74      = mpu_armv7.addInstance();
    +const mpu_armv75      = mpu_armv7.addInstance();
     const default_linker  = scripting.addModule("/memory_configurator/default_linker", {}, false);
     const default_linker1 = default_linker.addInstance();
     const general         = scripting.addModule("/memory_configurator/general", {}, false);
    @@ -36,6 +36,7 @@ const section1        = section.addInstance();
     const section2        = section.addInstance();
     const section3        = section.addInstance();
     const section4        = section.addInstance();
    +const section5        = section.addInstance();
     
     /**
      * Write custom configuration values to the imported modules.
    @@ -69,6 +70,11 @@ debug_log.uartLog.$name        = "CONFIG_UART0";
     debug_log.uartLog.intrEnable   = "DISABLE";
     debug_log.uartLog.UART.$assign = "USART0";
     
    +const uart_v0_template  = scripting.addModule("/drivers/uart/v0/uart_v0_template", {}, false);
    +const uart_v0_template1 = uart_v0_template.addInstance({}, false);
    +uart_v0_template1.$name = "drivers_uart_v0_uart_v0_template0";
    +debug_log.uartLog.child = uart_v0_template1;
    +
     mpu_armv71.$name             = "CONFIG_MPU_REGION0";
     mpu_armv71.size              = 31;
     mpu_armv71.attributes        = "Device";
    @@ -102,7 +108,7 @@ general1.svc_stack_size = 256;
     general1.linker.$name   = "TIARMCLANG0";
     
     region1.$name                               = "MEMORY_REGION_CONFIGURATION0";
    -region1.memory_region.create(6);
    +region1.memory_region.create(7);
     region1.memory_region[0].type               = "TCMA_R5F";
     region1.memory_region[0].$name              = "R5F_VECS";
     region1.memory_region[0].size               = 0x40;
    @@ -124,6 +130,11 @@ region1.memory_region[5].$name              = "MSRAM_1";
     region1.memory_region[5].auto               = false;
     region1.memory_region[5].size               = 0x10000;
     region1.memory_region[5].manualStartAddress = 0x70070000;
    +region1.memory_region[6].type               = "CUSTOM_ALL";
    +region1.memory_region[6].$name              = "APPIMAGE";
    +region1.memory_region[6].auto               = false;
    +region1.memory_region[6].manualStartAddress = 0x82000000;
    +region1.memory_region[6].size               = 0x800000;
     
     section1.$name                        = "Vector Table";
     section1.group                        = false;
    @@ -192,22 +203,30 @@ section4.output_section[4].output_sections_end    = "__UNDEFINED_STACK_END";
     section4.output_section[4].input_section.create(1);
     section4.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;";
     
    +section5.type                        = "NOLOAD";
    +section5.group                       = false;
    +section5.load_memory                 = "APPIMAGE";
    +section5.$name                       = "BSSAPP_SECTION";
    +section5.output_section.create(1);
    +section5.output_section[0].$name     = ".bss.app";
    +section5.output_section[0].alignment = 0;
    +
     /**
      * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
      * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
      * re-solve from scratch.
      */
     flash1.peripheralDriver.OSPI.$suggestSolution      = "OSPI0";
    -flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "ball.N20";
    -flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "ball.L19";
    -flash1.peripheralDriver.OSPI.DQS.$suggestSolution  = "ball.N19";
    -flash1.peripheralDriver.OSPI.D7.$suggestSolution   = "ball.M17";
    -flash1.peripheralDriver.OSPI.D6.$suggestSolution   = "ball.N18";
    -flash1.peripheralDriver.OSPI.D5.$suggestSolution   = "ball.P20";
    -flash1.peripheralDriver.OSPI.D4.$suggestSolution   = "ball.P21";
    -flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "ball.M21";
    -flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "ball.M20";
    -flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "ball.M18";
    -flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "ball.M19";
    -debug_log.uartLog.UART.RXD.$suggestSolution        = "ball.D15";
    -debug_log.uartLog.UART.TXD.$suggestSolution        = "ball.C16";
    +flash1.peripheralDriver.OSPI.CLK.$suggestSolution  = "OSPI0_CLK";
    +flash1.peripheralDriver.OSPI.CSn0.$suggestSolution = "OSPI0_CSn0";
    +flash1.peripheralDriver.OSPI.DQS.$suggestSolution  = "OSPI0_DQS";
    +flash1.peripheralDriver.OSPI.D7.$suggestSolution   = "OSPI0_D7";
    +flash1.peripheralDriver.OSPI.D6.$suggestSolution   = "OSPI0_D6";
    +flash1.peripheralDriver.OSPI.D5.$suggestSolution   = "OSPI0_D5";
    +flash1.peripheralDriver.OSPI.D4.$suggestSolution   = "OSPI0_D4";
    +flash1.peripheralDriver.OSPI.D3.$suggestSolution   = "OSPI0_D3";
    +flash1.peripheralDriver.OSPI.D2.$suggestSolution   = "OSPI0_D2";
    +flash1.peripheralDriver.OSPI.D1.$suggestSolution   = "OSPI0_D1";
    +flash1.peripheralDriver.OSPI.D0.$suggestSolution   = "OSPI0_D0";
    +debug_log.uartLog.UART.RXD.$suggestSolution        = "UART0_RXD";
    +debug_log.uartLog.UART.TXD.$suggestSolution        = "UART0_TXD";
    diff --git a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/main.c b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/main.c
    index d2608d9b24..8c1fad795f 100644
    --- a/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/main.c
    +++ b/examples/drivers/boot/sbl_ospi_linux/am64x-evm/r5fss0-0_nortos/main.c
    @@ -39,52 +39,6 @@
     #include <drivers/pinmux.h>
     #include <drivers/gtc.h>
     
    -/* Workaround to initialize MMC SD Pinmux (Later will be done in SPL) */
    -static Pinmux_PerCfg_t gPinMuxMMCSDCfg[] = {
    -    /* MyMMC11 -> MMC1_CMD -> J19 */
    -    {
    -        PIN_MMC1_CMD, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -    /* MyMMC11 -> MMC1_CLK -> L20 */
    -    {
    -        PIN_MMC1_CLK, PIN_MODE(0) | \
    -        ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
    -    },
    -    /* MyMMC11 -> MMC1_CLKLB */
    -    {
    -        PIN_MMC1_CLKLB, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -    /* MyMMC11 -> MMC1_DAT0 -> K21 */
    -    {
    -        PIN_MMC1_DAT0, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -    /* MyMMC11 -> MMC1_DAT1 -> L21 */
    -    {
    -        PIN_MMC1_DAT1, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -    /* MyMMC11 -> MMC1_DAT2 -> K19 */
    -    {
    -        PIN_MMC1_DAT2, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -    /* MyMMC11 -> MMC1_DAT3 -> K18 */
    -    {
    -        PIN_MMC1_DAT3, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -    /* MyMMC11 -> MMC1_SDCD -> D19 */
    -    {
    -        PIN_MMC1_SDCD, PIN_MODE(0) | \
    -        ((PIN_PULL_DIRECTION | PIN_INPUT_ENABLE) & (~PIN_PULL_DISABLE))
    -    },
    -
    -    {PINMUX_END, PINMUX_END}
    -};
    -
     
     /*  In this sample bootloader, we load appimages for RTO/Baremetal and Linux at different offset
         i.e the appimage for Linux (for A53) and RTOS/Baremetal (for R5, M4) is flashed at different offset in flash
    @@ -98,6 +52,12 @@ static Pinmux_PerCfg_t gPinMuxMMCSDCfg[] = {
         Linux appimage (for A53) flash at offset 0x280000
     */
     
    +/* This buffer needs to be defined for OSPI boot in case of HS device for
    + * image decryption and authentication
    + * The size of the buffer should be large enough to accomodate the appimage
    + */
    +uint8_t gAppimage[0x800000] __attribute__ ((section (".app"), aligned (4096)));
    +
     /* call this API to stop the booting process and spin, do that you can connect
      * debugger, load symbols and then make the 'loop' variable as 0 to continue execution
      * with debugger connected.
    @@ -227,12 +187,6 @@ int32_t App_runLinuxCpu(Bootloader_Handle bootHandle, Bootloader_BootImageInfo *
     
         /* Initialize GTC by enabling using Syscfg */
     
    -    /* Change the dev stat register to SD card bootmode so that SPL loads uBoot and linux kernel from SD card */
    -	SOC_setDevStat(SOC_BOOTMODE_MMCSD);
    -
    -    /* Enable pinmux for MMCSD (Workaround as MMC SD pinmux is not initialized in A53 SPL) */
    -    Pinmux_config(gPinMuxMMCSDCfg, PINMUX_DOMAIN_ID_MAIN);
    -
         /* Unlock all the control MMRs. Linux/U-boot expects all the MMRs to be unlocked */
         SOC_unlockAllMMR();
     
    @@ -297,10 +251,12 @@ int main(void)
             Bootloader_BootImageInfo bootImageInfo;
     		Bootloader_Params bootParams;
             Bootloader_Handle bootHandle;
    +        Bootloader_Config *bootConfig;
     
     		Bootloader_BootImageInfo bootImageInfoLinux;
     		Bootloader_Params bootParamsLinux;
             Bootloader_Handle bootHandleLinux;
    +        Bootloader_Config *bootConfigLinux;
     
             Bootloader_Params_init(&bootParams);
     		Bootloader_Params_init(&bootParamsLinux);
    @@ -310,21 +266,26 @@ int main(void)
     
             bootHandle = Bootloader_open(CONFIG_BOOTLOADER_FLASH0, &bootParams);
     		bootHandleLinux = Bootloader_open(CONFIG_BOOTLOADER_FLASH_LINUX, &bootParamsLinux);
    -        if(bootHandle != NULL)
    -        {
    -			status = App_loadImages(bootHandle, &bootImageInfo);
    -            Bootloader_profileAddProfilePoint("App_loadImages");
    -        }
     
    -		if(SystemP_SUCCESS == status)
    +		if(bootHandleLinux != NULL)
     		{
    -			if(bootHandleLinux != NULL)
    -			{
    -				status = App_loadLinuxImages(bootHandleLinux, &bootImageInfoLinux);
    -                Bootloader_profileAddProfilePoint("App_loadLinuxImages");
    -			}
    +            bootConfigLinux = (Bootloader_Config *)bootHandleLinux;
    +            bootConfigLinux->scratchMemPtr = gAppimage;
    +			status = App_loadLinuxImages(bootHandleLinux, &bootImageInfoLinux);
    +            Bootloader_profileAddProfilePoint("App_loadLinuxImages");
     		}
     
    +		if(SystemP_SUCCESS == status)
    +		{
    +            if(bootHandle != NULL)
    +            {
    +                bootConfig = (Bootloader_Config *)bootHandle;
    +                bootConfig->scratchMemPtr = gAppimage;
    +                status = App_loadImages(bootHandle, &bootImageInfo);
    +                Bootloader_profileAddProfilePoint("App_loadImages");
    +            }
    +        }
    +
     		if(SystemP_SUCCESS == status)
     		{
     			/* Print SBL log as Linux prints log to the same UART port */
    diff --git a/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/example.syscfg b/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/example.syscfg
    index 3f9c9a39ed..9d7fe91e01 100644
    --- a/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/example.syscfg
    +++ b/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/example.syscfg
    @@ -1,8 +1,9 @@
     /**
      * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
      * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    - * @cliArgs --device "AM64x" --package "ALV" --part "Default" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    - * @versions {"tool":"1.20.0+3587"}
    + * @cliArgs --device "AM64x" --part "Default" --package "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    + * @v2CliArgs --device "AM6442" --package "FCBGA (ALV)" --variant "AM6442-D" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
    + * @versions {"tool":"1.21.0+3721"}
      */
     
     /**
    @@ -20,7 +21,7 @@ const bootloader6     = bootloader.addInstance();
     const ddr             = scripting.addModule("/drivers/ddr/ddr", {}, false);
     const ddr1            = ddr.addInstance();
     const debug_log       = scripting.addModule("/kernel/dpl/debug_log");
    -const dpl_cfg = scripting.addModule("/kernel/dpl/dpl_cfg");
    +const dpl_cfg         = scripting.addModule("/kernel/dpl/dpl_cfg");
     const mpu_armv7       = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
     const mpu_armv71      = mpu_armv7.addInstance();
     const mpu_armv72      = mpu_armv7.addInstance();
    @@ -38,6 +39,7 @@ const section1        = section.addInstance();
     const section2        = section.addInstance();
     const section3        = section.addInstance();
     const section4        = section.addInstance();
    +const section5        = section.addInstance();
     
     /**
      * Write custom configuration values to the imported modules.
    @@ -131,7 +133,7 @@ general1.svc_stack_size = 256;
     general1.linker.$name   = "TIARMCLANG0";
     
     region1.$name                               = "MEMORY_REGION_CONFIGURATION0";
    -region1.memory_region.create(6);
    +region1.memory_region.create(7);
     region1.memory_region[0].type               = "TCMA_R5F";
     region1.memory_region[0].$name              = "R5F_VECS";
     region1.memory_region[0].size               = 0x40;
    @@ -153,6 +155,11 @@ region1.memory_region[5].$name              = "MSRAM_1";
     region1.memory_region[5].auto               = false;
     region1.memory_region[5].manualStartAddress = 0x70050000;
     region1.memory_region[5].size               = 0x30000;
    +region1.memory_region[6].type               = "CUSTOM_ALL";
    +region1.memory_region[6].$name              = "APPIMAGE";
    +region1.memory_region[6].auto               = false;
    +region1.memory_region[6].manualStartAddress = 0x82000000;
    +region1.memory_region[6].size               = 0x800000;
     
     section1.$name                        = "Vector Table";
     section1.group                        = false;
    @@ -221,6 +228,14 @@ section4.output_section[4].output_sections_end    = "__UNDEFINED_STACK_END";
     section4.output_section[4].input_section.create(1);
     section4.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;";
     
    +section5.type                        = "NOLOAD";
    +section5.group                       = false;
    +section5.load_memory                 = "APPIMAGE";
    +section5.$name                       = "BSSAPP_SECTION";
    +section5.output_section.create(1);
    +section5.output_section[0].$name     = ".bss.app";
    +section5.output_section[0].alignment = 0;
    +
     /**
      * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
      * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
    diff --git a/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/main.c b/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/main.c
    index 1caf2d6b5d..775d138c96 100644
    --- a/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/main.c
    +++ b/examples/drivers/boot/sbl_ospi_multi_partition/am64x-evm/r5fss0-0_nortos/main.c
    @@ -59,6 +59,12 @@
         A53SS0-0 flash at offset 0x300000
      */
     
    +/* This buffer needs to be defined for OSPI boot in case of HS device for
    + * image decryption and authentication
    + * The size of the buffer should be large enough to accomodate the appimage
    + */
    +uint8_t gAppimage[0x800000] __attribute__ ((section (".app"), aligned (4096)));
    +
     void flashFixUpOspiBoot(OSPI_Handle oHandle, Flash_Handle fHandle);
     
     /* call this API to stop the booting process and spin, do that you can connect
    @@ -79,11 +85,15 @@ int32_t App_bootCpu(uint32_t bootDrvInstanceId, uint32_t cpuId)
         Bootloader_BootImageInfo bootImageInfo;
         Bootloader_Params bootParams;
         Bootloader_Handle bootHandle;
    +    Bootloader_Config *bootConfig;
     
         Bootloader_Params_init(&bootParams);
         Bootloader_BootImageInfo_init(&bootImageInfo);
     
         bootHandle = Bootloader_open(bootDrvInstanceId, &bootParams);
    +    bootConfig = (Bootloader_Config *)bootHandle;
    +    bootConfig->scratchMemPtr = gAppimage;
    +
         if(bootHandle != NULL)
         {
             status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo);
    @@ -104,11 +114,14 @@ int32_t App_bootLoadSelfCpu(uint32_t bootDrvInstanceId, uint32_t cpuId)
         Bootloader_BootImageInfo bootImageInfo;
         Bootloader_Handle bootHandle;
         Bootloader_Params bootParams;
    +    Bootloader_Config *bootConfig;
     
         Bootloader_Params_init(&bootParams);
         Bootloader_BootImageInfo_init(&bootImageInfo);
     
         bootHandle = Bootloader_open(bootDrvInstanceId, &bootParams);
    +    bootConfig = (Bootloader_Config *)bootHandle;
    +    bootConfig->scratchMemPtr = gAppimage;
         if(bootHandle != NULL)
         {
             status = Bootloader_parseMultiCoreAppImage(bootHandle, &bootImageInfo);
    diff --git a/source/drivers/bootloader.h b/source/drivers/bootloader.h
    index 8cd64e9b08..ce3ba6b84d 100644
    --- a/source/drivers/bootloader.h
    +++ b/source/drivers/bootloader.h
    @@ -1,5 +1,5 @@
     /*
    - *  Copyright (C) 2021-23 Texas Instruments Incorporated
    + *  Copyright (C) 2021-2024 Texas Instruments Incorporated
      *
      *  Redistribution and use in source and binary forms, with or without
      *  modification, are permitted provided that the following conditions
    @@ -84,6 +84,11 @@ extern "C"
     #define BOOTLOADER_MEDIA_PCIE      (0xB0070006)
     #define BOOTLOADER_MEDIA_USB       (0xB0070007)
     
    +/**
    + * \brief Bootloader buffer enable
    + */
    +#define BOOTLOADER_SCRATCH_MEM_ENABLE  (1U)
    +
     /**
      * \brief Handle to the Bootloader driver returned by Bootloader_open()
      */
    @@ -227,6 +232,7 @@ typedef struct Bootloader_Config_s
         uint32_t disableAppImageAuth;
         /* Whether to initialize ICSS cores or not */
         uint32_t initICSSCores;
    +    uint32_t enableScratchMem;
     
     } Bootloader_Config;
     
    diff --git a/source/drivers/bootloader/bootloader.c b/source/drivers/bootloader/bootloader.c
    index fb0cc2c6a0..478b506023 100644
    --- a/source/drivers/bootloader/bootloader.c
    +++ b/source/drivers/bootloader/bootloader.c
    @@ -66,7 +66,7 @@
     extern Bootloader_Config gBootloaderConfig[];
     extern uint32_t gBootloaderConfigNum;
     
    -#ifdef DRV_VERSION_MMCSD_V0
    +#ifdef BOOTLOADER_SCRATCH_MEM_SUPPORT
     extern Bootloader_MemArgs gMemBootloaderArgs;
     #endif
     
    @@ -671,6 +671,18 @@ int32_t Bootloader_verifyMulticoreImage(Bootloader_Handle handle)
                         Bootloader_FlashArgs *flashArgs = (Bootloader_FlashArgs *)(config->args);
                         flashArgs->appImageOffset += certLen;
                         flashArgs->curOffset = flashArgs->appImageOffset;
    +
    +#ifdef  BOOTLOADER_SCRATCH_MEM_SUPPORT
    +                    if(config->enableScratchMem == BOOTLOADER_SCRATCH_MEM_ENABLE){
    +                        /* At this point the image is in RAM, change bootmedia from OSPI to memory */
    +                        gMemBootloaderArgs.appImageBaseAddr = (uint32_t)(config->scratchMemPtr) + certLen;
    +                        gMemBootloaderArgs.curOffset = 0U;
    +
    +                        config->fxns = &gBootloaderMemFxns;
    +                        config->args = &gMemBootloaderArgs;
    +                        config->bootMedia = BOOTLOADER_MEDIA_MEM;
    +                    }
    +#endif
                     }
                     else if(config->bootMedia == BOOTLOADER_MEDIA_BUFIO)
                     {
    diff --git a/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.h b/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.h
    index 3e9b14d435..81c3546999 100644
    --- a/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.h
    +++ b/source/drivers/bootloader/soc/am64x_am243x/bootloader_soc.h
    @@ -41,6 +41,9 @@ extern "C"
     
     #include <drivers/hw_include/cslr_soc.h>
     
    +/* Macro to enable scratch memory support */
    +#define BOOTLOADER_SCRATCH_MEM_SUPPORT
    +
     #define BOOTLOADER_DEVICE_VARIANT_SINGLE_CORE    (0x00000000U)
     #define BOOTLOADER_DEVICE_VARIANT_DUAL_CORE      (0x00040000U)
     #define BOOTLOADER_DEVICE_VARIANT_QUAD_CORE      (0x000C0000U)
    diff --git a/source/sysconfig/drivers/.meta/bootloader/templates/bootloader_config.c.xdt b/source/sysconfig/drivers/.meta/bootloader/templates/bootloader_config.c.xdt
    index 146a1fa23e..7bf454a38d 100644
    --- a/source/sysconfig/drivers/.meta/bootloader/templates/bootloader_config.c.xdt
    +++ b/source/sysconfig/drivers/.meta/bootloader/templates/bootloader_config.c.xdt
    @@ -147,6 +147,11 @@ Bootloader_Config gBootloaderConfig[CONFIG_BOOTLOADER_NUM_INSTANCES] =
             .disableAppImageAuth = FALSE,
             .initICSSCores = FALSE,
         % }
    +    % if(["am243x", "am64x", "am65x"].includes(common.getSocName())) {
    +        BOOTLOADER_SCRATCH_MEM_ENABLE,
    +    % } else {
    +        0,
    +    % }
         },
     % }
     };
    diff --git a/tools/boot/linuxAppimageGen/config.mak b/tools/boot/linuxAppimageGen/config.mak
    index e05a92c70e..06d7482188 100644
    --- a/tools/boot/linuxAppimageGen/config.mak
    +++ b/tools/boot/linuxAppimageGen/config.mak
    @@ -11,15 +11,14 @@ APP_IMAGE_SIGN_CMD = $(MCU_PLUS_SDK_PATH)/source/security/security_common/tools/
     # The prebuilt images available with Linux SDK is the signed ATF, OPTEE and A53 SPL,
     # but we requires unsigned images to create the linux.appimage and sign the final image
     # for HS-FS/HS devices
    -PSDK_LINUX_IMAGE_PATH=$(HOME)/prebuilt_spl
    -
    +PSDK_LINUX_IMAGE_PATH=$(HOME)/ti-processor-sdk-linux-am64xx-evm-10.00.07.04
     #Path for prebuit images in Processor SDK linux
    -PSDK_LINUX_PREBUILT_IMAGES=$(PSDK_LINUX_IMAGE_PATH)
    +PSDK_LINUX_PREBUILT_IMAGES=$(PSDK_LINUX_IMAGE_PATH)/board-support/prebuilt-images/am64xx-evm
     
     #Input linux binaries
     ATF_BIN_NAME=bl31.bin
     OPTEE_BIN_NAME=bl32.bin
    -SPL_BIN_NAME=u-boot-spl.bin
    +SPL_BIN_NAME=u-boot-spl.bin-am64xx-evm
     
     #Linux image load address
     ATF_LOAD_ADDR=0x0701a0000
    diff --git a/tools/boot/linuxAppimageGen/makefile b/tools/boot/linuxAppimageGen/makefile
    index e02be89f7e..ceba800c55 100644
    --- a/tools/boot/linuxAppimageGen/makefile
    +++ b/tools/boot/linuxAppimageGen/makefile
    @@ -94,6 +94,9 @@ endif
     	$(RM) $(BOOTIMAGE_TEMP_OUT_FILE)
     	@echo Combined boot image: $@ Done !!!
     
    +	@echo Copying u-boot.img
    +	$(COPY) $(PSDK_LINUX_PREBUILT_IMAGES)/u-boot.img .
    +
     $(ATF_RPRC): $(ATF_ELF)
     	@echo Creating ATF RPRC image
     	$(OUTRPRC_CMD) $(ATF_ELF) $(ATF_RPRC)
    @@ -120,3 +123,4 @@ clean:
     	$(RM) $(LINUX_BOOTIMAGE_NAME)*
     	$(RM) *.elf
     	$(RM) *.rprc
    +	$(RM) *.img
    -- 
    2.34.1
    
    

    PS: I have not tested it as I do not have the HSSE device with me right now but I think all the required changes have been backported.

    Regards,

    Prashant

  • Hi Prashant,

    thanks a lot for your help, we have ultimately decided to upgrade to new SDK-11.0 to avoid potential further effort, will come up to you if having new issue.

  • Thank you for the update!!