/
Supporting Booting from QSPI Flash in Linux BSP for the i.MX RT1050/RT1060 Targets

Supporting Booting from QSPI Flash in Linux BSP for the i.MX RT1050/RT1060 Targets

 

This is an add-on product that installs on top of the Linux BSP for the NXP i.MX RT1050/1060 EVK board. It must be purchased separately from the Linux BSP product.

1. Overview

This document describes the exact steps that need to be performed to install U-Boot and Linux to the QSPI Flash on the i.MX RT1050/1060 EVK board and then to boot Linux from the QSPI Flash.

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 IMXRT1050/IMXRT1060 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 IMXRT1050-EVKB/IMXRT1060-EVKB 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:

  • imxrt1050-evk-qspi_defconfig - the NXP IMXRT1050-EVKB board

  • imxrt1060-evk-qspi_defconfig - the NXP IMXRT1060-EVKB board

will be added to U-Boot to support booting from the QSPI Flash on the boards. 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 the resultant binaries from the make command for U-Boot will be SPL.flexspi and u-boot.img images:

$ make imxrt1050-evk-qspi_defconfig $ make $ ls SPL.flexspi u-boot.img SPL.flexspi u-boot.img

or for the NXP IMXRT1060-EVKB board:

$ make imxrt1060-evk-qspi_defconfig $ make $ ls SPL.flexspi u-boot.img SPL.flexspi u-boot.img

The SPL.flexspi image must be programmed to the QPSI flash on the NXP IMXRT1050-EVKB/IMXRT1060-EVKB board at offset 0. The image consists of the U-Boot SPL and two i.MX RT10XX-specific headers required by the internal boot ROM code to correctly boot:

  • Image Vector Table (IVT). It is generated by mkimage using the board/freescale/imxrt1050-evk/imximage.cfg configuration file.

  • The FlexSPI Configuration Block. It is compiled from the board/freescale/imxrt1050-evk/flexspi_cb.c file. This file contains the FlexSPI Configuration Block parameters, as per the corresponding Processor Reference Manual. The default configuration will be set up to support the ISSI QSPI Flash is25wp064 installed on the NXP IMXRT10XX-EVK(B) boards.

The u-boot.img image is the U-Boot TPL itself. It must be programmed to the QPSI flash at offset 0x10000.

SPL in linked to the addresses in the internal OCRAM memory of i.MXRT10XX. So during booting the internal i.MXRT boot ROM code will copy the SPL image from the QSPI flash to OCRAM and execute from there. Addresses from 0x20208000 to 0x20209000 are utilized by U-Boot SPL right after the area reserved for the boot code. SPL started address is 0x2020a000 (0x2000 bytes before are reserved for the IVT header, which the boot code can also copy from the QSPI flash), stack for SPL is initialized at 0x20209000. Then SPL will initialize external SDRAM and copy and start the main U-Boot from there.

3.2. Design: U-Boot sf Commands

The spi/nxp_fspi.c driver in U-Boot will be updated to support the i.MXRT10XX variant of the FlexSPI controller. The driver along with the required clocks, pinmux and QSPI flash will be configured in the board config and DTS.

The standard U-Boot sf commands will be enabled in the U-Boot configuration to provide user API to the QSPI Flash.

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 an Linux 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 - 0x480000 - Kernel Image (multi image including the kernel and the device tree blob)

  • 0x480000 - 0x800000 - Root File System

The IMXRT1050 or IMXRT1060 Serial Downloder feature can be used to write the SPL and TPL images to U-Boot section of the QSPI Flash on the IMXRT1050-EVKB or IMXRT1060-EVKB 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. For user convenience, the dedicated installation script imxrt_install.sh will be provided:

$ imxrt_install.sh [-p project] [-t fstype] [options]

The script supports options that allow to install certain system components separately or together:

  • -S - install the bootable U-Boot SPL image SPL.flexspi to the U-Boot partition;

  • -U - install the main U-Boot image u-boot.imgto the U-Boot partition;

  • -I - install the uImage to the Kernel partition;

  • -R - install the flash file system image to the Root File System partition.

The script looks for the images to install in the currently activated distribution, these are u-boot/SPL.flexspi, u-boot/u-boot.img, projects/rootfs_flash/rootfs_flash.uImage and projects/rootfs_flash/rootfs_flash.jffs2. If a custom project is to be installed, the default rootfs_flash project name can be overridden with the option -p project_name. The default type of the flash file system jffs2 can be changed with the -t fstype option to either ubi for the UBI FS based project or to none for the project without flash file system (initramfs based projects for example). Also there are the -s, -u, -i, -r options provided to install image(s) from an arbitrary location not tied to a distribution.

The script requires the blhost and sdphost utilities and the flashloader binary provided by NXP Flashloader_i.MXRT10xx package to operate with the IMXRT over SDP. It is expected that the package is unpacked in to the tools directory of the linux-cm- distribution. If not, the -f, -b and -d options can to used to override the default location.

Also refer to imxrt_install.sh -h for the help at runtime.

3.5. Design: Update Linux Images to the QSPI Flash Using U-Boot Command Line Interface

As an alternative to installing the kernel and file system images to the QSPI Flash via the Serial Downloader feature, one can install or update the images using the U-Boot command monitor, if U-Boot is already installed.

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 - 0x480000 - Kernel Image (multi image including the kernel and the device tree blob)

  • 0x480000 - 0x800000 - Root File System

The following commands will be defined in the U-Boot environment to update the kernel and rootfs components:

  • sf_kernel_update - Update the Kernel section

  • sf_rootfs_update - Update the RootFS section

For the IMXRT1050 BSP or IMXRT1060 BSP the sf_*_update commands will download images from the TFTP server via networking and install them to the corresponding section in the QSPI Flash. The names of the images to download will be constructed automatically using the following U-Boot environment variables:

  • project - is the project name, default is rootfs_flash

  • fstype - is the type of the flash file system image : jffs2 or ubi, default is jffs2

The name of the kernel multiimage in the sf_kernel_update command is ${project}.uImage, i.e. rootfs_flash.uImage in the default settings. The name of the rootfs image in the sf_rootfs_update command is ${project}.${fstype}, i.e. rootfs_flash.jffs2 in the default settings.

3.6. Design: Linux Boot from QSPI Flash

The separate project projects/rootfs_flash will be created to demonstrate booting Linux from QSPI flash. The following main feature will be enabled in the new project:

  • Support for the QSPI Flash will be enabled in the kernel configuration.

  • initramfs will be disabled in the kernel configuration. Instead the root filesystem will be mounted on JFSS2 or alternatively on an UBIFS file system in the QSPI Flash.

  • The kernel and the DTB images will be built in a single multi-part image.

To implement these features the following options will be added to the common build rules and will be used in Makefile for the rootfs_flash project:

  • RFS_BUILD_DIR - temporary directory to build the root file system image

  • FLASHFS_TYPE - to select certain file system image to build: jffs2 or ubi

  • MKFSUBIFS_FLAGS - Flash-specific flags for the mkfs.ubifs utility (if FLASHFS_TYPE is ubi)

  • UBINIZE_FLAGS - Flash-specific flags for the ubinize utility (if FLASHFS_TYPE is ubi)

  • SEPARATE_DTB - tells the make either build the multi-part image or save the DTB separately.

3.7. Design: Linux Device Driver for QSPI Flash and Flash File System

The existing nxp-fspi driver from the common NXP's codebase will be used to provide support for the FlexSPI controller. The driver will be updated to support the i.MXTRT1050/i.MXTRT1060 SoC.

The MTD, SPI_MEM, MTD_SPI_NOR kernel features will be enabled in the rootfs_flash project's configurations, so that the QSPI Flash will be available in Linux as a standard MTD device.

The UBI, UBIFS and JFFS2 related options will be enabled to support for Linux Flash file systems.

4. Test Plan

4.1. Secure Download Area

The downloadable materials developed by this project are available from a secure Web page on the Emcraft Systems web site. Specifically, proceed to the following URL to download the software materials.

  • For the i.MX RT1050 BSP (release 3.0.4):

The page is protected as follows:

Login: CONTACT EMCRAFT

Password: CONTACT EMCRAFT

  • For the i.MX RT1050 BSP (release 3.1.0):

The page is protected as follows:

Login: CONTACT EMCRAFT

Password: CONTACT EMCRAFT

  • For the i.MX RT1060 BSP (release 3.1.0):

The page is protected as follows:

Login: CONTACT EMCRAFT

Password: CONTACT EMCRAFT

4.2. Downloadable Files

The following files are available from the secure download area for this release:

  • SPL.flexspi - Bootable U-Boot SPL image to be installed to the QSPI Flash.

  • u-boot.img - U-Boot TPL image to be installed to the QSPI Flash.

  • rootfs_flash.uImage - Multiimage with Linux kernel and DTB.

  • rootfs_flash.jffs2 - JFFS2 image with Linux rootfs.

  • rootfs_flash.ubi - UBIFS image with Linux rootfs.

  • u-boot.patch - Source code patch to U-Boot.

  • linux.patch - Source code patch to Linux.

  • projects.patch - Source code patch to projects/.

4.3. Test Set-Up

4.3.1. Hardware Set-Up

The following hardware set-up is required for execution of the test plan in this project:

  • A development host Linux PC.

  • The NXP IMXRT1050-EVKB or IMXRT1060-EVKB board.

  • The following hardware reworks are required on the NXP iMXRT1050-EVKB board to enable the QSPI Flash, as described in section 2.7 of the NXP IMXRT1050-EVKB Board Hardware User’s Guide:

    • Remove resistors: R356, R361 - R366

    • Weld 0Ω resistors: R153 - R158.

  • The NXP IMXRT1050-EVKB or IMXRT1060-EVKB Board is connected to LAN using the J19 100M ENET connector.

  • The NXP IMXRT1050-EVKB Board is connected to the development host via the J28 micro-USB connector to provide Serial Console. The NXP IMXRT1060-EVKB Board is connected to the development host via the J1 micro-USB connector to provide Serial Console.

  • The NXP IMXRT1050-EVKB Board is connected to the development host via the J9 micro-USB connector for Serial Downloader. The NXP IMXRT1060-EVKB Board is connected to the development host via the J48 micro-USB connector for Serial Downloader.

4.3.2. Software Set-Up

4.3.2.1. Flashloader

  1. Download the archive with Flashloader and the host tools for the Serial Downloader from the nxp.com site Search | NXP Semiconductors .

  2. Unzip the Flashloader archive to the tools directory on the top of the linux-cm-<bsp> installation:

    $ cd linux-cm-<bsp> $ cd tools $ unzip ~/Downloads/<Flashloader_image>.zip
  3. Enable permissions to execute the blhost and sdphost utilities from the Flashloader_i.MXRT1050_GA or from Flashloader_RT106x_1.0_GA package:

    $ chmod +x Flashloader_i.MXRT1050_GA/Flashloader_RT1050_1.1/Tools/sdphost/linux/i386/sdphost Flashloader_i.MXRT1050_GA/Flashloader_RT1050_1.1/Tools/blhost/linux/i386/blhost

    or

    $ chmod +x Flashloader_RT106x_1.0_GA/Tools/sdphost/linux/i386/sdphost Flashloader_RT106x_1.0_GA/Tools/blhost/linux/i386/blhost

4.3.2.2. U-Boot Build

  1. Apply the U-Boot patch from the top of the fresh linux-cortexm installation:

    $ cd u-boot $ patch -p1 < ../u-boot.patch
  2. Build the U-Boot images bootable from QSPI Flash.

    1. Configure and build U-Boot for QSPI Flash:

      • for the IMXRT1050 EVKB board:

        $ make mrproper $ make imxrt1050-evk-qspi_defconfig $ make
      • for the IMXRT1060 EVKB board:

        $ make mrproper $ make imxrt1060-evk-qspi_defconfig $ make

4.3.2.3. Linux Build

  1. Apply the Linux and projects/ patches:

    $ cd linux $ patch -p1 < ../linux.patch $ cd ../projects $ patch -p1 < ../projects.patch
  2. Build the rootfs_flash project in the default jffs2 configuration:

    $ cd rootfs_flash $ make
  3. Redefine FLASHFS_TYPE as ubi to build the rootfs_flash project in the ubi configuration:

    $ cd rootfs_flash $ make FLASHFS_TYPE=ubi
  4. Copy the resultant images to a TFTP server:

    $ sudo cp rootfs_flash.uImage rootfs_flash.jffs2 rootfs_flash.ubi ~/tmp/

4.3.2.4. Prebuilt Binaries

For convenience, the prebuilt binaries resulting from the above build procedure are available in the area documented in Section: "Downloadable Files"

4.4. Detailed Test Plan

4.4.1. Test Plan: U-Boot Boot from QSPI Flash

The following step-wise test procedure will be used:

  1. Power off the target board.

  2. Set-up the SW7 switch on the target board for the Serial Downloader mode (SW7/3 = OFF, SW7/4 = ON)

  3. Power on the target board.

  4. Run the imxrt_install.sh script with the -S -U options in the terminal with activated cross-development environment in order to install U-Boot:

    $ imxrt_install.sh -SU

    or specify path to the U-Boot binaries via -s and -u command line arguments:

    $ imxrt_install.sh [-s path_to_SPL.flexspi] [-u path_to_u-boot.img]
  5. Wait the script to complete the installation, make sure there are no errors reported in the script output.

  6. Power off the target board. Set-up the SW7 switch on the target board to boot from QSPI Flash (SW7/1 = OFF, SW7/2 = OFF, SW7/3 = ON, SW7/4 = OFF)

  7. Power on the target board.

  8. Validate that U-Boot has successfully booted from QSPI Flash:

    U-Boot SPL 2024.04-00038-g2b606df5c28-dirty (Nov 22 2024 - 17:07:38 +0300) U-Boot SPL 2024.04-00038-g2b606df5c28-dirty (Nov 22 2024 - 17:07:38 +0300) Trying to boot from NOR U-Boot 2024.04-00038-g2b606df5c28-dirty (Nov 22 2024 - 17:07:38 +0300) DRAM: 32 MiB Core: 82 devices, 17 uclasses, devicetree: separate MMC: FSL_SDHC: 0 Loading Environment from SPIFlash... SF: Detected is25wp064 with page size 256 Bytes, erase size 4 KiB, total 8 MiB OK In: serial@40184000 Out: serial@40184000 Err: serial@40184000 Net: eth0: ethernet@402d8000 Hit any key to stop autoboot: 0

4.4.2. Test Plan: U-Boot sf Commands

The following step-wise test procedure will be used:

  1. Boot U-Boot from QSPI Flash.

  2. Probe the QSPI Flash. Make sure that the correct Flash info is printed out to the console:

    => sf probe 0 SF: Detected is25wp064 with page size 256 Bytes, erase size 4 KiB, total 8 MiB =>
  3. Read the U-Boot partition to RAM:

    => sf read ${loadaddr} 0 0x60000 device 0 offset 0x0, size 0x60000 SF: 327680 bytes @ 0x0 Read: OK =>
  4. Make sure the FlexSPI Configuration Block is at the beginning of the read data: the first 4 symbols must be "FCFB" for the IMXRT1050-EVKB boards:

    => md ${loadaddr} 1 80007fc0: 42464346 FCFB =>
  5. Erase an area in the middle of QSPI Flash:

    => sf erase 0x300000 0x60000 SF: 393216 bytes @ 0x300000 Erased: OK =>
  6. Write the U-Boot image to the erased area:

    => sf write ${loadaddr} 0x300000 0x60000 device 0 offset 0x300000, size 0x60000 SF: 393216 bytes @ 0x300000 Written: OK =>
  7. Read it back to a separate area in RAM:

    => sf read 0x81000000 0x300000 0x60000 device 0 offset 0x300000, size 0x60000 SF: 393216 bytes @ 0x300000 Read: OK =>
  8. Make sure that the data in 2 areas are identical:

    => cmp.b ${loadaddr} 0x81000000 0x60000 Total of 393216 byte(s) were the same =>

4.4.3. Test Plan: U-Boot Environment in QSPI Flash

The following step-wise test procedure will be used:

  1. Define and save a test variable:

    => setenv testvar testval => savee Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done Valid environment: 2 OK =>
  2. Reset the board:

    => reset
  3. Make sure the test variable exists and has the correct value:

    => print testvar testvar=testval =>

4.4.4. Test Plan: Install U-boot and Linux Images to QSPI Flash

The following step-wise test procedure will be used:

  1. The procedure for initial installation of the U-Boot imaged with using Serial Downloader which is described in Section: "Test Plan: U-Boot Boot from QSPI Flash" can be used to re-install U-boot on the working board, another components, including the U-Boot environment, Linux kernel and rootfs will not be damaged by this:

    $ imxrt_install.sh -SU starting flashloader ... Status (HAB mode) = 1450735702 (0x56787856) HAB disabled. Reponse Status = 4042322160 (0xf0f0f0f0) HAB Success. Preparing to send 90039 (0x15fb7) bytes to the target. (1/1)1%Status (HAB mode) = 1450735702 (0x56787856) HAB disabled. Reponse Status = 2290649224 (0x88888888) Write File complete. Status (HAB mode) = 1450735702 (0x56787856) HAB disabled. Inject command 'fill-memory' Successful generic response to command 'fill-memory' Response status = 0 (0x0) Success. Inject command 'configure-memory' Successful generic response to command 'configure-memory' Response status = 0 (0x0) Success. erasing 0x60000000+0x10000 ... Inject command 'flash-erase-region' Successful generic response to command 'flash-erase-region' Response status = 0 (0x0) Success. Inject command 'write-memory' Preparing to send 55064 (0xd718) bytes to the target. Successful generic response to command 'write-memory' (1/1)100% Completed! Successful generic response to command 'write-memory' Response status = 0 (0x0) Success. Wrote 55064 of 55064 bytes. erasing 0x60010000+0x50000 ... Inject command 'flash-erase-region' Successful generic response to command 'flash-erase-region' Response status = 0 (0x0) Success. Inject command 'write-memory' Preparing to send 311688 (0x4c188) bytes to the target. Successful generic response to command 'write-memory' (1/1)100% Completed! Successful generic response to command 'write-memory' Response status = 0 (0x0) Success. Wrote 311688 of 311688 bytes.
  2. The imxrt_install.sh script can be used for installation of the Linux images such as uImage and the root filesystem on the working board, another components, including the U-Boot, U-Boot environment will not be damaged by this:

    $ imxrt_install.sh -p rootfs_flash -t jffs2 -I -R starting flashloader ... Status (HAB mode) = 1450735702 (0x56787856) HAB disabled. Reponse Status = 4042322160 (0xf0f0f0f0) HAB Success. Preparing to send 90039 (0x15fb7) bytes to the target. (1/1)1%Status (HAB mode) = 1450735702 (0x56787856) HAB disabled. Reponse Status = 2290649224 (0x88888888) Write File complete. Status (HAB mode) = 1450735702 (0x56787856) HAB disabled. Inject command 'fill-memory' Successful generic response to command 'fill-memory' Response status = 0 (0x0) Success. Inject command 'configure-memory' Successful generic response to command 'configure-memory' Response status = 0 (0x0) Success. erasing 0x60080000+0x3cc000 ... Inject command 'flash-erase-region' Successful generic response to command 'flash-erase-region' Response status = 0 (0x0) Success. Inject command 'write-memory' Preparing to send 3979574 (0x3cb936) bytes to the target. Successful generic response to command 'write-memory' (1/1)100% Completed! Successful generic response to command 'write-memory' Response status = 0 (0x0) Success. Wrote 3979574 of 3979574 bytes. erasing 0x60480000+0x380000 ... Inject command 'flash-erase-region' Successful generic response to command 'flash-erase-region' Response status = 0 (0x0) Success. Inject command 'write-memory' Preparing to send 741596 (0xb50dc) bytes to the target. Successful generic response to command 'write-memory' (1/1)100% Completed! Successful generic response to command 'write-memory' Response status = 0 (0x0) Success. Wrote 741596 of 741596 bytes.

4.4.5. Test Plan: Update Linux Images (JFFS2 variant) to QSPI Flash

The following step-wise test procedure will be used:

  1. Boot U-Boot from QSPI Flash.

  2. Reset the environment:

    => env default -f -a => saveenv =>
  3. Set IP addresses as per actual networking settings:

    => setenv ipaddr 192.168.1.105 => setenv serverip 192.168.1.73 => setenv gatewayip 192.168.1.1 => saveenv =>
  4. Make sure the JFFS2 file system type is selected:

    => printenv fstype fstype=jffs2 =>
  5. Install the software components:

    => sf probe 0 SF: Detected is25wp064 with page size 256 Bytes, erase size 4 KiB, total 8 MiB => run sf_kernel_update Using ethernet@402d8000 device TFTP from server 192.168.1.83; our IP address is 192.168.1.82 Filename 'imxrt1050/rootfs_flash.uImage'. Load address: 0x80007fc0 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ############################################################### 633.8 KiB/s done Bytes transferred = 3979574 (3cb936 hex) SF: 4194304 bytes @ 0x80000 Erased: OK device 0 offset 0x80000, size 0x3cb936 SF: 3979574 bytes @ 0x80000 Written: OK => run sf_rootfs_update Using ethernet@402d8000 device TFTP from server 192.168.1.83; our IP address is 192.168.1.82 Filename 'imxrt1050/rootfs_flash.jffs2'. Load address: 0x80007fc0 Loading: ################################################################# ################################################################# ############### 620.1 KiB/s done Bytes transferred = 741596 (b50dc hex) SF: 3670016 bytes @ 0x480000 Erased: OK device 0 offset 0x480000, size 0xb50dc SF: 741596 bytes @ 0x480000 Written: OK =>

4.4.6. Test Plan: Linux Boot from QSPI Flash (JFFS2 variant)

The following step-wise test procedure will be used:

This item requires the JFFS2 image installed to the QSPI Flash as per Section: "Test Plan: Update Linux Images (JFFS2 variant) to QSPI Flash" and the fstype variable is set as jffs2 in the U-Boot environment.

  1. Reset the board and make sure it automatically boots up to busybox:

    => reset ... This architecture does not have kernel memory protection. Run /sbin/init as init process / #

4.4.7. Test Plan: Linux Device Driver for QSPI Flash and Flash File System (JFFS2 variant)

The following step-wise test procedure will be used:

This item requires the JFFS2 image installed to the QSPI Flash as per Section: "Test Plan: Update Linux Images (JFFS2 variant) to QSPI Flash" and the fstype variable is set as jffs2 in the U-Boot environment.

  1. Boot from the QSPI Flash up the busybox shell.

  2. Make sure that the rootfs partition is mounted as the Linux root file system:

    / # mount /dev/root on / type jffs2 (rw,relatime) devtmpfs on /dev type devtmpfs (rw,relatime) proc on /proc type proc (rw,relatime) sysfs on /sys type sysfs (rw,relatime) tmpfs on /tmp type tmpfs (rw,nosuid,relatime,mode=777) tmpfs on /run type tmpfs (rw,nosuid,relatime,mode=777) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000) / #
  3. Make copy of the busybox binary in the Flash-based root file system and reboot:

    / # cp /bin/busybox / / # reboot
  4. After reboot, make sure that the original file and the copy are identical:

    / # md5sum /busybox /bin/busybox a27b10e39189217c9f39b85c8b3fe96d /busybox a27b10e39189217c9f39b85c8b3fe96d /bin/busybox / #

4.4.8. Test Plan: Update Linux Images (UBIFS variant) to QSPI Flash

The following step-wise test procedure will be used:

  1. Boot U-Boot from QSPI Flash.

  2. Reset the environment:

    => env default -f -a => saveenv =>
  3. Set IP addresses as per actual networking settings:

    => setenv ipaddr 192.168.1.105 => setenv serverip 192.168.1.73 => setenv gatewayip 192.168.1.1 => saveenv =>
  4. Set the UBI file system type and save the environment:

    => setenv fstype ubi => savee Saving Environment to SPIFlash... Erasing SPI flash...Writing to SPI flash...done Valid environment: 2 OK =>
  5. Install the software components:

    => sf probe 0 SF: Detected is25wp064 with page size 256 Bytes, erase size 4 KiB, total 8 MiB => run sf_kernel_update Using ethernet@402D8000 device TFTP from server 192.168.1.73; our IP address is 192.168.1.105 Filename 'rootfs_flash.uImage'. Load address: 0x80007fc0 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################### 1.2 MiB/s done Bytes transferred = 3503272 (3574a8 hex) SF: 4194304 bytes @ 0x80000 Erased: OK device 0 offset 0x80000, size 0x3574a8 SF: 3503272 bytes @ 0x80000 Written: OK => run sf_rootfs_update Using ethernet@402D8000 device TFTP from server 192.168.1.73; our IP address is 192.168.1.105 Filename 'rootfs_flash.ubi'. Load address: 0x80007fc0 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ############################################################# 1.3 MiB/s done Bytes transferred = 1638400 (190000 hex) SF: 3670016 bytes @ 0x480000 Erased: OK device 0 offset 0x480000, size 0x190000 SF: 1638400 bytes @ 0x480000 Written: OK =>

4.4.9. Test Plan: Linux Boot from QSPI Flash (UBIFS variant)

The following step-wise test procedure will be used:

This item requires the UBIFS image installed to the QSPI Flash as per Section: "Test Plan: Update Linux Images (UBIFS variant) to QSPI Flash" and the fstype variable is set as ubi in the U-Boot environment.

  1. Reset the board and make sure it automatically boots up to busybox:

    => reset ... This architecture does not have kernel memory protection. Run /sbin/init as init process / #

4.4.10. Test Plan: Linux Device Driver for QSPI Flash and Flash File System (UBIFS variant)

The following step-wise test procedure will be used:

This item requires the UBIFS image installed to the QSPI Flash as per Section: "Test Plan: Update Linux Images (UBIFS variant) to QSPI Flash" and the fstype variable is set as ubi in the U-Boot environment.

  1. Boot from the QSPI Flash up the busybox shell.

  2. Make sure that the rootfs partition is mounted as the Linux root file system:

    / # mount ubi0:rootfs on / type ubifs (rw,relatime,assert=read-only,ubi=0,vol=0) devtmpfs on /dev type devtmpfs (rw,relatime) proc on /proc type proc (rw,relatime) sysfs on /sys type sysfs (rw,relatime) tmpfs on /tmp type tmpfs (rw,nosuid,relatime,mode=777) tmpfs on /run type tmpfs (rw,nosuid,relatime,mode=777) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000) / #
  3. Make copy of the busybox binary in the Flash-based root file system and reboot:

    / # cp /bin/busybox / / # reboot
  4. After reboot, make sure that the original file and the copy are identical:

    / # md5sum /busybox /bin/busybox a27b10e39189217c9f39b85c8b3fe96d /busybox a27b10e39189217c9f39b85c8b3fe96d /bin/busybox / #

Related content