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.

[FAQ] AM6548: How to add more features to R5 SPL(tiboot3.bin) adhering to maximum size constraint

Part Number: AM6548

The R5 SPL is loaded onto OCMC RAM as the DDR is not up by the time R5 SPL executes.
AM654x-EVM stops booting as soon as the tiboot3.bin size increase above 150KB size.

How to add more features?

  • OCM-SRAM size on AM65 is 512KB.

    That is used for BOOT_PARAM_TABLE_INDEX, Heap, Stack, BSS, Device tree & SPL Image.
    Typically we get 150KB as the maximum size for tiboot3.bin aka R5 SPL.

    The size of tiboot3.bin binary on the latest 7.1 SDK is 148KB. So we have very little
    room to enable more features if need be. So we can judiciously disable features that do
    not affect our use case. For example if we are using SD Boot anything related to other
    boot modes is of not much use so we can remove them.

    Here is the diff on the am65x_evm_r5_defconfig:

    diff --git a/configs/am65x_evm_r5_defconfig b/configs/am65x_evm_r5_defconfig
    index 7a426e1ec9..262c3a10b8 100644
    --- a/configs/am65x_evm_r5_defconfig
    +++ b/configs/am65x_evm_r5_defconfig
    @@ -15,8 +15,8 @@ CONFIG_SPL_STACK_R_ADDR=0x82000000
     CONFIG_NR_DRAM_BANKS=2
     CONFIG_SPL_FS_FAT=y
     CONFIG_SPL_LIBDISK_SUPPORT=y
    -CONFIG_SPL_SPI_FLASH_SUPPORT=y
    -CONFIG_SPL_SPI_SUPPORT=y
    +#CONFIG_SPL_SPI_FLASH_SUPPORT=y
    +#CONFIG_SPL_SPI_SUPPORT=y
     CONFIG_SPL_TEXT_BASE=0x41c00000
     # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
     CONFIG_SPL_LOAD_FIT=y
    @@ -37,16 +37,16 @@ CONFIG_SPL_RAM_SUPPORT=y
     CONFIG_SPL_RAM_DEVICE=y
     CONFIG_SPL_REMOTEPROC=y
     # CONFIG_SPL_SPI_FLASH_TINY is not set
    -CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
    -CONFIG_SPL_SPI_LOAD=y
    -CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
    -CONFIG_SPL_THERMAL=y
    -CONFIG_SPL_YMODEM_SUPPORT=y
    -CONFIG_HUSH_PARSER=y
    -CONFIG_CMD_BOOTZ=y
    -CONFIG_CMD_ASKENV=y
    -CONFIG_CMD_GPT=y
    -CONFIG_CMD_I2C=y
    +#CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
    +#CONFIG_SPL_SPI_LOAD=y
    +#CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
    +#CONFIG_SPL_THERMAL=y
    +#CONFIG_SPL_YMODEM_SUPPORT=y
    +#CONFIG_HUSH_PARSER=y
    +#CONFIG_CMD_BOOTZ=y
    +#CONFIG_CMD_ASKENV=y
    +#CONFIG_CMD_GPT=y
    +#CONFIG_CMD_I2C=y
     CONFIG_CMD_MMC=y
     CONFIG_CMD_REMOTEPROC=y
     # CONFIG_CMD_SETEXPR is not set
    @@ -114,18 +114,21 @@ CONFIG_DM_RESET=y
     CONFIG_RESET_TI_SCI=y
     CONFIG_DM_SERIAL=y
     CONFIG_SOC_TI=y
    -CONFIG_SPI=y
    -CONFIG_DM_SPI=y
    -CONFIG_CADENCE_QSPI=y
    -CONFIG_CADENCE_QSPI_PHY=y
    +#CONFIG_SPI=y
    +#CONFIG_DM_SPI=y
    +#CONFIG_CADENCE_QSPI=y
    +#CONFIG_CADENCE_QSPI_PHY=y
     CONFIG_SYSRESET=y
     CONFIG_SPL_SYSRESET=y
     CONFIG_SYSRESET_TI_SCI=y
    -CONFIG_DM_THERMAL=y
    -CONFIG_K3_J721E_BANDGAP_THERMAL=y
    +#CONFIG_DM_THERMAL=y
    +#CONFIG_K3_J721E_BANDGAP_THERMAL=y
    

    Configs related SPI boot, UART Boot, Thermal are removed.

    The size of tiboot3.bin reduced 128KB from 148KB. One can add more relevant configs related to
    their use case and enable the features.

    Best Regards,
    Keerthy