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

Martin Krause
2005-10-18T08:39:02Z

Hi Tolunay,

thank you for your reply!

Tolunay Orkun wrote on Monday, October 17, 2005 8:24 PM:
> Martin Krause wrote:
> Some of the issues you are fixing are also fixed my earlier patch in
> the pipeline (from July). See my patch below for items 1,3,4 in your
> list.
>
> http://sourceforge.net/mailarchive/message.php?msg_id=12234135

OK, I missed this :(

> I think, in flash_status_check() your patch timeout check is not
> correct. get_timer() returns in msec as well as tout is in msecs. So,
> they are directly comparable without involving CFG_HZ.

I think this is only true for boards where CFG_HZ is 1000.

> I think the full status check needs to be applied to sector 0
> irrespective of what sector you are operating with because this is
> where the flash status register resides. I think some flash ignore
> the sector address while others require sector 0. I would be careful
> in changing this without verifying for a wide range of flash chips.

It seems that during flash commands other than for writing (flash
erase, flash protect, ...), the sector address has not to be 0 while
checking status register. Is this correct?

Do you know a flash device, where the sector address has to bee 0
during DQ6 toggle bit staus checking? I only ask to avoid such
flash devices in new designs ;-)

> Yes, the sector number will be wrong in error if you activate debug
> outputs but it is only cosmetic as far as I can see. Also, finding
> the sector number each time from address is a time consuming search
> that will slow the flash write operation unnecessarily. I am more
> willing to take the wrong sector number in debug output (if enabled)

As far as I can see, the error message in flash_status_check()
is printed always, not only if debug output is enabled.

> than slowed down status check which is used in a number of places.

Maybe it is better then to print no details about the sector or
address where the error occours, than to print wrong values?

Regards,
Martin