Support Booting from QSPI Flash in Linux BSP for the i.MX RT1170 Targets
- 1 1. Overview
- 2 2. Requirements
- 3 3. Design
- 3.1 3.1. Design: U-Boot Boot from QSPI Flash
- 3.2 3.2. Design: U-Boot sf Commands
- 3.3 3.3. Design: U-Boot Environment in QSPI Flash
- 3.4 3.4. Design: Install U-Boot Images to the QSPI Flash using Serial Downloader
- 3.5 3.5. Design: Install Linux Images to the QSPI Flash using U-Boot Command Line Interface
- 3.6 3.6. Design: Linux Boot from QSPI Flash
- 3.7 3.7. Design: Linux Device Driver for QSPI Flash and Flash File System
- 4 4. Test Plan
- 4.1 4.1. Secure Download Area
- 4.2 4.2. Downloadable Files
- 4.3 4.3. Test Set-Up
- 4.3.1 4.3.1. Hardware Set-Up
- 4.3.2 4.3.2. Software Set-Up
- 4.3.2.1 4.3.2.1. MCUXpresso Secure Provisioning Tool
- 4.3.2.2 4.3.2.2. U-Boot Build:
- 4.3.2.3 4.3.2.3. Linux Build:
- 4.4 4.4. Detailed Test Plan
- 4.4.1 4.4.1. Test Plan: U-Boot Boot from QSPI Flash
- 4.4.2 4.4.2. Test Plan: U-Boot sf Commands
- 4.4.3 4.4.3. Test Plan: U-Boot Environment in QSPI Flash
- 4.4.4 4.4.4. Test Plan: Install U-boot Images to QSPI Flash
- 4.4.5 4.4.5. Test Plan: Install Linux Images (JFFS2 variant) to QSPI Flash
- 4.4.6 4.4.6. Test Plan: Linux Boot from QSPI Flash (JFFS2 variant)
- 4.4.7 4.4.7. Test Plan: Linux Device Driver for QSPI Flash and Flash File System (JFFS2 variant)
- 4.4.8 4.4.8. Test Plan: Install Linux Images (UBIFS variant) to QSPI Flash
- 4.4.9 4.4.9. Test Plan: Linux Boot from QSPI Flash (UBIFS variant)
- 4.4.10 4.4.10. Test Plan: Linux Device Driver for QSPI Flash and Flash File System (UBIFS variant)
1. Overview
The following is a high-level overview of the problem being resolved by this project:
This project develops support for booting from QSPI Flash in the Linux i.MX RT1170 BSP.
Note: This project is developed for MIXMRT1170-EVK board only. Since the MIXMRT1170-EVKB uses a different type of QSPI Flash, this AN does not apply to the EVKB boards.
2. Requirements
2.1. Detailed Requirements
The following are the requirements for this project:
Support booting of U-Boot from QSPI Flash, with no reliance on presence of SD Card or any other storage devices.
Rationale: Explicit customer requirement.
Implementation: Section: "Design: U-Boot Boot from QSPI Flash".
Test: Section: "Test Plan: U-Boot Boot from QSPI Flash".
Support the U-Boot standard SPI Flash commands (the
sfcommands family) for QSPI Flash.Rationale: Explicit customer requirement.
Implementation: Section: "Design: U-Boot sf Commands".
Test: Section: "Test Plan: U-Boot sf Commands".
Store the U-Boot environment in QSPI Flash.
Rationale: Explicit customer requirement.
Implementation: Section: "Design: U-Boot Environment in QSPI Flash".
Test: Section: "Test Plan: U-Boot Environment in QSPI Flash".
Support installation of the U-Boot images to the QSPI Flash using the IMXRT1170 Serial Downloader feature.
Rationale: Explicit customer requirement.
Implementation: Section: "Design: Install U-Boot Images to the QSPI Flash using Serial Downloader".
Test: Section: "Test Plan: Install U-boot Images to QSPI Flash".
Support installation of the Linux images to QSPI Flash from the networking from the U-Boot command line interface.
Rationale: Explicit customer requirement.
Implementation: Section: "Design: Install Linux Images to the QSPI Flash using U-Boot command line interface".
Test: Section: "Test Plan: Install Linux Images (JFFS2 variant) to QSPI Flash", Section: "Test Plan: Install Linux Images (UBIFS variant) to QSPI Flash".
Support Linux boot from QSPI Flash, in the following configuration:
multiimage including kernel and DTB loaded from QSPI Flash to RAM for execution;
root file system mounted in QSPI Flash as the read-write Flash file system (JFFS2 or UBIFS optionally).
Rationale: Explicit customer requirement.
Implementation: Section: "Design: Linux Boot from QSPI Flash".
Test: Section: "Test Plan: Linux Boot from QSPI Flash (JFFS2 variant)", Section: "Test Plan: Linux Boot from QSPI Flash (UBIFS variant)".
Support QSPI Flash in Linux. This must include support for Linux Flash file system.
Rationale: Explicit customer requirement.
Implementation: Section: "Design: Linux Device Driver for QSPI Flash and Flash File System".
Test: Section: "Test Plan: Linux Device Driver for QSPI Flash and Flash File System (JFFS2 variant)", Section: "Test Plan: Linux Device Driver for QSPI Flash and Flash File System (UBIFS variant)".
2.2. Detailed Non-Requirements
The following are the non-requirements for this project that may otherwise not be obvious:
Support for any Flash devices other than the QSPI Flash device present on the NXP IMXRT1170-EVK boards is not required.
Rationale: Costs reduction measure.
Support for Linux boot scenarios other than the one listed in Section: "Detailed Requirements" is not required.
Rationale: Costs reduction measure.
3. Design
3.1. Design: U-Boot Boot from QSPI Flash
A dedicated configuration file imxrt1170-evk-qspi_defconfig will be added to U-Boot to support booting from the QSPI Flash on the NXP IMXRT1170-EVK board. The standard build procedure will be used to generate the bootable SPL and TPL images. The Makefile in the U-Boot source tree will be updated to generate the special header and prepend it to the general SPL image in order to make it bootable from the QSPI Flash if the corresponding option is enabled in the config file, the resulting file will be saved with the ".flexspi" extension in the filename. So in case of the imxrt1170-evk-qspi configuration the resultunt binaries from the make command for U-Boot will be SPL.flexspi and u-boot.img images:
make imxrt1170-evk-qspi_defconfig
make
ls SPL.flexspi u-boot.img The SPL.flexspi image must be programmed to the QPSI flash on the NXP IMXRT1170-EVK board at offset 0. The image consists of the U-Boot SPL and two i.MXRT1170-specific headers:
Image Vector Table (IVT);
The FlexSPI Configuration Block.
The Image Vector Table is generated by mkimage using the board/freescale/imxrt1170-evk/imximage.cfg configuration file.
The The FlexSPI Configuration Block is compiled from the board/freescale/imxrt1170-evk/flexspi_cb.c file. This file contains the FlexSPI Configuration Block parameters, as per the corresponding Processor Reference Manual.
The u-boot.img image is the U-Boot TPL itself. It must be programmed to the QPSI flash on the NXP IMXRT1170-EVK board at offset 0x10000.
The default configuration will be set up to support the ISSI QSPI Flash installed on the EVK board.
3.2. Design: U-Boot sf Commands
The standard U-Boot sf commands will be enabled in the U-Boot configuration to support the SPI Flash read, erase and write operations.
3.3. Design: U-Boot Environment in QSPI Flash
Whenever the corresponding configuration described above is selected in U-Boot, the U-Boot environment will be stored in the QSPI Flash.
The environment, along with the redundant environment copy, will be placed at the address range 0x60000 - 0x80000 in the QSPI Flash.
3.4. Design: Install U-Boot Images to the QSPI Flash using Serial Downloader
The QSPI Flash device will be logically divided into 4 sections to store the software components of the system:
0x000000 - 0x060000- U-Boot (both SPL + TPL images)0x060000 - 0x080000- U-Boot Environment0x080000 - 0x880000- Kernel Image (multi image including the kernel and the device tree blob)0x880000 - 0x1000000- Root File System
The IMXRT1170 Serial Downloader feature can be used to write the SPL and TPL images to U-Boot section of the QSPI Flash on the IMXRT1170-EVK board. The SPL.flexspi image must be installed at offset 0 of the QSPI Flash, the u-boot.img image must be installed at offset 0x10000 of the QSPI Flash.