diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2010-10-01 15:37:37 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-24 19:54:37 -0400 |
commit | 453281a973c10bce941b240d1c654d536623b16b (patch) | |
tree | 3646851ff197fcbf64e796a6bdf4324bd77f8544 | |
parent | 7cba7b14fe179969d7217cca52e28519d7d6ca89 (diff) |
mtd: nand: introduce NAND_CREATE_EMPTY_BBT
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>
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 3 | ||||
-rw-r--r-- | include/linux/mtd/bbm.h | 2 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 1dcafb8f47dd..586b981f0e61 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -999,7 +999,8 @@ static int check_create(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_desc | |||
999 | continue; | 999 | continue; |
1000 | 1000 | ||
1001 | /* Create the table in memory by scanning the chip(s) */ | 1001 | /* Create the table in memory by scanning the chip(s) */ |
1002 | create_bbt(mtd, buf, bd, chipsel); | 1002 | if (!(this->options & NAND_CREATE_EMPTY_BBT)) |
1003 | create_bbt(mtd, buf, bd, chipsel); | ||
1003 | 1004 | ||
1004 | td->version[i] = 1; | 1005 | td->version[i] = 1; |
1005 | if (md) | 1006 | if (md) |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index ba15b525987d..57cc0e63714f 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -84,7 +84,7 @@ struct nand_bbt_descr { | |||
84 | #define NAND_BBT_PERCHIP 0x00000080 | 84 | #define NAND_BBT_PERCHIP 0x00000080 |
85 | /* bbt has a version counter at offset veroffs */ | 85 | /* bbt has a version counter at offset veroffs */ |
86 | #define NAND_BBT_VERSION 0x00000100 | 86 | #define NAND_BBT_VERSION 0x00000100 |
87 | /* Create a bbt if none axists */ | 87 | /* Create a bbt if none exists */ |
88 | #define NAND_BBT_CREATE 0x00000200 | 88 | #define NAND_BBT_CREATE 0x00000200 |
89 | /* Search good / bad pattern through all pages of a block */ | 89 | /* Search good / bad pattern through all pages of a block */ |
90 | #define NAND_BBT_SCANALLPAGES 0x00000400 | 90 | #define NAND_BBT_SCANALLPAGES 0x00000400 |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index c0464d41f539..023866572fb1 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -223,6 +223,8 @@ typedef enum { | |||
223 | * the OOB area. | 223 | * the OOB area. |
224 | */ | 224 | */ |
225 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 | 225 | #define NAND_USE_FLASH_BBT_NO_OOB 0x00100000 |
226 | /* Create an empty BBT with no vendor information if the BBT is available */ | ||
227 | #define NAND_CREATE_EMPTY_BBT 0x00200000 | ||
226 | 228 | ||
227 | /* Options set by nand scan */ | 229 | /* Options set by nand scan */ |
228 | /* Nand scan has allocated controller struct */ | 230 | /* Nand scan has allocated controller struct */ |