AM62Ax MCU+ SDK  08.06.00
SBL OSPI NAND Linux Multistage

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 and M4 cores.

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 nortos
Toolchain ti-arm-clang
Board am62ax-sk
Example folder examples/drivers/boot/sbl_ospi_nand_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)
    Note
    Change DEVICE_TYPE to HS in ${SDK_INSTALL_PATH}/devconfig/devconfig.mak and then generate Linux Appimage for HS-SE device.
  • For booting A53 with linux, OSPI NAND needs to be flashed with the uboot and Linux image. Refer to Processor SDK Linux user guide on how to flash uboot and Linux kernel to OSPI NAND.

Create Linux Appimage

Note
Instructions to build A53 uboot can be found in the SDK Linux documentation at Foundational Components » U-Boot » User’s Guide » General Information » Build U-Boot
  • 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 EVM flash, along with sample application images for DM R5, MCU R5 CPUs and Linux Appimage.
    Note
    For HS-SE device, use default_sbl_ospi_nand_linux_hs.cfg as the cfg file.
    For HS-FS device, use default_sbl_ospi_nand_linux_hs_fs.cfg as the cfg file.
  • 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_ospi_nand_linux_hs_fs.cfg
    
  • Make sure IPC rpmsg linux echo application is built before running the flash script. (see IPC RP Message Linux Echo)
Note
For IPC rpmsg linux echo, the resource table entity must be placed at the beginning of remoteproc memory section as mentioned in Linux dts file.
  • To flash to the EVM, refer to Flash a Hello World example . Only when giving the flash config file, point to the default_sbl_ospi_nand_linux_hs_fs.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_ospi_nand_linux_hs_fs.cfg
    
  • If Linux PC is used, assuming SDK is installed at ~/ti/mcu_plus_sdk
      cd ~/ti/mcu_plus_sdk/tools/boot
      python uart_uniflash.py -p /dev/ttyUSB0 --cfg=~/ti/mcu_plus_sdk/tools/boot/sbl_prebuilt/am62ax-sk/default_sbl_ospi_nand_linux_hs_fs.cfg
    
  • Boot the EVM in OSPI NAND boot mode.

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)

DMSC Firmware Version 8.4.3--w2022.02-am62a (Jolly Je
DMSC Firmware revision 0x8
DMSC ABI revision 3.1

[BOOTLOADER_PROFILE] Boot Media       : SPI FLASH
[BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz
[BOOTLOADER_PROFILE] Boot Image Size  : 133 KB
[BOOTLOADER_PROFILE] Cores present    :
mcu-r5f0-0
r5f0-0
[BOOTLOADER PROFILE] System_init                      :      57521us
[BOOTLOADER PROFILE] Drivers_open                     :         95us
[BOOTLOADER PROFILE] Board_driversOpen                :         74us
[BOOTLOADER PROFILE] Sciclient Get Version            :      10128us
[BOOTLOADER PROFILE] App_loadImages                   :      26341us
[BOOTLOADER_PROFILE] SBL Total Time Taken             :     157215us

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

DMSC Firmware Version 8.4.3--w2022.02-am62a (Jolly Je
DMSC Firmware revision 0x8
DMSC ABI revision 3.1

[BOOTLOADER_PROFILE] Boot Media       : SPI FLASH
[BOOTLOADER_PROFILE] Boot Media Clock : 200.000 MHz
[BOOTLOADER_PROFILE] Boot Image Size  : 917 KB
[BOOTLOADER_PROFILE] Cores present    :
hsm-m4f0-0
r5f0-0
a530-0
[BOOTLOADER PROFILE] System_init                      :       1547us
[BOOTLOADER PROFILE] Drivers_open                     :         98us
[BOOTLOADER PROFILE] Board_driversOpen                :         74us
[BOOTLOADER PROFILE] Sciclient Get Version            :      10150us
[BOOTLOADER PROFILE] App_loadImages                   :        412us
[BOOTLOADER PROFILE] App_loadSelfcoreImage            :      81651us
[BOOTLOADER_PROFILE] SBL Total Time Taken             :     597283us

Image loading done, switching to application ...
Starting linux and RTOS/Baremetal applications
NOTICE:  BL31: v2.6(release):08.03.00.003-dirty
NOTICE:  BL31: Built : 19:07:38, Aug 10 2022

U-Boot SPL 2021.01-gacf0fe0dc6 (Aug 10 2022 - 19:11:27 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.4.3--w2022.02-am62a (Jolly Je')
am62a_init: board_init_f done
am62a_init: spl_boot_device: devstat = 0x3 bootmedia = 0x7 bootindex = 0
Trying to boot from SPINAND

.
.
.
.
.
.


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

Arago Project http://arago-project.org am62axx-evm ttyS2

Arago 2020.09 am62axx-evm ttyS2

am62axx-evm login: