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

Ilko Iliev iliev at ronetix.at
Tue Oct 28 11:45:21 CET 2008


Dear Scott,

Scott Wood wrote:
> 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.
Yes, but the current U-BOOT uses MTD_OOB_PLACE and the command "nand 
erase clean" marks all blocks as bad.

>
>>> 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.
No, I think it will work also with OOB=128 bytes

>
> 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.
At the moment U-BOOT doesn't use MTD_OOB_AUTO and the NAND flash can't 
be erased with "nand erase clean".
I think this bug should be corrected instead of to switch to MTD_OOB_AUTO.

-- 
Mit freundlichen Grüßen/With best regards,
Ilko Iliev
Ronetix Development Tools GmbH
CPU Modules, JTAG/BDM Emulators and Flash Programmers
Waidhausenstrasse 13/5, 1140 Vienna, Austria
E-Mail: iliev at ronetix.at; Web: www.ronetix.at



More information about the U-Boot mailing list