Hi @Yuri ,
We are working with the i.MX8M Plus EVK, which has 32 MB QSPI flash.
Our goal is to boot U-Boot, Linux kernel, device tree, and initramfs (rootfs.img ) entirely from QSPI flash.
We are able to successfully boot:
U-Boot (from flash.bin)
Linux kernel (Image.gz)
Device Tree (imx8mp-evk.dtb)
However, we are facing issues when loading and using the initramfs/rootfs image from QSPI flash. The kernel starts successfully, but the kernel hangs at Waiting for removable media.... see the below log attached.
-----Flash Layout and Image Sizes----------------
QSPI flash size: 32 MB
flash.bin (U-Boot + SPL) ~2.3 MB
Image.gz (Kernel) ~13.5 MB
imx8mp-evk.dtb ~86 KB
rootfs.img ~12.6 MB
----QSPI Offset Layout----------
flash.bin @ 0x00000000
Image.gz @ 0x00240000
imx8mp-evk.dtb @ 0x01000000
rootfs.img @ 0x01080000
------Programming files into QSPI (from SD card)---------
sf probe 0
sf erase 0x0 0x2000000
fatload mmc 1 ${loadaddr} flash.bin
sf write ${loadaddr} 0x0 ${filesize}
fatload mmc 1 ${loadaddr} Image.gz
sf write ${loadaddr} 0x240000 ${filesize}
fatload mmc 1 ${loadaddr} imx8mp-evk.dtb
sf write ${loadaddr} 0x1000000 ${filesize}
fatload mmc 1 ${loadaddr} rootfs.img # initramfs (cpio.gz)
sf write ${loadaddr} 0x1080000 ${filesize}
------After flashing,power-cycle the board--------------
After boot from u-boot,setting the env variables for Linux kernel (Image.gz),Device Tree (imx8mp-evk.dtb),rootfs.img.
sf probe 0
setenv loadaddr 0x40480000 // kernel
setenv fdt_addr 0x43000000 //dtb
setenv initrd_addr 0x43800000 //rootfs
setenv kernel_comp_addr_r 0x50000000
setenv kernel_comp_size 0x04000000
sf read ${loadaddr} 0x240000 0xCD3CE2
sf read ${fdt_addr} 0x1000000 0x14360
sf read ${initrd_addr} 0x1080000 0xC04DB0
setenv bootargs "console=ttymxc1,115200 root=/dev/ram0 rw"
setenv bootcmd 'sf probe 0; sf read ${loadaddr} 0x240000 0xCD3CE2; sf read ${fdt_addr} 0x1000000 0x14360; sf read ${initrd_addr} 0x1080000 0xC04DB0; booti ${loadaddr} ${initrd_addr} ${fdt_addr}'
saveenv
-----------------------Question 1------------------------------------
1.With SD card Wic file working fine with partitions (Boot/Root).
2.We genarated Two yocto images
==> 1.bitbake core-image-minimal-initramfs (generated initramfs.cpio.gz) this cpio.gx converted into rootfs.img by using this cmd mkimage -A arm -O linux -T ramdisk -d <gzipped_rootfs> <Ramdisk_name> (from linux user guide)
==>2.Also generated tiny rootfs from yocto generated using bitbake core-image-tiny. core-image-tiny-imx8mp-evk.tar.zst this tar extracted into EXT4 partition in SD card succussfully loading tiny rootfs .
3.But as said in 2nd point rootfs.img also put into EXT4 root partition in SD card but not loading the rootfs.
-----------------------Question 2------------------------------------
1.Is this the correct approach to boot an initramfs (rootfs.img) directly from QSPI on i.MX8M Plus EVK?
-----------------------Question 3------------------------------------
3.Is there any recommended NXP reference image for booting kernel and initramfs entirely from QSPI on i.MX8MP(Linux kernel (Image.gz),Device Tree (imx8mp-evk.dtb),rootfs.img) ?
4. How to load rootfs.img from QSPI flash on I.MX8MP?