diff mbox

[4/5] mtd/nand: introduce NAND_CREATE_EMPTY_BBT

Message ID 1285782234-32509-5-git-send-email-bigeasy@linutronix.de
State New, archived
Headers show

Commit Message

Sebastian Andrzej Siewior Sept. 29, 2010, 5:43 p.m. UTC
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 if this information is
allready purged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 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(-)

Comments

Artem Bityutskiy Oct. 1, 2010, 6:57 p.m. UTC | #1
On Wed, 2010-09-29 at 19:43 +0200, Sebastian Andrzej Siewior wrote:
> 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 if this information is
> allready purged.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

This one does not apply on top of your patch 3/5 v2, could you please
refresh it and resend?
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 11e4204..fd3295e 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -994,7 +994,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 68caf20..c4b1055 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -218,6 +218,8 @@  typedef enum {
 /* If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch
  * 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 */