
Hi,
I am using the ST make M29W128GH flash chip on my customized board. I am able to read the flash and able to execute all uboot commands relevant for flash read operations. But any write operation fails on flash. I tried to use the "mw" command on flash but it failed. Also one time I get the output message as "flash is busy :1" contniously for 10 mins and so I reset the board. But after that flash is not getting detected by my utiltiy and it gives message as "flash is not present". What wrong happened with flash?
I tested the Read CFI query using mw and md operation. flash base - 0xff000000
$ mw.w 0xff000000 0xf0 $ mw.w 0xff0000aa 0x98 $ md.w 0xff000020 ff000020: ffff ffff ffff ffff ffff ffff ffff ffff ................ ff000030: ffff ffff ffff ffff ffff ffff ffff ffff ................ ff000040: ffff ffff ffff ffff ffff ffff ffff ffff ................ ff000050: ffff ffff ffff ffff ffff ffff ffff ffff .
I tried to write at different memory address on flash chip. But it also didn't worked. $ mw.w 0xff160000 0x55AA $ md.w 0xff160000 ff160000: ffff ffff ffff ffff ffff ffff ffff ffff ................ ff000010: ffff ffff ffff ffff ffff ffff ffff ffff ................ ff000020: ffff ffff ffff ffff ffff ffff ffff ffff ................ ff000030: ffff ffff ffff ffff ffff ffff ffff ffff .
I checked the function do_mem_mw ( I believe this is used for "mw" command). This function just put the value at given address. It means that flash mapping is already done somewhere and value should be written in the address given to the mw command. PCIMW.
flash read/write operation works in flash_detect_cfi fucntion. FLASH: flash detect cfi fwc addr ff000000 cmd ff ff00 16bit x 8 bit fwc addr ff000000 cmd f0 f000 16bit x 8 bit fwc addr ff0000aa cmd 98 9800 16bit x 8 bit is= cmd 51(Q) addr ff000020 is= 5100 5100 is= cmd 52(R) addr ff000022 is= 5200 5200 is= cmd 59(Y) addr ff000024 is= 5900 5900 device interface is 2 found port 2 chip 1 port 16 bits chip 8 bits
Return With CFI conformant 00 : 51 52 59 02 00 40 00 00 00 00 00 27 36 b5 c5 04 QRY..@.....'6... 10 : 04 09 10 04 04 03 04 18 02 00 06 00 01 7f 00 00 ................ 20 : 02 00 00 00 00 00 00 00 00 00 00 00 00 ec 9e c0 ................ fwc addr ff0000aa cmd 98 9800 16bit x 8 bit manufacturer is 2 manufacturer id is 0x20 device id is 0x7e device id2 is 0x2101 cfi version is 0x3133 size_ratio 1 port 16 bits chip 8 bits found 1 erase regions erase region 0: 0x0200007f erase_region_count = 128 erase_region_size = 131072 fwc addr ff000000 cmd f0 f0 8bit x 8 bit Entering into First Write First Write is done flash_protect ON: from 0xFFFC0000 to 0xFFFEE8FF protect on 126 protect on 127 flash_protect ON: from 0xFFFA0000 to 0xFFFBFFFF protect on 125 16 MB env_relocate[228] offset = 0x2000e000 env_relocate[249] malloced ENV at 1feca008 *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial U-Boot relocated to 1ffce000 Install interrupt vector 30 Install interrupt vector 31 ### main_loop entered: bootdelay=20
$ flinfo Bank # 1: CFI conformant FLASH (8 x 8) Size: 16 MB in 128 Sectors AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x7E2101 Erase timeout: 4096 ms, write timeout: 1 ms Buffer write timeout: 1 ms, buffer size: 64 bytes Sector Start Addresses: FF000000 E FF020000 E FF040000 E FF060000 E FF080000 E FF0A0000 E FF0C0000 E FF0E0000 E FF100000 E FF120000 E FF140000 E FF160000 E FF180000 E FF1A0000 E FF1C0000 E FF1E0000 E FF200000 E FF220000 E FF240000 E FF260000 E FF280000 E FF2A0000 E FF2C0000 E FF2E0000 E FF300000 E FF320000 E FF340000 E FF360000 E FF380000 E FF3A0000 E FF3C0000 E FF3E0000 E FF400000 E FF420000 E FF440000 E FF460000 E FF480000 E FF4A0000 E FF4C0000 E FF4E0000 E FF500000 E FF520000 E FF540000 E FF560000 E FF580000 E FF5A0000 E FF5C0000 E FF5E0000 E FF600000 E FF620000 E FF640000 E FF660000 E FF680000 E FF6A0000 E FF6C0000 E FF6E0000 E FF700000 E FF720000 E FF740000 E FF760000 E FF780000 E FF7A0000 E FF7C0000 E FF7E0000 E FF800000 E FF820000 E FF840000 E FF860000 E FF880000 E FF8A0000 E FF8C0000 E FF8E0000 E FF900000 E FF920000 E FF940000 E FF960000 E FF980000 E FF9A0000 E FF9C0000 E FF9E0000 E FFA00000 E FFA20000 E FFA40000 E FFA60000 E FFA80000 E FFAA0000 E FFAC0000 E FFAE0000 E FFB00000 E FFB20000 E FFB40000 E FFB60000 E FFB80000 E FFBA0000 E FFBC0000 E FFBE0000 E FFC00000 E FFC20000 E FFC40000 E FFC60000 E FFC80000 E FFCA0000 E FFCC0000 E FFCE0000 E FFD00000 E FFD20000 E FFD40000 E FFD60000 E FFD80000 E FFDA0000 E FFDC0000 E FFDE0000 E FFE00000 E FFE20000 E FFE40000 E FFE60000 E FFE80000 E FFEA0000 E FFEC0000 E FFEE0000 E FFF00000 E FFF20000 E FFF40000 E FFF60000 E FFF80000 E FFFA0000 E RO FFFC0000 RO FFFE0000 RO
Thanks & Regards, Prakash