]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mtd: nand: introduce NAND_CREATE_EMPTY_BBT
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 1 Oct 2010 19:37:37 +0000 (21:37 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 24 Oct 2010 23:54:37 +0000 (00:54 +0100)
it will create an empty BBT table without considering vendor's BBT
information. Vendor's information may be unavailable if the NAND
controller has a different DATA & OOB layout or this information may be
allready purged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_bbt.c
include/linux/mtd/bbm.h
include/linux/mtd/nand.h

index 1dcafb8f47dd9309d4114231749019ff58c407f3..586b981f0e61397f08e26ee71e1d63a9c39c0068 100644 (file)
@@ -999,7 +999,8 @@ static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc
                        continue;
 
                /* Create the table in memory by scanning the chip(s) */
-               create_bbt(mtd, buf, bd, chipsel);
+               if (!(this->options & NAND_CREATE_EMPTY_BBT))
+                       create_bbt(mtd, buf, bd, chipsel);
 
                td->version[i] = 1;
                if (md)
index ba15b525987d59c8f5c09e45e2258c463f92acfe..57cc0e63714f9651462450db8fbbc78df79b82f1 100644 (file)
@@ -84,7 +84,7 @@ struct nand_bbt_descr {
 #define NAND_BBT_PERCHIP       0x00000080
 /* bbt has a version counter at offset veroffs */
 #define NAND_BBT_VERSION       0x00000100
-/* Create a bbt if none axists */
+/* Create a bbt if none exists */
 #define NAND_BBT_CREATE                0x00000200
 /* Search good / bad pattern through all pages of a block */
 #define NAND_BBT_SCANALLPAGES  0x00000400
index c0464d41f539495a280dd05e2a90067ab6f14adc..023866572fb1e7921a1779e78205acb9900a2413 100644 (file)
@@ -223,6 +223,8 @@ typedef enum {
  * the OOB area.
  */
 #define NAND_USE_FLASH_BBT_NO_OOB      0x00100000
+/* Create an empty BBT with no vendor information if the BBT is available */
+#define NAND_CREATE_EMPTY_BBT          0x00200000
 
 /* Options set by nand scan */
 /* Nand scan has allocated controller struct */