From: R&D4 <r&d4@dave-tech.it>
To: mtd_mailinglist <linux-mtd@lists.infradead.org>
Subject: NAND bad block: 1st or 2nd page?
Date: Thu, 20 Dec 2007 15:45:10 +0100 [thread overview]
Message-ID: <476A7FF6.8010604@dave-tech.it> (raw)
Dear MTD Gurus,
I have a question about bad block management, especially regarding how
NAND manifacturer mark bad blocks in factory and how MTD check this
"marker".
Preamble: I will care only about small block NAND here, large block are
a bit different in bad block management.
Reading your "NAND Flash FAQ" here:
http://www.linux-mtd.infradead.org/faq/nand.html#L_nand_bootloader
I see this:
"They [factory-marked bad blocks] are marked in the 6th byte (offset
0x5) in the out of band area of the first page of a block."
Looking (from an ignorant point of view like mine ;-) ) at the code
inside drivers/mtd/nand_base.c, it seems that FAQ is correct and only
this byte of the first page is checked (of course, correct me if I'm wrong).
On the other side I read carefully some NAND manifacturer datasheet
(Samsung, ST and so on) I find the following:
* Samsung (Identifying Initial Invalid Block(s)):
"The initial invalid block(s) status is defined by the 6th byte in the
spare area. Samsung makes sure that either the 1st or 2nd page of every
initial invalid block has non-FFh data at the column address of 517."
* ST (bad block algorithm):
"Any block where the 6th Byte/ 1st Word in the spare area of the 1st or
2nd page (if the 1st page is Bad) does not contain FFh is a Bad Block."
The "key words" here are "1st OR 2nd page".
It seems that manifacturer mark both or only one of these pages and that
software should check for two bytes: the 6th of the OOB of the first
AND second page of each erase block. Only if both are equal to 0xFF it
means that the block is NOT bad.
I found that, on the other side, Toshiba seems a bit different here:
"Read Check [for bad block]: to verify the column address 517 bytes of
the first page in the block with FFh"
So.. with Toshiba NAND you need to check only the first page.
Am I missing something?
Do I misunderstood these datasheet or the FAQ are not correct?
How is this handled in nand_base.c? (I saw only 1 check for eraseblock)
Thanks in advance and Best Regards,
--
Andrea
DAVE Srl - Electronics System House
e-mail address: r&d4@dave-tech.it
reply other threads:[~2007-12-20 14:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=476A7FF6.8010604@dave-tech.it \
--to=r&d4@dave-tech.it \
--cc=linux-mtd@lists.infradead.org \
/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