Hi,
We are working with a custom i.MX8M Plus DDR4 board that includes 32 MB QSPI NOR flash.
Our objective is to boot U-Boot, Linux kernel, device tree, and initramfs (rootfs.img) entirely from QSPI flash, without using SD/eMMC.
We are able to successfully boot up to U-Boot (flash.bin) from QSPI flash.
-----Flash Layout and Image Sizes----------------
QSPI flash size: 32 MB
flash.bin (U-Boot + SPL) ~2.4 MB
Image.gz (Kernel) ~15 MB
imx8mp-evk.dtb ~85 KB
rootfs.img ~12.6 MB
----QSPI Offset Layout----------
flash.bin @ 0x00000000
Image.gz @ 0x0024D000
imx8mp-evk.dtb @ 0x010A6B00
rootfs.img @ 0x010BB800
After booting into U-Boot from QSPI, we configure the following environment variables to load the kernel, device tree, and initramfs from flash:
sf probe 0
setenv loadaddr 0x40480000 // kernel
setenv fdt_addr 0x43000000 //dtb
setenv initrd_addr 0x43800000 //rootfs (minimal initramfs)
setenv kernel_comp_addr_r 0x50000000
setenv kernel_comp_size 0x04000000
Reading Images from QSPI Flash
sf read ${loadaddr} 0x0024D000 0x00E59A6F
sf read ${fdt_addr} 0x010A6B00 0x00014BBA
sf read ${initrd_addr} 0x010BB800 0x00C04DB0
Boot Command
setenv bootargs console=${console},${baudrate} earlycon=${earlycon},${baudrate} rdinit=/dev
booti ${loadaddr} ${initrd_addr} ${fdt_addr}
The kernel starts executing but hangs at “Starting kernel …”.
Please refer to the attached kernel boot log (kernel_bootlog1).
When using the following boot arguments:
setenv bootargs setenv bootargs "console=ttymxc1,115200 earlycon root=/dev/ram0 rw rdinit=/sbin/init loglevel=8"
The kernel progresses further but hangs midway during boot.
Please refer to the attached kernel boot log (kernel_bootlog2).
Attached the kernel DTS and kernel defconfig for reference.
Kindly let us know if any modifications are required.
Questions:
1. Are there any recommended changes required in the kernel DTS for booting initramfs entirely from QSPI on a custom i.MX8M Plus DDR4 board?
2. Are there any additional boot arguments recommended by NXP for initramfs-based boot on i.MX8MP from QSPI flash?
3. What could be the possible reason for the kernel not booting correctly?
We followed the same procedure that works successfully on the i.MX8MP LPDDR4 EVK, where the kernel and root filesystem boot properly from QSPI flash.
The only differences in our setup are the flash.bin and device tree, which were modified according to the DDR configuration of our custom board.
thank you.
Hi @Bhardwaj
1. Please add size for booti. The booti needs initrd size.
booti ${loadaddr} ${initrd_addr}:0x00C04DB0 ${fdt_addr}
booti command — Das U-Boot unknown version documentation
2. The bootlog2 shows that the kernel can't find correct mount point, this should be related to the rootfs parameter you passed in.
Best Regards,
Zhiming
I follow this doc, it works fine.
I just use the ramdisk of the demo.
HI @Zhiming_Liu ,
We are still facing the same issue on our i.MX8M Plus DDR4 custom board and would appreciate your guidance. We have attached the detailed kernel boot log for your review.
The same procedure and images work correctly on the i.MX8M Plus LPDDR4 EVK.
The same procedure doing as same as EVK ,But the kernel does not fully boot on our custom DDR4 board.
Question :
1.After giving setenv bootargs "console=ttymxc1,115200 earlycon root=/dev/ram rw rdinit=/sbin/init loglevel=8" going forward , WHY? rather then thos loglevel not moving forwad as said in kernel_bootlog1.
2.Are there any mandatory changes required in the Linux device tree (linux-imx) specifically for a custom DDR4 configuration on i.MX8M Plus, beyond updating DDR timing and memory size?
3.The same kernel image, initramfs, and boot flow work correctly on the i.MX8M Plus LPDDR4 EVK, but fail on our custom DDR4 board.
4.What are the possible reasons for this behavior? Could this be related to DDR configuration, memory mapping, or reserved memory differences?
I think you should check the device tree to see if there are any address conflicts with the ramdisk. Alternatively, use a higher address for the ramdisk, or use a smaller ramdisk as the one in the demo Hogole mentioned.
You can try booting without mounting the ramdisk first to see if it works. This would mean only the root filesystem is not mounted. This can help narrow down the problem.
booti ${loadaddr} - ${fdt_addr}Hi @gehimiy ,
As suggested, we tried booting the kernel without an initramfs using the command: booti ${loadaddr} - ${fdt_addr}
However, there is no response from the kernel, and the system still hangs at “Starting kernel …”.
The below are the Ram address and flash address using to load the files.
setenv loadaddr 0x40480000 // kernel
setenv fdt_addr 0x43000000 //dtb
setenv initrd_addr 0x43800000 //rootfs (minimal initramfs)
setenv kernel_comp_addr_r 0x50000000
setenv kernel_comp_size 0x04000000
Reading Images from QSPI Flash
sf read ${loadaddr} 0x0024D000 0x00E59A6F
sf read ${fdt_addr} 0x010A6B00 0x00014BBA
sf read ${initrd_addr} 0x010BB800 0x00C04DB0
Where should we check for possible address conflicts between:
Kernel load address
Initramfs (ramdisk) address
Reserved memory regions
If the issue is related to ramdisk address overlap, where can we:
Change the ramdisk load address in U-Boot and kernel ?
Adjust or reserve memory regions in the device tree?
Is there a recommended higher memory address range for loading the ramdisk on i.MX8M Plus DDR4 Custom Board systems?
With same address and files working fine for IMX8MPLUS LPDDR4 EVK.
We have attached the current DTS file for your reference. Please let us know what changes are required.
Thanks in advance for your support.