My custom board is boot from qspi flash, now I'm in trouble with programming RCW/BL2(bl2_qspi.pbl) to qspi flash at offset 0x0~0x40000.
Commands as follow:
mw 0xb0000000 0 0x4000000 //fill 0xb0000000~0xbfffffff with all 0s
tftp 0xb0000000 bl2_qspi.pbl //size of 0x13491
sf erase 0x0 0x40000 //necessarily erase 256Kbytes with s25fs512
sf write 0xb0000000 0x9000 0x40000
When I try to erase flash, I found that offset at 0x0~0x8000 can not be erased or modified.
After I programming flash, board can not boot any more.
Same situation when I try to programming firmware_ls1088ardb_pb_uboot_qspiboot.img,
Is there any protection of writing else while I tried sf protect unlock 0x0 0x40000?
Finally I found that U-BOOT erase spi flash with 256K uniform sector architecture while flash(Spansion S25FS512S) have 8 4KBytes sectors on the top/bottom of address, which cause 256K uniform erase failed. After modified 20h_NV =1 of Status/Config Register, flash erase normally.
Please try to boot from SD card and use U-Boot to program SPI Flash or use CodeWarrior Flash Programmer.
Also it is possible to check the SPI Flash datasheet concerning the sectors protection options.