Serial NOR Boot
IoT Yocto now provides reference support for booting from Serial NOR Flash used to store the bootloader. Others such as kernel and rootfs are stored in the storage device. The Genio EVK does not have on-board Serial NOR Flash, so this section is based on reworked EVK boards for Serial NOR boot demonstration.
Build Packages
Please assign the MACHINE
config variable to build the packages for the Genio EVK board:
- The bootloader will boot from Serial NOR Flash and then boot the kernel and rootfs from eMMC.
export MACHINE=genio-510-evk-norboot bitbake rity-demo-image
- The bootloader will boot from Serial NOR Flash and then boot the kernel and rootfs from eMMC.
export MACHINE=genio-700-evk-norboot bitbake rity-demo-image
- The bootloader will boot from Serial NOR Flash and then boot the kernel and rootfs from UFS.
export MACHINE=genio-1200-evk-norboot-ufs bitbake rity-demo-image
Serial NOR Flash Layout
We store the bootloader defined as firmware category in Serial NOR Flash. The following table describes the layout scheme for the Genio EVK board using Serial NOR Flash.
Category |
Partition Label |
Size |
Partition Image |
Remark |
---|---|---|---|---|
Firmware |
nor_env |
4MB |
u-boot-env.bin |
Runtime generated by genio-flash tool based on u-boot-initial-env plain text file and additional configurations |
Firmware |
nor_bootassets |
4MB |
bootassets.img |
Static bootloader data such as boot logos |
Firmware |
nor_misc |
1MB |
N/A |
Support A/B firmware update feature |
Firmware |
nor_dramk |
512KB |
N/A |
One-time programming for per-board DRAM calibration data |
Firmware |
nor_firmware_b |
4MB |
N/A |
Preserved for future use |
Firmware |
nor_firmware_a |
4MB |
N/A |
Preserved for future use |
Firmware |
nor_fip_b |
4MB |
fip.bin |
The content in?bootloaders and?bootloaders_b?should be the same initially |
Firmware |
nor_fip_a |
4MB |
fip.bin |
Containing fip.bin, which consists of BL3* loaders (BL31, BL32, BL33) |
Firmware |
nor_bl2 |
4MB |
bl2.img |
2nd stage bootloader based on Trusted-Firmware-A |
Layout Configurations
IoT Yocto provides a simple solution for adjusting the size and layout of Serial NOR Flash. Users can find the layout definition in the download agent (lk) and U-Boot for customization. The following example describes the nor_bl2
layout definition for Genio 1200-EVK :
target.h in the download agent (lk) for Genio 1200-EVK :
#define NOR_PARTITIONS_INDEX0 "nor_bl2"
genio_1200_evk_ufs_qspi_defconfig in the U-Boot for Genio 1200-EVK:
CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:4m(nor_bl2),..."
In this example, users can find the 4MB region size and the offset of nor_bl2
in the layout definition for Serial NOR Flash. In addition, users can also customize the layout definition according to their product requirements.
Note
Please make sure the layout definition of the download agent (lk) and U-Boot are the same, otherwise the system will fail to boot.