From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Mon, 20 Nov 2006 17:39:01 -0600 Subject: [U-Boot-Users] 16BIT SPANSION Flash writing problem with CFI Driver In-Reply-To: <20061120104854.63524.qmail@web15915.mail.cnb.yahoo.com> References: <20061120104854.63524.qmail@web15915.mail.cnb.yahoo.com> Message-ID: <45623C95.30104@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Sam Song wrote: >> non-buffered writes I believe the write timeout of 0 >> may be the problem. Typically these values are set >> to 0 if the feature is not supported but >> the datasheet gives program sequence as well. Please >> override the data read from CFI regarding write >> timeout with a non zero value (say 1ms >> timeout) and see what happens. Perhaps, they set the >> > > With this hacking way as suggested, it simply worked > fine! I tried programming a 1.4MB files several times. > No probelm. > Glad to hear that the hack has worked. > --- drivers/cfi_flash.c 17 Nov 2006 09:02:43 -0000 > 1.2 > +++ drivers/cfi_flash.c 20 Nov 2006 03:41:43 -0000 > 1.3 > @@ -1107,7 +1107,12 @@ ulong flash_get_size (ulong > +#ifndef CONFIG_S29GL064M > info->write_tout = (tmp * (1 << flash_read_uchar > (info, FLASH_OFFSET_WMAX_TOUT))) / 1000; > +#else > + info->write_tout = 1; /* Suggested by Tolunay */ > +#endif /* CONFIG_S29GL064M */ > + > Instead of a chip specific solution we should try to find more generalized solution. At minimum, we could always use 1 if the value turns out to be 0 after calculation. Or maybe we should examine the DQ7 toggle check to see if there is a race condition. If there is a race condition there we should fix that problem instead. Best regards, Tolunay