Booting from SPI NOR Flash¶
The MitySOM-iMX6 can feature an optional SPI NOR flash memory on the module. If this memory is installed it can be utilized for loading the U-Boot image file (or similar).
- Flash Size: 512Kbyte (4Mbit)
- Part Number: SST25WF040B-40I/SN
- SPI Bus: SPI3
- SPI Chip Select: CS0
- Boot Select Mode [2:0] (J1202 Dev Board): '111'
- Kernel Version to Access: 4.9.11 or Greater
Note that if the SPI NOR Flash is used to boot the module care should be taken that any SPI devices attached to the SPI0 SMARC interface (CS1 or CS2) do not interfere with this boot process.
Programming the SPI NOR Flash¶
The SPI NOR flash can be programmed from either the Linux Kernel or U-Boot as identified below.
- No special U-Boot image is needed however a 1024byte padding at the beginning of the file to be programmed into NOR is required.
- Create a file of 1024bytes of zeros
dd if=/dev/zero of=/home/root/prefix bs=1024 count=1
- Add the 1024byte file to the beginning of the U-Boot image on the SD card (/boot/u-boot-imx6q-igep0046-2015.04-r0.imx)
cat /home/root/prefix /boot/u-boot-imx6q-igep0046-2015.04-r0.imx > /home/root/u-boot_nor.imx
- Create a file of 1024bytes of zeros
Linux¶
The SPI NOR flash can be programmed from the Linux OS as long as it is version 4.9.11 or higher.
Linux version 3.14 for the MitySOM-iMX6 does not support the current SPI NOR memory JEDEC code unless the SPI nor driver is patched/updated. If the 3.14 kernel is used the following message will be seen:
m25p80 spi2.0: unrecognized JEDEC id 621613
- Using a supported Linux OS the flashcp utility can be utilized to program the NOR.
- Flash the combined image (1024bytes of zeros + u-boot.imx = u-boot_nor.imx) to the NOR
- Confirm the NOR is detected as /dev/mtd0
cat /proc/mtddev: size erasesize name mtd0: 00080000 00001000 "spi2.0"
- Write the combined U-Boot image to the NOR
flashcp -v ./u-boot_nor.imx /dev/mtd0 Erasing blocks: 91/91 (100%) Writing data: 364k/0k (100%) Verifying data: 364k/0k (100%)
- Confirm the NOR is detected as /dev/mtd0
U-Boot¶
The default U-Boot build included with the MitySOM-iMX6 Dev Kits does NOT support the 'sf' commands to program the NOR memory. As such you cannot write the SPI NOR from U-Boot unless it is re-built.
Booting from SPI NOR Flash¶
The MitySOM-iMX6 features three boot mode configurations pins that are accessible from the dev/carrier board.
These signals should be set to '111' to boot from the on SoM NOR memory.
This will cause the iMX6 processor to load U-Boot from the SPI3 CS0 interface, the SPI NOR Flash memory.
- Power off/shutdown the module after writing the U-Boot image to the SPI NOR flash. Remove power from the baseboard.
- Remove the SD card (for testing purposes)
- Set the Boot[2:0] pins on the carrier board to '111'
- In the case of the MitySOM-iMX6 Dev Board this is set at J1202 by having all 3 jumpers installed
- Power the baseboard back on
- U-Boot should be shown on the serial port interface
Note that if U-Boot is not updated to support the SPI NOR flash interface it will not be able to load the environment from the SPI NOR memory and the default environment variables will be used.
Go to top