Spansion NOR flash (i.MX31)
Overview
Since this topic is similar to the Intel Strata Flash topic, you might also want to check IntelStrataFlash for instructions.
Kernel Configuration
The kernel configuration options for the flash chip drivers can be found in:
Device Drivers -> Memory Technology Device Support -> RAM/ROM Flash Chip Drivers Flash Chip Driver advanced configuration options -> Y Specific CFI Flash Geometry -> Y Support 16 bit Buswidth -> Y Support 1 chip flash interleave -Y Support for Intel/Sharp flash chips -> Y Support for AMD/Fujitsu flash chips -> Y
Grab information about devices
To get information about the flash devices run the following command. Typically all partitions before the IPL_SPL are NOR devices.
mx31# cat /proc/mtd dev: size erasesize name mtd0: 00080000 00020000 "Bootloader" mtd1: 00080000 00020000 "Bootloader env" mtd2: 00200000 00020000 "Kernel" mtd3: 01d00000 00020000 "rootfs" mtd4: 00040000 00020000 "IPL-SPL" mtd5: 00400000 00020000 "nand.kernel" mtd6: 01600000 00020000 "nand.rootfs" mtd7: 065c0000 00020000 "nand.userfs"
Test Spansion Flash
To test the Spansion Flash, you can read the bootloader from this flash by running the following command.
dd if=/dev/mtdblock0 of=/tmp/bootpart bs=1024
You will receive a file named bootpart in /tmp which will contain the bootloader. You can check this by opening the file in a hex editor and by seeking to address 0x15580. Around that address, you should see various messages from the bootloader. Unused space at the end will be padded with 0xFF.
We will now mount the rootfs filesystem
/* Create a mount point */ mx31# mkdir /mnt/normnt /* Mount rootfs to mountpoint */ mx31# mount -t jffs2 /dev/mtdblock/3 /mnt/normnt /* Show contents */ mx31# ls /mnt/normnt/ bin etc linuxrc proc sys usr dev home mnt root tmp var dir lib opt sbin unit_tests mx31#
Make sure you are not erasing the bootloader or bootloader environment section. If you do, you will need a JTAG programmer to flash the bootloader back to its position.
Data written onto the NOR Flash will exist even after rebooting or switching off/on the device. Software is able to run directly from NOR flash.