[U-Boot-Users] Spansion flash not detected by CFI driver

Hello, Forwarding again since the initial mail didn't reach the mailing list.
I have a spansion flash (S71WS256ND0BFWEP) on my board (Freescale imx31 ADS).I use CFI driver with the below configuration. But I get the following error(debug message). Could someone help me to resolve the problem.
#define CFG_FLASH_BASE 0xa0000000 #define CFG_MAX_FLASH_BANKS 1 #define CFG_MAX_FLASH_SECT 128 #define CFG_FLASH_CFI 1 #define CFG_FLASH_CFI_DRIVER 1 #define CFG_FLASH_USE_BUFFER_WRITE 1
U-Boot 1.2.0 (Apr 17 2007 - 18:43:30)
U-Boot code: 87F00000 -> 87F1BD48 BSS: -> 87F22370 CPU: Freescale i.MX31 at 398 MHz Board: i.MX31 Litekit RAM Configuration: Bank #0: 80000000 128 MB flash detect cfi fwc addr a0000000 cmd 0 0 8bit x 8 bit fwc addr a0000055 cmd 98 98 8bit x 8 bit is= cmd 51(Q) addr a0000010 is= 14 51 fwc addr a0000555 cmd 98 98 8bit x 8 bit is= cmd 51(Q) addr a0000010 is= 14 51 fwc addr a0000000 cmd 0 0000 16bit x 8 bit fwc addr a00000aa cmd 98 9898 16bit x 8 bit is= cmd 51(Q) addr a0000020 is= 0100 5151 fwc addr a0000aaa cmd 98 9898 16bit x 8 bit is= cmd 51(Q) addr a0000020 is= 0051 5151 fwc addr a0000000 cmd 0 0000 16bit x 16 bit fwc addr a00000aa cmd 98 0098 16bit x 16 bit is= cmd 51(Q) addr a0000020 is= 0100 0051 fwc addr a0000aaa cmd 98 0098 16bit x 16 bit is= cmd 51(Q) addr a0000020 is= 0051 0051 is= cmd 52(R) addr a0000022 is= 0052 0052 is= cmd 59(Y) addr a0000024 is= 0059 0059 ushort addr is at a0000050 info->portwidth = 2 addr[0] = 0x1 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x1 device interface is 1 found port 2 chip 2 port 16 bits chip 16 bits ushort addr is at a0000026 info->portwidth = 2 addr[0] = 0x2 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x2 fwc addr a0000000 cmd f0 00f0 16bit x 16 bit fwc addr a0000aaa cmd aa 00aa 16bit x 16 bit fwc addr a0000554 cmd 55 0055 16bit x 16 bit fwc addr a0000aaa cmd 90 0090 16bit x 16 bit fwc addr a0000000 cmd f0 00f0 16bit x 16 bit fwc addr a0000aaa cmd 98 0098 16bit x 16 bit ushort addr is at a000002a info->portwidth = 2 addr[0] = 0x40 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x40 a0000020 : 51 00 52 00 59 00 02 00 00 00 40 00 00 00 00 00 Q.R.Y.....@..... a0000030 : 00 00 00 00 00 00 17 00 19 00 00 00 00 00 06 00 ................ a0000040 : 09 00 0a 00 00 00 04 00 04 00 03 00 00 00 19 00 ................ a0000050 : 01 00 00 00 06 00 00 00 03 00 03 00 00 00 80 00 ................ a0000060 : 00 00 fd 00 00 00 00 00 02 00 03 00 00 00 80 00 ................ a0000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0000080 : 50 00 52 00 49 00 31 00 34 00 10 00 02 00 01 00 P.R.I.1.4....... a0000090 : 00 00 08 00 f3 00 01 00 00 00 85 00 95 00 01 00 ................ manufacturer is 2 manufacturer id is 0x1 device id is 0x7e device id2 is 0x3000 cfi version is 0x3134 size_ratio 1 port 16 bits chip 16 bits found 3 erase regions long addr is at a000005a info->portwidth = 2 addr[0] = 0x3 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 addr[4] = 0x80 addr[5] = 0x0 addr[6] = 0x0 addr[7] = 0x0 erase_region_count = 4 erase_region_size = 32768 long addr is at a0000062 info->portwidth = 2 addr[0] = 0xfd addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 addr[4] = 0x0 addr[5] = 0x0 addr[6] = 0x2 addr[7] = 0x0 erase_region_count = 254 erase_region_size = 131072 long addr is at a0000000 info->portwidth = 0 erase_region_count = 65536 erase_region_size = 16776960 ushort addr is at a0000000 info->portwidth = 0 retval = 0xffff Flash Size is 0 flash_protect ON: from 0xA0000000 to 0xA001BD47 flash_protect ON: from 0xA01F0000 to 0xA01FFFFF Flash: 0 kB *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial ### Set environment from HW MAC addr = "00:04:9F:00:0E:B0" ### main_loop entered: bootdelay=3
### main_loop: bootcmd="run bootcmd_net" Hit any key to stop autoboot: 0 uboot>
Thanks, Shiju

Shiju Mathew wrote:
Hello, Forwarding again since the initial mail didn't reach the mailing list.
I got your 2 other emails as well but I was unable to check the mails yesterday...
I have a spansion flash (S71WS256ND0BFWEP) on my board (Freescale imx31 ADS).I use CFI driver with the below configuration. But I get the following error(debug message). Could someone help me to resolve the problem.
#define CFG_FLASH_BASE 0xa0000000 #define CFG_MAX_FLASH_BANKS 1 #define CFG_MAX_FLASH_SECT 128
This is not correct for your chip. You should have this set not less than the total number of ease units (blocks) on your chip.
For what I could find on the net this chip seems to have the following interesting geometry:
4 x 32kB 254 x 128kB 4 x 32kB
So, the total should be at least 4 + 254 + 4 = 262
Please fix this and provide the logs again...
Tolunay

On Wed, 2007-18-04 at 21:06 -0500, Tolunay Orkun wrote:
Shiju Mathew wrote:
I have a spansion flash (S71WS256ND0BFWEP) on my board (Freescale imx31 ADS).I use CFI driver with the below configuration. But I get the following error(debug message). Could someone help me to resolve the problem.
#define CFG_FLASH_BASE 0xa0000000 #define CFG_MAX_FLASH_BANKS 1 #define CFG_MAX_FLASH_SECT 128
This is not correct for your chip. You should have this set not less than the total number of ease units (blocks) on your chip.
For what I could find on the net this chip seems to have the following interesting geometry:
4 x 32kB 254 x 128kB 4 x 32kB
So, the total should be at least 4 + 254 + 4 = 262
Please fix this and provide the logs again...
Thanks Tolunay, I could fix the flash detection after changing the total no: of sector to 262. But the flash unprotect sector always times out.The first 4 sectors are protected when uboot comes up. I am not able to update uboot from within uboot since unprotect sectors always fails on these(all) sector. Should I need to change any timeout values.The log is as below.
U-Boot 1.2.0 (Apr 19 2007 - 10:59:05)
U-Boot code: 87D00000 -> 87D1BDD0 BSS: -> 87D22698 CPU: Freescale i.MX31 at 398 MHz Board: i.MX31 Litekit RAM Configuration: Bank #0: 80000000 128 MB flash detect cfi fwc addr a0000000 cmd 0 0 8bit x 8 bit fwc addr a0000055 cmd 98 98 8bit x 8 bit is= cmd 51(Q) addr a0000010 is= 14 51 fwc addr a0000555 cmd 98 98 8bit x 8 bit is= cmd 51(Q) addr a0000010 is= 14 51 fwc addr a0000000 cmd 0 0000 16bit x 8 bit fwc addr a00000aa cmd 98 9898 16bit x 8 bit is= cmd 51(Q) addr a0000020 is= 0100 5151 fwc addr a0000aaa cmd 98 9898 16bit x 8 bit is= cmd 51(Q) addr a0000020 is= 0051 5151 fwc addr a0000000 cmd 0 0000 16bit x 16 bit fwc addr a00000aa cmd 98 0098 16bit x 16 bit is= cmd 51(Q) addr a0000020 is= 0100 0051 fwc addr a0000aaa cmd 98 0098 16bit x 16 bit is= cmd 51(Q) addr a0000020 is= 0051 0051 is= cmd 52(R) addr a0000022 is= 0052 0052 is= cmd 59(Y) addr a0000024 is= 0059 0059 ushort addr is at a0000050 info->portwidth = 2 addr[0] = 0x1 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x1 device interface is 1 found port 2 chip 2 port 16 bits chip 16 bits ushort addr is at a0000026 info->portwidth = 2 addr[0] = 0x2 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x2 fwc addr a0000000 cmd f0 00f0 16bit x 16 bit fwc addr a0000aaa cmd aa 00aa 16bit x 16 bit fwc addr a0000554 cmd 55 0055 16bit x 16 bit fwc addr a0000aaa cmd 90 0090 16bit x 16 bit fwc addr a0000000 cmd f0 00f0 16bit x 16 bit fwc addr a0000aaa cmd 98 0098 16bit x 16 bit ushort addr is at a000002a info->portwidth = 2 addr[0] = 0x40 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x40 a0000020 : 51 00 52 00 59 00 02 00 00 00 40 00 00 00 00 00 Q.R.Y.....@..... a0000030 : 00 00 00 00 00 00 17 00 19 00 00 00 00 00 06 00 ................ a0000040 : 09 00 0a 00 00 00 04 00 04 00 03 00 00 00 19 00 ................ a0000050 : 01 00 00 00 06 00 00 00 03 00 03 00 00 00 80 00 ................ a0000060 : 00 00 fd 00 00 00 00 00 02 00 03 00 00 00 80 00 ................ a0000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0000080 : 50 00 52 00 49 00 31 00 34 00 10 00 02 00 01 00 P.R.I.1.4....... a0000090 : 00 00 08 00 f3 00 01 00 00 00 85 00 95 00 01 00 ................ manufacturer is 2 manufacturer id is 0x1 device id is 0x7e device id2 is 0x3000 cfi version is 0x3134 size_ratio 1 port 16 bits chip 16 bits found 3 erase regions long addr is at a000005a info->portwidth = 2 addr[0] = 0x3 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 addr[4] = 0x80 addr[5] = 0x0 addr[6] = 0x0 addr[7] = 0x0 erase_region_count = 4 erase_region_size = 32768 long addr is at a0000062 info->portwidth = 2 addr[0] = 0xfd addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 addr[4] = 0x0 addr[5] = 0x0 addr[6] = 0x2 addr[7] = 0x0 erase_region_count = 254 erase_region_size = 131072 long addr is at a000006a info->portwidth = 2 addr[0] = 0x3 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 addr[4] = 0x80 addr[5] = 0x0 addr[6] = 0x0 addr[7] = 0x0 erase_region_count = 4 erase_region_size = 32768 ushort addr is at a0000054 info->portwidth = 2 addr[0] = 0x6 addr[1] = 0x0 addr[2] = 0x0 addr[3] = 0x0 retval = 0x6 fwc addr a0000000 cmd f0 00f0 16bit x 16 bit flash_protect ON: from 0xA0000000 to 0xA001BDCF fwc addr a0000000 cmd 50 0050 16bit x 16 bit fwc addr a0000000 cmd 60 0060 16bit x 16 bit fwc addr a0000000 cmd 1 0001 16bit x 16 bit flash_is_busy: 0 protect on 0 fwc addr a0008000 cmd 50 0050 16bit x 16 bit fwc addr a0008000 cmd 60 0060 16bit x 16 bit fwc addr a0008000 cmd 1 0001 16bit x 16 bit flash_is_busy: 0 protect on 1 fwc addr a0010000 cmd 50 0050 16bit x 16 bit fwc addr a0010000 cmd 60 0060 16bit x 16 bit fwc addr a0010000 cmd 1 0001 16bit x 16 bit flash_is_busy: 0 protect on 2 fwc addr a0018000 cmd 50 0050 16bit x 16 bit fwc addr a0018000 cmd 60 0060 16bit x 16 bit fwc addr a0018000 cmd 1 0001 16bit x 16 bit flash_is_busy: 0 protect on 3 flash_protect ON: from 0xA01E0000 to 0xA01FFFFF fwc addr a01e0000 cmd 50 0050 16bit x 16 bit fwc addr a01e0000 cmd 60 0060 16bit x 16 bit fwc addr a01e0000 cmd 1 0001 16bit x 16 bit flash_is_busy: 0 protect on 18 Flash: 32 MB *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial ### Set environment from HW MAC addr = "FF:FF:FF:FF:FF:FF" ### main_loop entered: bootdelay=3
### main_loop: bootcmd="run bootcmd_net" Hit any key to stop autoboot: 0 uboot> uboot> protect off a0000000 +100000 Flash unprotect timeout at address a0000000 data c68686c6 .Flash unprotect timeout at address a0008000 data c68686c6 .Flash unprotect timeout at address a0010000 data c68686c6 .Flash unprotect timeout at address a0018000 data c68686c6 .Flash unprotect timeout at address a0020000 data c68686c6 .Flash unprotect timeout at address a0040000 data c68686c6 .Flash unprotect timeout at address a0060000 data c68686c6 .Flash unprotect timeout at address a0080000 data c68686c6 .Flash unprotect timeout at address a00a0000 data c68686c6 .Flash unprotect timeout at address a00c0000 data c68686c6 .Flash unprotect timeout at address a00e0000 data c68686c6 . done Un-Protected 11 sectors uboot>
Thanks, Shiju

On Thu, 2007-19-04 at 11:46 -0400, Shiju wrote:
#define CFG_MAX_FLASH_BANKS 1 #define CFG_MAX_FLASH_SECT 128
This is not correct for your chip. You should have this set not less than the total number of ease units (blocks) on your chip.
For what I could find on the net this chip seems to have the following interesting geometry:
4 x 32kB 254 x 128kB 4 x 32kB
So, the total should be at least 4 + 254 + 4 = 262
Please fix this and provide the logs again...
Thanks Tolunay, I could fix the flash detection after changing the total no: of sector to 262. But the flash unprotect sector always times out.The first 4 sectors are protected when uboot comes up. I am not able to update uboot from within uboot since unprotect sectors always fails on these(all) sector. Should I need to change any timeout values.The log is as below.
### main_loop: bootcmd="run bootcmd_net" Hit any key to stop autoboot: 0 uboot> uboot> protect off a0000000 +100000 Flash unprotect timeout at address a0000000 data c68686c6 .Flash unprotect timeout at address a0008000 data c68686c6 .Flash unprotect timeout at address a0010000 data c68686c6 .Flash unprotect timeout at address a0018000 data c68686c6 .Flash unprotect timeout at address a0020000 data c68686c6 .Flash unprotect timeout at address a0040000 data c68686c6 .Flash unprotect timeout at address a0060000 data c68686c6 .Flash unprotect timeout at address a0080000 data c68686c6 .Flash unprotect timeout at address a00a0000 data c68686c6 .Flash unprotect timeout at address a00c0000 data c68686c6 .Flash unprotect timeout at address a00e0000 data c68686c6 . done Un-Protected 11 sectors uboot>
I have another update. THe protect/unprotect failure was happening only when I was using h/w protect enable. I disabled h/w protect to see whether everything else goes well. But timeout happens on write as well. Below is the log message.
uboot> cp.b 0x80000000 0xa0000000 $(filesize) Copy to Flash... Flash buffer write timeout at address a0000000 data c68686c6 Timeout writing to Flash uboot>
Thanks, Shiju

On Thu, 2007-19-04 at 12:51 -0400, Shiju wrote:
On Thu, 2007-19-04 at 11:46 -0400, Shiju wrote:
#define CFG_MAX_FLASH_BANKS 1 #define CFG_MAX_FLASH_SECT 128
This is not correct for your chip. You should have this set not less than the total number of ease units (blocks) on your chip.
For what I could find on the net this chip seems to have the following interesting geometry:
4 x 32kB 254 x 128kB 4 x 32kB
So, the total should be at least 4 + 254 + 4 = 262
Please fix this and provide the logs again...
Thanks Tolunay, I could fix the flash detection after changing the total no: of sector to 262. But the flash unprotect sector always times out.The first 4 sectors are protected when uboot comes up. I am not able to update uboot from within uboot since unprotect sectors always fails on these(all) sector. Should I need to change any timeout values.The log is as below.
### main_loop: bootcmd="run bootcmd_net" Hit any key to stop autoboot: 0 uboot> uboot> protect off a0000000 +100000 Flash unprotect timeout at address a0000000 data c68686c6 .Flash unprotect timeout at address a0008000 data c68686c6 .Flash unprotect timeout at address a0010000 data c68686c6 .Flash unprotect timeout at address a0018000 data c68686c6 .Flash unprotect timeout at address a0020000 data c68686c6 .Flash unprotect timeout at address a0040000 data c68686c6 .Flash unprotect timeout at address a0060000 data c68686c6 .Flash unprotect timeout at address a0080000 data c68686c6 .Flash unprotect timeout at address a00a0000 data c68686c6 .Flash unprotect timeout at address a00c0000 data c68686c6 .Flash unprotect timeout at address a00e0000 data c68686c6 . done Un-Protected 11 sectors uboot>
I have another update. THe protect/unprotect failure was happening only when I was using h/w protect enable. I disabled h/w protect to see whether everything else goes well. But timeout happens on write as well. Below is the log message.
uboot> cp.b 0x80000000 0xa0000000 $(filesize) Copy to Flash... Flash buffer write timeout at address a0000000 data c68686c6 Timeout writing to Flash uboot>
After disabling the buffered writes, write timeout doesn't happen. ALso protect/unprotect works well when h/w protect is enabled. Is there a way to use buffered writes on this flash device.
Thanks, Shiju
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

Shiju wrote:
I have another update. THe protect/unprotect failure was happening only when I was using h/w protect enable. I disabled h/w protect to see whether everything else goes well. But timeout happens on write as well. Below is the log message.
uboot> cp.b 0x80000000 0xa0000000 $(filesize) Copy to Flash... Flash buffer write timeout at address a0000000 data c68686c6 Timeout writing to Flash uboot>
After disabling the buffered writes, write timeout doesn't happen. ALso protect/unprotect works well when h/w protect is enabled. Is there a way to use buffered writes on this flash device.
Try disabling debug outputs in CFI driver. I've seen writes do fail when debug output is enabled.
Tolunay

On Thu, 2007-19-04 at 17:13 -0500, Tolunay Orkun wrote:
Shiju wrote:
I have another update. THe protect/unprotect failure was happening only when I was using h/w protect enable. I disabled h/w protect to see whether everything else goes well. But timeout happens on write as well. Below is the log message.
uboot> cp.b 0x80000000 0xa0000000 $(filesize) Copy to Flash... Flash buffer write timeout at address a0000000 data c68686c6 Timeout writing to Flash uboot>
After disabling the buffered writes, write timeout doesn't happen. ALso protect/unprotect works well when h/w protect is enabled. Is there a way to use buffered writes on this flash device.
Try disabling debug outputs in CFI driver. I've seen writes do fail when debug output is enabled.
I tested disabling the debug outputs. Still writes and protect/unprotect fails if CFG_FLASH_USE_BUFFER_WRITE is defined.
Thanks, Shiju

Shiju wrote:
On Thu, 2007-19-04 at 17:13 -0500, Tolunay Orkun wrote:
Shiju wrote:
I have another update. THe protect/unprotect failure was happening only when I was using h/w protect enable. I disabled h/w protect to see whether everything else goes well. But timeout happens on write as well. Below is the log message.
uboot> cp.b 0x80000000 0xa0000000 $(filesize) Copy to Flash... Flash buffer write timeout at address a0000000 data c68686c6 Timeout writing to Flash uboot>
After disabling the buffered writes, write timeout doesn't happen. ALso protect/unprotect works well when h/w protect is enabled. Is there a way to use buffered writes on this flash device.
Try disabling debug outputs in CFI driver. I've seen writes do fail when debug output is enabled.
I tested disabling the debug outputs. Still writes and protect/unprotect fails if CFG_FLASH_USE_BUFFER_WRITE is defined.
Is this chip capable of buffer writes? It is a new chip. It is described as Stacked Multo-chip Cellular RAM flash. I do not know. You will have to debug a bit to find out why. If your debugging indicates something that should be addressed in the driver please submit a patch...
Tolunay
participants (3)
-
Shiju
-
Shiju Mathew
-
Tolunay Orkun