AM62Ax MCU+ SDK  09.02.00
SBL EMMC Linux Multistage

Note
SBL EMMC Linux boots from the boot partition 1 of eMMC and does not use a filesystem boot. The appimage is flashed to the offsets in eMMC as configured using syscfg.
Attention
Care should be taken to ensure that the R5, M4 appimage and the Linux appimage flashed does NOT overwrite the Linux binaries in eMMC.
Note
The load address of resource table for R5 and M4 cores must be consistant with the address in the Linux dts file.

Introduction

This is a bootloader example, which shows an example of booting Linux on A53 core and RTOS/NORTOS applications on DM R5, MCU R5 and C75 cores from eMMC.

The booting is done in 2 stages(2 bootloader applications).

  • The stage1 of the bootloader runs from the HSM RAM. It boots MCU R5 with RTOS/NORTOS application and initializes the DDR. Then it loads the stage2 of the bootloader to DDR and stats running it.
  • The stage2 of the bootloader boots Linux on A53 and then self loads DM firmware on the DM R5.

The SBL uses 7 appimages

  • A Linux appimage containing the Linux binaries (ATF, OPTEE, A53 SPL).
  • tiboot3.bin with SBL stage1, TIFS, BoardConfig
  • Appimage for SBL stage2
  • Appimage for MCU R5
  • Appimage for HSM M4
  • Appimage for C75
  • DM firmware appimage for DM R5

The bootloader does SOC initializations and parses the multicore appimage present in eMMC boot partition 1, splits it into RPRCs for each core applicable. Each core is then initialized, RPRC image is loaded, entry points are set and the core is released from reset.

For booting Linux, SBL parses the Linux appimage present in eMMC boot partition, splits it into individual linux binaries (ATF, OPTEE, SPL). SBL loads the Linux binaries, entry point is set to the start address of ATF and A53 core is released from reset.

Refer SBL Booting Linux From eMMC for more details on the EMMC bootflow.

Refer Enabling DDR inline ECC enablig inline ECC

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 nortos
Toolchain ti-arm-clang
Board am62ax-sk
Example folder examples/drivers/boot/sbl_emmc_linux_multistage

Steps to Run the Example

Build the example

  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles)

Create Linux Appimage

Note
Change DEVICE_TYPE to HS in ${SDK_INSTALL_PATH}/devconfig/devconfig.mak and then generate Linux Appimage for HS-SE device.
  • Create a Linux Appimage containing the Linux binaries (ATF, OPTEE, A53 SPL)
  • This can be done by running the makefile at {SDK_INSTALL_PATH}/tools/boot/linuxAppimageGen after setting the PSDK path in file config.mak
  • Refer Linux Appimage Generator Tool for more details

Create HSM Appimage

  • Create a HSM Appimage
  • This can be done by running the makefile at {SDK_INSTALL_PATH}/tools/boot/HSMAppimageGen
  • Refer HSM Appimage Generator Tool for more details

Run the example

  • This example is the SBL which needs to be flashed on the eMMC, along with sample application images for R5, M4 CPUs and Linux Appimage.
  • There is a default flash config file as shown below which flashes this SBL and the IPC RPMsg Linux echo applications
      ${SDK_INSTALL_PATH}/tools/boot/sbl_prebuilt/am62ax-sk/default_sbl_emmc_linux.cfg
    
Note
Use default_sbl_emmc_linux_hs.cfg when flashing to HS-SE devices
Use default_sbl_emmc_linux_hs_fs.cfg when flashing to HS-FS devices
For IPC rpmsg linux echo, the resource table entity must be placed at the beginning of remoteproc memory section as mentoined in Linux dts file.
  • To flash to the EVM, refer to Flash an example application . Only when giving the flash config file, point to the default_sbl_emmc_linux.cfg shown above.
  • Example, assuming SDK is installed at C:/ti/mcu_plus_sdk and this example and IPC application is built using makefiles, and Linux Appimage is already created, in Windows,
      cd C:/ti/mcu_plus_sdk/tools/boot
      python uart_uniflash.py -p COM13 --cfg=C:/ti/mcu_plus_sdk/tools/boot/sbl_prebuilt/am62ax-sk/default_sbl_emmc_linux.cfg
    
  • If Linux PC is used, assuming SDK is installed at `~PSDK_LINUX_HS_IMAGE_PATH~/ti/mcu_plus_sdk/tools/boot/sbl_prebuilt/am62ax-sk//default_sbl_emmc_linux.cfg
  • Boot the EVM in eMMC boot mode to boot Linux on A53 and RTOS/Baremetal application on R5 and M4 cores.
Note
The above config file will flash till u-boot on the EMMC bootmedia. U-Boot can load kernel from any bootmedia, refer to Processor SDK Linux user guide for more details.

See Also

BOOTLOADER

Sample Output

After flashing and booting the EVM, you will see below output on the UART console (Complete log is not shown)

SYSFW Version 9.0.5--v09.00.05 (Kool Koala)
SYSFW revision 0x9
DMSC ABI revision 3.1

[BOOTLOADER_PROFILE] Boot Media       : eMMC
[BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz
[BOOTLOADER_PROFILE] Boot Image Size  : 160 KB
[BOOTLOADER_PROFILE] Cores present    :
mcu-r5f0-0
r5f0-0
[BOOTLOADER PROFILE] System_init                      :      39504us
[BOOTLOADER PROFILE] Drivers_open                     :      61574us
[BOOTLOADER PROFILE] Board_driversOpen                :          0us
[BOOTLOADER PROFILE] Sciclient Get Version            :       9895us
[BOOTLOADER PROFILE] App_loadImages                   :      22280us
[BOOTLOADER PROFILE] App_loadSelfcoreImage            :      23785us
[BOOTLOADER_PROFILE] SBL Total Time Taken             :     157040us

Image loading done, switching to application ...
Starting MCU-r5f and 2nd stage bootloader

SYSFW Version 9.0.5--v09.00.05 (Kool Koala)
SYSFW revision 0x9
DMSC ABI revision 3.1

[BOOTLOADER_PROFILE] Boot Media       : eMMC
[BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz
[BOOTLOADER_PROFILE] Boot Image Size  : 1045 KB
[BOOTLOADER_PROFILE] Cores present    :
hsm-m4f0-0
r5f0-0
a530-0
c75ss0
[BOOTLOADER PROFILE] System_init                      :       1703us
[BOOTLOADER PROFILE] Drivers_open                     :      19520us
[BOOTLOADER PROFILE] Board_driversOpen                :          0us
[BOOTLOADER PROFILE] Sciclient Get Version            :       9909us
[BOOTLOADER PROFILE] App_loadImages                   :      21214us
[BOOTLOADER PROFILE] App_loadSelfcoreImage            :      24195us
[BOOTLOADER PROFILE] App_loadLinuxImages              :      39742us
[BOOTLOADER PROFILE] App_loadDSPImages                :      24483us
[BOOTLOADER_PROFILE] SBL Total Time Taken             :     140769us

Image loading done, switching to application ...
Starting linux and RTOS/Baremetal applications
NOTICE:  BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE:  BL31: Built : 00:42:57, Jan 13 2023

U-Boot SPL 2023.04-g794614311a (Jul 05 2023 - 17:29:58 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
.
.
.
.
.
.


_____                    _____           _         _
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
            |___|                    |___|

Arago Project am62axx-evm -

Arago 2023.04 am62axx-evm -

am62axx-evm login: