mtd: nand: introduce NAND_CREATE_EMPTY_BBT
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Sun Oct 24 20:59:09 EDT 2010
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=453281a973c10bce941b240d1c654d536623b16b
Commit: 453281a973c10bce941b240d1c654d536623b16b
Parent: 7cba7b14fe179969d7217cca52e28519d7d6ca89
Author: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
AuthorDate: Fri Oct 1 21:37:37 2010 +0200
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Oct 25 00:54:37 2010 +0100
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 at linutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/nand/nand_bbt.c | 3 ++-
include/linux/mtd/bbm.h | 2 +-
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 1dcafb8..586b981 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
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)
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index ba15b52..57cc0e6 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -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
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index c0464d4..0238665 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -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 */
More information about the linux-mtd-cvs
mailing list