public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilko Iliev <iliev@ronetix.at>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] - fix "nand erase clean" problem
Date: Tue, 28 Oct 2008 11:45:21 +0100	[thread overview]
Message-ID: <4906ED41.3080604@ronetix.at> (raw)
In-Reply-To: <49061B54.2060904@freescale.com>

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

  reply	other threads:[~2008-10-28 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26 16:48 [U-Boot] [PATCH] - fix "nand erase clean" problem Ilko Iliev
2008-10-27 18:50 ` Scott Wood
2008-10-27 19:39   ` Ilko Iliev
2008-10-27 19:49     ` Scott Wood
2008-10-28 10:45       ` Ilko Iliev [this message]
2008-10-28 16:55         ` Scott Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4906ED41.3080604@ronetix.at \
    --to=iliev@ronetix.at \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox