From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase
Date: Tue, 7 Apr 2015 16:09:46 -0500 [thread overview]
Message-ID: <1428440986.22867.461.camel@freescale.com> (raw)
In-Reply-To: <87iod7kemw.fsf@nbsps.com>
On Tue, 2015-04-07 at 13:54 -0400, Bill Pringlemeir wrote:
> On 7 Apr 2015, scottwood at freescale.com wrote:
> > On Tue, 2015-04-07 at 10:06 -0400, Bill Pringlemeir wrote:
>
> >> In any case the document has,
>
> >> If the NAND flash supports sub-pages, then what can be done is ECC
> >> codes can be calculated on per-sub-page basis, instead of per-NAND
> >> page basis. In this case it becomes possible to read and write
> >> sub-pages independently.
>
> >> Probably if we want sub-pages with this controller and hw-ecc, we
> >> need to use the virtual buffer features of the chip. The controller
> >> needs an entire current buffer in the SRAM to calculate the hw-ecc to
> >> write. So even if it writes less than a full page, the entire page
> >> must be read to calculate the hw-ecc to be written.
>
> > That limitation sounds similar to the Freescale NAND controllers that
> > I'm familiar with (eLBC and IFC). For eLBC we do subpages by just
> > writing 0xff, because on that controller the ECC of all 0xff is all
> > 0xff so it doesn't disturb anything. IFC has different ECC algorithms
> > where that isn't the case, so we disabled subpage write on IFC.
>
> > What is the virtual buffer feature?
>
> >> I am pretty sure that all controllers that support hw-ecc will need
> >> to do this.
>
> > Not if they can handle doing ECC on a single subpage.
>
> [from another thread, but the same subject].
>
> >> The other way to handle things would to be to investigate the
> >> NFC_CFG[PAGE_CNT] and NFC_SECSZ to have the virtual pages support
> >> sub-pages. I think the OOB mapping would be non-standard in such
> >> cases.
>
> > Wouldn't that mess up factory bad block markers?
>
> All the stuff above is related (afaik).
>
> > What is the virtual buffer feature?
>
> It splits programming of a flash page into separate buffers. The
> BCH-HW-ECC is then applied separately to each 'virtual-page' with
> reduced strength. Section "31.4.6 Organization of the Data in the NAND
> Flash" of the Vybrid Software RM has details.
>
> > Wouldn't that mess up factory bad block markers?
>
> I am unsure; certainly they can be read but they might be a data portion
> of the fourth sub-page depending on the ECC strength selected.
That would be bad. Even if you somehow get the MTD code to read markers
in the main area on first use, you wouldn't be able to reconstruct the
BBT after you start writing data. If you must do this, I suggest
migrating the bad block markers to the new OOB before usage (see
http://patchwork.ozlabs.org/patch/168855/ for an example).
> However, it seems like your comment that the ECC must be different
> per-subpage (and what Artem said in the sub-pages documentation) makes
> 'virtual buffers' the most promising path for this driver and sub-page
> support with hw-ecc. As the bit strength is reduced, the amount of
> corrections/error detection also seems reduced. I think the math would
> make this the same for everyone?
Flash chips usually specify the required ECC on a subpage basis.
> Your question about factory BBT is a good point. Using the 'virtual
> buffers' feature will complicate the driver code by quite a bit at least
> from what I could think of and what I see in the MTD tree where I
> believe similar features are used.
Which gets back to the question of whether subpages are worth it with
this controller. Or, if subpage writes are infrequent enough, stick
with the read/modify/write approach but delay the read until you know
that it's going to be a subpage write.
-Scott
next prev parent reply other threads:[~2015-04-07 21:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 16:54 [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase Stefan Agner
2015-03-24 16:54 ` [U-Boot] [PATCH 2/2] mtd: vf610_nfc: specify transfer size before each transfer Stefan Agner
2015-03-30 17:02 ` [U-Boot] [PATCH 1/2] mtd: vf610_nfc: mark page as dirty on block erase Bill Pringlemeir
2015-03-30 20:14 ` Stefan Agner
2015-03-30 20:46 ` Scott Wood
2015-03-30 20:34 ` Scott Wood
2015-03-30 20:40 ` Stefan Agner
2015-03-30 20:48 ` Scott Wood
2015-03-30 21:26 ` Stefan Agner
2015-03-30 22:15 ` Scott Wood
2015-03-30 22:24 ` Stefan Agner
2015-03-31 4:34 ` Scott Wood
2015-03-31 15:02 ` Bill Pringlemeir
2015-04-02 23:48 ` Scott Wood
2015-04-03 18:09 ` Stefan Agner
2015-04-03 20:15 ` Scott Wood
2015-04-03 20:28 ` Stefan Agner
2015-04-03 21:03 ` Scott Wood
2015-04-07 14:06 ` Bill Pringlemeir
2015-04-07 16:02 ` Scott Wood
2015-04-07 17:54 ` Bill Pringlemeir
2015-04-07 21:09 ` Scott Wood [this message]
2015-03-30 21:35 ` Bill Pringlemeir
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=1428440986.22867.461.camel@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