Booting an Image

Boot Chain Overview

After powering up the device, the BootROM code in the i.MX tries to load a first stage bootloader which is U-Boot SPL in our case. From there, the chain continues with loading of TF-A (Trusted-Firmware-ARM, only for i.MX8MM) and U-Boot. Finally we load the Linux Kernel and Devicetrees.

Boot Stage Name Description Filename in Yocto-Build Image Format
1 BootROM Fixed program in the SoC - -
2 U-Boot SPL Secondary Program Loader flash.bin Raw Binary
3* TF-A BL31 Trusted-Firmware-ARM BL31 u-boot.itb FIT
4 U-Boot Main Bootloader u-boot.itb FIT
5 Linux Linux Kernel + Devicetrees fitImage FIT

* only i.MX8MM

SPL

The U-Boot SPL brings up the most important parts of the SoC, such as the core and the DDR-RAM. Afterwards it loads a FIT image from a fixed offset on the boot device (NOR, SD card, eMMC) to the DDR RAM and jumps to the TF-A or U-Boot entrypoint. It also prints a few lines to the debug UART interface. You should see something like the following:

U-Boot SPL 2020.01_ktn-zeus_3.0.0-alpha2-dirty+gc6e6927046 (Feb 20 2020 - 10:00:34 +0000)
1GB RAM detected, assuming Kontron N801x module...
Normal Boot
Trying to boot from MMC2

TF-A BL31 (only i.MX8MM)

The TF-A BL31 is run at EL3 (exception level 3). It sets up the default security settings for peripherals and can act as a secure monitor for code running in the non-secure world (Linux). For more information about the TF-A and the overall firmware design, see the TF-A documentation.

In our configuration TF-A BL31 also prints a few lines to the debug UART interface. You should see something like the following:

NOTICE:  BL31: v2.2(release):v2.2-dirty
NOTICE:  BL31: Built : 10:25:02, Feb 13 2020

U-Boot

U-Boot acts as a main bootloader. It has a command line interface and runs from DDR RAM. It has support for filesystems and many other things. The typical output from U-Boot will look something like this:

U-Boot 2020.01_ktn-zeus_3.0.0-alpha2-dirty+gc6e6927046 (Feb 20 2020 - 10:00:34 +0000)

CPU:   Freescale i.MX8MMQ rev1.0 at 1200 MHz
Reset cause: POR
Model: Kontron i.MX8MM N8011 S
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@30be0000 [PRIME]

Booting from SD Card

You can use the prebuilt images from files.kontron-electronics.de or the images from your Yocto build. To write the image onto the SD card using a Linux host, use the following command and adjust the image file name and the device filename for the SD card to your needs.

Danger

The usage of the dd command in combination with sudo can be dangerous. If you use wrong parameters, this might cause severe loss of data on your hard disk or other drives!

gunzip -c image-ktn-kontron-mx8mm-ktn-zeus-v3.0.0-alpha2-20200203.rootfs.wic.gz | sudo dd of=/dev/<mmcdevice> bs=1M iflag=fullblock oflag=direct conv=fsync status=progress

System Boot diagram A/B Partition

The Flash Layout described in the chapter Flash Layout + the provided bootscripts follow the Boot-diagram below.

bootdiagram