Hi, I am trying to boot from my SPI-NOR memory device on my custom board with an i.MX6Q but it seems that there are a few things that I don't really understand.
1. Do I partition my spinor memory using mtdparts or the devicetree? And what is the difference?
2. When I load my files into my flash memory using sf write am I able to write into a particular partition? Or does it have to be static addresses?
3. Yocto by default generates a wic file for sd/emmc memory devices. Is there something similar for SPI-NOR memory? Do fitImages work?
4. Since the uuu forces the bootcmd=fastboot 0, how do I change it to load from my SPI-NOR flash? Do I need 2 separate versions of u-boot? One to run uuu and the other for the board to boot up through SPI-NOR.
I am currently generating a cpio rootfs using IMAGE_FSTYPES="cpio".
I am able to boot from u-boot through USB only in the RAM.
I managed to partition my SPI-NOR memory using the device tree and I can see mtdblock0-2 in my /dev folder
How should I move forward to boot from SPI-NOR instead of having to rely on the USB to boot all the time?
This is my UUU script:
uuu_version 1.2.39
# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f u-boot.imx
# Initialize SPI Flash
FB: ucmd sf probe ${spi_bus}
# Bootloader
FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f u-boot.imx
FB[-t 1000000]: ucmd sf write ${fastboot_buffer} 0x400 0x${filesize}
FB: ucmd echo uboot done
# zImage
FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f zImage.bin
FB[-t 1000000]: ucmd sf write ${fastboot_buffer} 0x100000 0x${filesize}
FB: ucmd echo zImage done
# Device Tree
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f imx6q-spw.dtb
FB[-t 1000000]: ucmd sf write ${fastboot_buffer} 0xB00000 0x${fastboot_bytes}
FB: ucmd echo dtb done
# RootFS
FB: ucmd setenv fastboot_buffer 0x12C000000
FB: download -f rfs.rootfs.cpio
FB[-t 1000000]: ucmd sf write ${fastboot_buffer} 0xC00000 0x${fastboot_bytes}
FB: ucmd echo rootfs done
# Boot
FB[-t 1000000]: ucmd sf read ${loadaddr} 0x100000 0x68b2e8
FB[-t 1000000]: ucmd sf read ${fdt_addr} 0xB00000 0x84e7
FB[-t 1000000]: ucmd sf read ${ramdisk_addr} 0xC00000 0x1a14440
#FB: acmd bootz ${loadaddr} - ${fdt_addr}
FB: acmd bootz ${loadaddr} ${ramdisk_addr} ${fdt_addr}