[[PageOutline]] = 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 [http://dev.gateworks.com/venice/boot_firmware/ pre-built Boot Firmware] ready to flash onto boot devices as well as source for building and/or modifying the boot firmware yourself. [=#bootrom] == 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. [=#firmware-image] == Boot Firmware Image The firmware image contains all of the components of the 'Boot Firmware': - MBR partition table - ATF - Device Tree Binary - Note device tree source code (eg GW7200) is located in kernel source code at path: linux-venice/arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi - Link for the source code [https://github.com/Gateworks/linux-venice here] - U-Boot Venice Boot Firmware Image Map: * imx8mm: ||= start-end =||= len =||= item =||= notes =|| || 0x0000000 - 0x0008400 || 33KiB || MBR Partition Table || only first 512B used || || 0x0008400 - 0x0060000 || 350KiB || SPL || Loads and u-boot.itb and transfers control to the ATF || || 0x0060000 - 0x0FF0000 || 15MiB || u-boot.itb || FIT image containing u-boot, ATF, and fdt || || 0x0FF0000 - 0x1000000 || 64KB || U-Boot env || redudant 32KB env || || 0x1000000 - || || Disk Partitions || used by the OS || * imx8mn/imx8mp: ||= start-end =||= len =||= item =||= notes =|| || 0x0000000 - 0x0008400 || 32KiB || MBR Partition Table || only first 512B used || || 0x0008000 - 0x0060000 || 351KiB || SPL || Loads and u-boot.itb and transfers control to the ATF || || 0x0060000 - 0x0FF0000 || 15MiB || u-boot.itb || FIT image containing u-boot, ATF, and fdt || || 0x0FF0000 - 0x1000000 || 64KB || U-Boot env || redudant 32KB env || || 0x1000000 - || || Disk Partitions || used by the OS || [=#disk-images] == Building a Bootable Disk Images Gateworks releases compressed disk images 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. Once you have a root filesystem directory/tarball and have a kernel Image you can create a compressed disk image that can be installed easily from the bootloader. This is process is demonstrated in the [https://github.com/Gateworks/bsp-venice/blob/master/Makefile Venice BSP makefile] Once you have a compressed disk image you can install this using the methods described in [wiki:venice#firmware-update venice/firware-update]. For example in the bootloader: {{{#!bash setenv dev 2 # emmc device; use mmc list to see all mmc devs tftpboot ${loadaddr} firmware.img.gz && gzwrite mmc ${dev} ${loadaddr} ${filesize} }}} * always take care to use a compressed disk image that is compatible with the SoC on your board (see [wiki:venice/firmware#serial-ethernet venice/firmware] for details) 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 [https://github.com/Gateworks/ubuntu-rootfs/blob/master/ubuntu-rootfs.sh here] (search for growpart_once) To install the kernel and root filesystem on a removable block storage device see [wiki:linux/blockdev]. [=#u-boot] == 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 [wiki:uboot] for more info