]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
[MTD] [NAND] fsl_elbc_nand: fix OOB workability for large page NAND chips
authorAnton Vorontsov <avorontsov@ru.mvista.com>
Fri, 27 Jun 2008 19:04:04 +0000 (23:04 +0400)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Jul 2008 17:12:01 +0000 (18:12 +0100)
commit452db2724351ff3d9416a183a7955e00ab4e6ab4
treebdd310ead274e7cb02e0564c898f97b4e391a20a
parentbd5a43822b438f297f4088f1cfd3514e32e56328
[MTD] [NAND] fsl_elbc_nand: fix OOB workability for large page NAND chips

For large page chips, nand_bbt is looking into OOB area, and checking
for "0xff 0xff" pattern at OOB offset 0. That is, two bytes should be
reserved for bbt means.

But ELBC driver is specifying ecclayout so that oobfree area starts at
offset 1, so only one byte left for the bbt purposes.

This causes problems with any OOB users, namely JFFS2: after first mount
JFFS2 will fill all OOBs with "erased marker", so OOBs will contain:

  OOB Data: ff 19 85 20 03 00 ff ff ff 00 00 08 ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

And on the next boot, NAND core will rescan for bad blocks, then will
see "0xff 0x19" pattern, and will mark all blocks as bad ones.

To fix the issue we should implement our own bad block pattern: just one
byte at OOB start. Though, this will work only for x8 chips. For x16
chips two bytes must be checked. Since ELBC driver does not support x16
NANDs (yet), we're safe for now.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/fsl_elbc_nand.c