Support Booting from QSPI Flash in Linux BSP for the i.MX RT1170 Targets

Support Booting from QSPI Flash in Linux BSP for the i.MX RT1170 Targets

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:

  1. Support booting of U-Boot from QSPI Flash, with no reliance on presence of SD Card or any other storage devices.

  2. Support the U-Boot standard SPI Flash commands (the sf commands family) for QSPI Flash.

  3. Store the U-Boot environment in QSPI Flash.

  4. Support installation of the U-Boot images to the QSPI Flash using the IMXRT1170 Serial Downloader feature.

  5. Support installation of the Linux images to QSPI Flash from the networking from the U-Boot command line interface.

  6. Support Linux boot from QSPI Flash, in the following configuration:

  7. Support QSPI Flash in Linux. This must include support for Linux Flash file system.

2.2. Detailed Non-Requirements

The following are the non-requirements for this project that may otherwise not be obvious:

  1. 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.

  2. 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 Environment

  • 0x080000 - 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.