Hello, I'm using imx28EVK and I want to load u-boot from SPI NOR and I have a Micron N25Q128. I'm using mainline u-boot and I have added this to boards.cfg:
mx28evk_spi arm arm926ejs mx28evk freescale mxs mx28evk:ENV_IS_IN_SPI_FLASH
And compiled it with
make CROSS_COMPILE=xxx mx28evk_spi
make u-boot.sb CROSS_COMPILE=xxx
I have tried to flash u-boot.sb to adress 0x0 on my SPI NOR memory in linux with:
mtd_debug write /dev/mtd1 0 459840 u-boot.sb
All I get when I changed bootswitches is this:
I can write to mtdblock1 in linux so SPI communication seems to be fine but in u-boot sf probe 2:0 fails with this error message:
SF: Unsupported manufacturer 20
Failed to initialize SPI flash at 2:0
How do I solve this?
1) Use U-Boot 2013.07
2) Find CONFIG_SPI_FLASH_SST in your include/configs/mx28evk.h and replace it with CONFIG_SPI_FLASH_STMICRO (as your flash is STMicro one)
3) Write u-boot.sb bootstream into SPI flash
=> sf probe 2:0
=> <load u-boot.sb to (for example) 0x42000000>
=> sf erase 0 0x80000
=> sf write 0x42000000 0 0x80000
I'm struggling on the same issue, but I succeded in u-boot tests
I use a SPI NOR spansion S25FL128S memory attached to a i.MX28 EVK
First I applied patches on u-boot and kernel that I've found in https://community.freescale.com/docs/DOC-9363
Build ltib and run u-boot from SD card.
I can test the device:
MX28 U-Boot > sf probe 2:0
16384 KiB S25FL129P_S25FL128S_64K at 2:0 is now current device
MX28 U-Boot > sf write ....
MX28 U-Boot > sf read .....
from linux I see that nodes /dev/mtd are not created. I don't know why.
So using 'mtd_debug' does fail
Try with mainline U-Boot ... see my hint below. You will need CONFIG_SPI_FLASH_SPANSION instead of STMICRO though. btw. you can find all the possible IDs in drivers/mtd/spi/spi_flash.c in the flashes array.