[U-Boot-Users] bug in cfi_flash error detection

Martin Krause
2005-10-17T16:24:54Z

Hi all,

recently I got back a board from our customer, where some
bits in the (nor) flash could not be programmed due to
an error in the flash chip (-> very rare error).

I tought, this would be a good reason, to test the common
cfi_flash driver with this board (so far we used a board
specific flash driver on this board).

But the cfi_flash driver does not detect the error as I
expected. I took a closer look to the driver and found
some bugs (at least in my opinion).

I added a patch wich tries to fix it, but I'm not sure
if this is the proper way it should be done (e. g.
because it adds bytes to cfi_flash.o).

Here a brief description of what the patch tries to fix:

- Timeout calculation in flash_status_check():
The function calculates seconds instead of miliseconds.
And on some boards the range of ulong is exceeded in the
calculation (because CFG_HZ is very big on some boards).

- In flash_status_check() a bogus error message is printed
(secotor number is always 0 and the printed data value is
not from the address where the error occours).

- flash_status_check() uses always the erase block timeout,
regardles if eraseing flash or writing flash.

- If the write timeout of the flash device is below 1 ms
it is erroneously calculated to zero.

Any comment would be welcome.

Regards,
Martin

TQ-Systems GmbH
M?hlstra?e 2, Gut Delling, 82229 Seefeld
Tel. +49 (8153) 93 08-157, Fax +49 (8153) 93 08-7157
martin.krause at tqs.de
www.tq-group.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_cfi_flash
Type: application/octet-stream
Size: 2796 bytes
Desc: patch_cfi_flash
Url : http://lists.denx.de/pipermail/u-boot/attachments/20051017/cd5df089/attachment.obj