wiki:venice/boot

Version 9 (modified by Tim Harvey, 18 months ago) ( diff )

updated the FLASH MAP for boot firmware being placed on eMMC boot0 hardware partition and removed SOC specific note regarding compressed disk images

Venice Boot Firmware

The 'Boot Firmware' for Venice is defined as the combination of the firmware stages through up to and including the bootloader. This can be broken down into the following stages:

  • Boot ROM (internal on i.MX8 SoC): fetch first level boot firmware from boot device (ie MMC or SPI FLASH) into L2 cache
  • SPL (Secondary Program Loader) - (U-Boot)
  • ATF (ARM Trusted Firmware)
  • Bootloader (U-Boot)

Gateworks provides pre-built Boot Firmware ready to flash onto boot devices as well as source for building and/or modifying the boot firmware yourself.

i.MX8 BOOT ROM

The BOOT ROM is firmware baked into the SoC and is in charge of loading code from the 'boot device' into an L2 cache scratchpad, verifying signatures (if using trusted boot) and executing it.

The BOOT ROM fetches code from an offset of 33KiB on the boot device which leaves the first 33KiB available for other firmware needs.

Boot Firmware Image

The firmware image contains all of the components of the 'Boot Firmware':

  • ARM Trusted Firmware (ATF)
  • SPL
  • U-Boot
  • U-Boot environment

This firmware is typically put on the eMMC boot0 hardware partition to keep it separate from the eMMC user partition used for the OS.

Venice Boot Firmware Image Map:

  • imx8mm:
start-end len item notes
0x00000000 - 0x00008400 33KiB unused
0x00008400 - 0x00060000 351KiB SPL (spl.bin) Loads and u-boot.itb and transfers control to the ATF
0x00060000 - 0x003F0000 3648KiB U-Boot (u-boot.itb) FIT image containing u-boot, ATF, and fdt
0x003F0000 - 0x00400000 64KB U-Boot env redundant 32KB env
  • imx8mn/imx8mp:
start-end len item notes
0x00000000 - 0x00058000 352KiB SPL (spl.bin) Loads and u-boot.itb and transfers control to the ATF
0x00058000 - 0x003F0000 3680KiB U-Boot(u-boot.itb) FIT image containing u-boot, ATF, and fdt
0x003F0000 - 0x00400000 64KB U-Boot env redundant 32KB env

Note that the size of the SPL and offset/size of U-Boot can vary based on bootloader configuration but the start offset of the SPL is dictated by the SOC BOOTROM per boot device and hardware partition.

Legacy Boot Firmware Image

The original Gateworks IMX8MM Boot Firmware (now considered legacy) was installed to the eMMC user hardware partition.

Legacy Venice IMX8MM Boot Firmware Image Map:

start-end len item notes
0x00000000 - 0x00008400 33KiB MBR Partition Table only first 512B used
0x00008400 - 0x00060000 351KiB SPL (spl.bin) Loads and u-boot.itb and transfers control to the ATF
0x00060000 - 0x00FF0000 15MiB U-Boot (u-boot.itb) FIT image containing u-boot, ATF, and fdt
0x00FF0000 - 0x01000000 64KB U-Boot env redundant 32KB env
0x01000000 - Disk Partitions used by the OS

Installing Compressed Disk OS Images

Gateworks releases compressed disk images for various Linux based operating systems that can be easily flashed using the U-Boot Bootloader. These disk images contain a partition table so they are tailored to the specific device size they are intended for. Additionally they are commonly configured for a small partition size to keep flash programming time at a minimum. This requires resizing the rootfs filesystem in order to take advantage of the remaining flash space.

You can install a compressed disk image using the methods described in venice/firmware-update. For example in the bootloader:

setenv dev 2 # emmc device; use mmc list to see all mmc devs
tftpboot ${loadaddr} firmware.img.gz && gzwrite mmc ${dev} ${loadaddr} ${filesize}

If you are interested in creating a compressed disk image with a custom root filesystem directory/tarball with a kernel and bootscript you can following along the process used in the in the Venice BSP makefile

If you created a filesystem that did not stretch to the partition it was installed on (as we create a minimally sized filesystem image to fit within the eMMC device for faster programming) you will want to resize it after booting to Linux. This is a one time operation after flashing a compressed disk image and can be done using the 'growpart_once' script that we install on the Ubuntu Root filesystems found in the script here (search for growpart_once)

To install the kernel and root filesystem on a removable block storage device see linux/blockdev.

U-Boot Bootloader

Gateworks supports the U-Boot Bootloader for the Venice product family.

The purpose of a bootloader is to load the Linux kernel and execute it passing it configuration parameters such as an optional kernel command-line, an optional initial ramdisk filesystem, and a device-tree.

The following items are supported in the Gateworks U-Boot for Venice:

  • IMX8M FEC GbE
  • IMX8MP EQOS GbE
  • USB Host support (USB Mass Storage and USB Networking for ASIX USB 2.0 USB Network device)
  • eMMC / microSD

The following items are not currently supported in the Gateworks U-Boot for Venice:

  • PCIe support (include PCIe based Gbe)

see uboot for more info

Note: See TracWiki for help on using the wiki.