How to load kernel and rootfs into QSPI Flash in I.MX8MPLUS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to load kernel and rootfs into QSPI Flash in I.MX8MPLUS

135 Views
Sunil_13
Contributor I

Hi,

We are Using I.MX8MPLUS Custom board. In our board we have QSPI flash with 32MB size. Up to u-boot Successfully booted in QSPI mode .

1. How to load kernel and rootfs into QSPI Flash in i.MX8MPLUS.

2. In our i.MX8MPLUS Custom board we don't have supported devices like eMMC, SD ,Nand and USB. without all these how can we load the kernel and rootfs.

3. Is there any Procedure for loading kernel and rootfs into QSPI flash without the SD card and eMMC.

 

0 Kudos
Reply
6 Replies

81 Views
Adele
Contributor I

 

@Sunil_13 

 

You can check the following link, it might help you. 

And I have sent you about this in private message to you. 

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/all-bootloader-device-tree-Linux-kernel-...

0 Kudos
Reply

87 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

# How to Load Kernel and RootFS into QSPI Flash on i.MX8MPLUS Custom Board

Based on your custom board configuration with a 32MB QSPI flash and no eMMC, SD, NAND or USB devices, here are the recommended approaches:

## QSPI Flash Boot Solution

While your U-Boot has successfully booted from QSPI, there are important limitations to consider:

1. The 32MB QSPI flash is typically not large enough to hold a complete Linux rootFS. QSPI flash on i.MX8M Plus is primarily designed for storing U-Boot/bootloader components.

2. A practical approach is to implement a hybrid solution:
- Store U-Boot in QSPI flash (already accomplished)
- Store the kernel and device tree blob (DTB) in QSPI flash
- Implement a minimal initramfs for basic functionality

## Implementation Steps

1. Generate the QSPI bootable image using the imx-mkimage tool:
```
make SOC=iMX8MP flash_evk_flexspi
```

2. Create partitions in QSPI flash with approximate sizes:
- U-Boot: 512KB (already flashed)
- Linux kernel: ~9MB
- Device tree blob: ~64KB
- U-Boot environment: ~64KB
- InitramFS (minimal rootFS): ~22MB

3. Configure U-Boot to load kernel and DTB from QSPI flash:
```
sf probe
sf read ${loadaddr} 0x80000 0x900000 # Read kernel from QSPI
sf read ${fdt_addr} 0x980000 0x10000 # Read DTB from QSPI
```

4. Create a minimal initramfs with essential tools and utilities that will fit within the available space.

5. For more complex applications, consider implementing network boot support (NFS) for a full rootFS.

This approach provides a viable solution for booting your system with the existing hardware constraints.

 

Regards

0 Kudos
Reply

79 Views
Adele
Contributor I

@Bio_TICFSL 

 

Did you delete my first reply? If this happens again, I promise I'll post this on Twitter.

 

0 Kudos
Reply

51 Views
Keta_S_Nitsure
Contributor II

@Adele If what you're saying is true, that's unbelievable.

0 Kudos
Reply

20 Views
Adele
Contributor I

@Keta_S_Nitsure 

This is real. What I really don't understand is what was wrong with my reply. After my reply was deleted, @Bio_TICFSL  posted a very similar solution, which is technically the same. I still don't understand why @Bio_TICFSL  would do this.

 

0 Kudos
Reply

77 Views
Adele
Contributor I

@Bio_TICFSL 

Please confirm this is NXP account in X.

2025-12-04_220155.png

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2254333%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHow%20to%20load%20kernel%20and%20rootfs%20into%20QSPI%20Flash%20in%20I.MX8MPLUS%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2254333%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EWe%20are%20Using%20I.MX8MPLUS%20Custom%20board.%20In%20our%20board%20we%20have%20QSPI%20flash%20with%2032MB%20size.%20Up%20to%20u-boot%20Successfully%20booted%20in%20QSPI%20mode%20.%3C%2FP%3E%3CP%3E1.%20How%20to%20load%20kernel%20and%20rootfs%20into%20QSPI%20Flash%20in%20i.MX8MPLUS.%3C%2FP%3E%3CP%3E2.%20In%20our%20i.MX8MPLUS%20Custom%20board%20we%20don't%20have%20supported%20devices%20like%20eMMC%2C%20SD%20%2CNand%20and%20USB.%20without%20all%20these%20how%20can%20we%20load%20the%20kernel%20and%20rootfs.%3C%2FP%3E%3CP%3E3.%20Is%20there%20any%20Procedure%20for%20loading%20kernel%20and%20rootfs%20into%20QSPI%20flash%20without%20the%20SD%20card%20and%20eMMC.%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E