[U-Boot] [PATCH] - fix "nand erase clean" problem

Scott Wood scottwood at freescale.com
Mon Oct 27 20:49:40 CET 2008


Ilko Iliev wrote:
>> Why must the cleanmarker fit in the first free segment?
>>   
> The Linux NAND driver looks for the cleanmarkers at this place.

AFAICT, it does a read using MTD_OOB_AUTO, which can span multiple free 
segments.

>> What if oobsize > 64 (as with 4k pages)?  Why write anything at all if
>> you're not going to write the cleanmarker?  Why badblockpos & ~1 (I know
>> existing code does it, but why)?
>>   
> The current Linux NAND Flash driver supports 8, 16 and 64 bytes OOB.

No need to add a place that will silently break if that changes, though.

I think what needs to be done is a write to offset zero using 
MTD_OOB_AUTO.  If it doesn't fit, then an error will be returned.

>> Set ooboffs to zero, and use MTD_OOB_AUTO.
>>
> I think the NAND driver should work not only with MTD_OOB_AUTO.

Explain?  MTD_OOB_AUTO is a feature of the NAND subsystem, which 
automatically places user OOB data in the free regions described by the 
low-level driver.  It's not some hardware feature that may or may not be 
present.

-Scott


More information about the U-Boot mailing list