From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] NAND: Add scrub.quiet command option
Date: Tue, 13 Sep 2011 17:22:11 -0500 [thread overview]
Message-ID: <4E6FD793.4010906@freescale.com> (raw)
In-Reply-To: <201109130302.16991.marek.vasut@gmail.com>
On 09/12/2011 08:02 PM, Marek Vasut wrote:
> On Tuesday, September 13, 2011 01:24:22 AM Scott Wood wrote:
>> On 09/12/2011 02:42 PM, Marek Vasut wrote:
>>> On Monday, September 12, 2011 09:36:49 PM Scott Wood wrote:
>>>> On 09/12/2011 02:28 PM, Marek Vasut wrote:
>>>>> On Monday, September 12, 2011 09:19:06 PM Scott Wood wrote:
>>>>>> What's it doing with them? Migrating them is something that should
>>>>>> only happen on the first use, as there will later be data in the
>>>>>> factory bad block area, right? So it shouldn't be "always".
>>>>>> Migration should be an explicitly requested option. Like scrub. :-)
>>>>>>
>>>>>> Where is the code that does this? Which driver?
>>>>>
>>>>> The BCH accelerator does this.
>>>>
>>>> In hardware? What chip is this, and where is the code that drives this
>>>> chip?
>>>
>>> I think it does something to it, yes. i.MX287, see the patchset [PATCH
>>> 00/15 V2] Support for the DENX M28 SoM, [PATCH 09/15] iMX28: Add GPMI
>>> NAND driver .
[snip]
> The problem with erase here is that the block's ECC is updated on erase.
I don't understand this -- wouldn't that stop you from being able to
later write a different ECC (when you write the actual data)? Is the
controller snooping the command bytes you issue for erase, and then
generating a program sequence? How would the hardware even know that
you told U-Boot to scrub?
>>> I looked at the code and the datasheet, and without getting into it too
>>> deeply, I don't see how BCH is involved in an erase operation. What
>>> specifically are you seeing happen?
>>>
>>> The "Raw NAND Boot Mode" section (12.12 in my copy of the i.MX28 manual)
>>> says that it uses BCH for ECC -- is this not the case? Is it some
>>> special configuration of BCH?
>>>
>>> I tried reading the "Bad Block Handling in the ROM" section and got a
>>> headache.
>>
>> 12.12.1.8 is exactly it. See fig. 12-11.
I think we have different versions, that's "Layout of Boot Page
containing FCB" in my copy, which shows a fixed spare/data/ECC layout
that may not match what is programmed for normal BCH operations, but it
doesn't say anything about bad block markers.
The bad block marker stuff is in 12.12.1.12 (figure 12-13) in my copy.
It says:
> In order to preserve the BI (bad block information), flash updater or gang programmer
> applications need to swap Bad Block Information (BI) data to byte 0 of metadata area for
> every page before programming NAND Flash.
Before first programming the flash, you'll need to make sure that all
blocks that are marked bad in the normal way get marked bad in the new
layout, but you don't need to *swap* anything. The block's bad, the
rest of the block doesn't matter. But anyway...
> ROM when loading firmware, copies back
> the value at metadata[0] to BI offset in page data. The following figure shows how the
> factory bad block marker is preserved.
...this is insane. It seems that they want you to swap this byte even
in good blocks, so that you put the byte of real data that should go
somewhere in the middle of the last 512-byte ECC chunk at offset zero in
the page. This means that it will show up as a bad block when normal
(but new-layout-using) software looks at it, which is why you need
scrub. Ew.
How many blocks are being loaded by this mechanism? Just block zero
(which is normally supposed to be guaranteed good anyway...)? Or
multiple blocks?
Any chance you could blow the NAND_MEMBLOCK_MARKER_RESERVE fuse? :-)
Otherwise, I guess you do need to scrub. Have you complained to
Freescale sales/support?
> But we want to write a block in our own format, so we need to scrub (wipe the block
> completely).
Erase always wipes the block completely, if it erases at all. Scrub in
this context just means that U-Boot ignores the bad block indications
(marker or table). Otherwise it would avoid erasing bad blocks, so that
they stay bad, and you won't have scrubbed the entire region requested.
>> I work for the PowerPC side of Freescale, in case you're wondering why
>> I'm unfamiliar with this. :-)
>
> Interesting ... does everyone work for the PowerPC side of Freescale or is there
> some other reason why I never met anyone working for the ARM side of Freescale ?
> ;-)
They exist, but don't seem to engage Open Source development communities
to the same degree.
-Scott
next prev parent reply other threads:[~2011-09-13 22:22 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-12 4:04 [U-Boot] [PATCH 0/5 V2] Random NAND fixes and improvements Marek Vasut
2011-09-12 4:04 ` [U-Boot] [PATCH 1/5] NAND: Really ignore bad blocks when scrubbing Marek Vasut
2011-09-27 18:54 ` Scott Wood
2011-09-12 4:04 ` [U-Boot] [PATCH 2/5] NAND: Add nand read.raw and write.raw commands Marek Vasut
2011-09-21 18:48 ` Scott Wood
2011-09-22 1:55 ` [U-Boot] [PATCH 2/5 V2] " Marek Vasut
2011-09-22 16:03 ` Scott Wood
2011-09-22 18:36 ` [U-Boot] [PATCH 2/5 V3] " Marek Vasut
2011-09-22 18:40 ` Scott Wood
2011-09-23 13:43 ` [U-Boot] [PATCH 2/5 V4] " Marek Vasut
2011-09-27 18:57 ` Scott Wood
2011-09-12 4:04 ` [U-Boot] [PATCH 3/5] NAND: Allow per-buffer allocation Marek Vasut
2011-09-21 18:50 ` Scott Wood
2011-09-21 19:49 ` Wolfgang Denk
2011-09-21 19:55 ` Scott Wood
2011-09-21 20:16 ` Wolfgang Denk
2011-09-22 1:34 ` Marek Vasut
2011-09-22 7:41 ` Stefano Babic
2011-09-22 8:51 ` Marek Vasut
2011-09-23 17:35 ` Scott Wood
2011-09-24 12:37 ` Marek Vasut
2011-09-26 18:33 ` Scott Wood
2011-09-26 18:49 ` Marek Vasut
2011-09-12 4:04 ` [U-Boot] [PATCH 4/5] NAND: Make page, erase, oob size available via cmd_nand Marek Vasut
2011-09-21 18:55 ` Scott Wood
2011-09-21 19:52 ` Wolfgang Denk
2011-09-22 1:57 ` [U-Boot] [PATCH 4/5 V2] " Marek Vasut
2011-09-27 19:01 ` Scott Wood
2011-09-27 19:38 ` Marek Vasut
2011-09-27 19:51 ` Scott Wood
2011-09-27 20:07 ` Marek Vasut
2011-09-27 20:53 ` Scott Wood
2011-09-27 21:04 ` Marek Vasut
2011-09-27 21:14 ` Scott Wood
2011-09-12 4:04 ` [U-Boot] [PATCH 5/5] NAND: Add scrub.quiet command option Marek Vasut
2011-09-12 16:45 ` Mike Frysinger
2011-09-12 17:45 ` Marek Vasut
2011-09-12 18:06 ` Scott Wood
2011-09-12 18:24 ` Marek Vasut
2011-09-12 18:31 ` Scott Wood
2011-09-12 18:36 ` Marek Vasut
2011-09-12 19:19 ` Scott Wood
2011-09-12 19:28 ` Marek Vasut
2011-09-12 19:36 ` Scott Wood
2011-09-12 19:42 ` Marek Vasut
2011-09-12 23:24 ` Scott Wood
2011-09-13 1:02 ` Marek Vasut
2011-09-13 4:25 ` Wolfgang Denk
2011-09-13 4:36 ` Marek Vasut
2011-09-13 22:22 ` Scott Wood [this message]
2011-09-13 22:41 ` Marek Vasut
2011-09-13 22:53 ` Scott Wood
2011-09-12 18:37 ` Wolfgang Denk
2011-09-12 18:50 ` Marek Vasut
2011-09-12 20:33 ` Mike Frysinger
2011-09-12 22:59 ` Marek Vasut
2011-09-13 22:20 ` [U-Boot] [PATCH 5/5] NAND: Add -y option to nand scrub command Marek Vasut
2011-09-13 22:28 ` Mike Frysinger
2011-09-27 19:03 ` Scott Wood
-- strict thread matches above, loose matches on Subject: below --
2011-09-08 20:39 [U-Boot] [PATCH 0/5] Random NAND fixes and improvements Marek Vasut
2011-09-08 20:39 ` [U-Boot] [PATCH 5/5] NAND: Add scrub.quiet command option Marek Vasut
2011-09-09 15:39 ` Detlev Zundel
2011-09-10 20:54 ` Marek Vasut
2011-09-12 9:49 ` Detlev Zundel
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=4E6FD793.4010906@freescale.com \
--to=scottwood@freescale.com \
--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