[U-Boot-Users] [PATCH] make creation of nand bad block table optional

[PATCH] add new NAND_DONT_CRATE_BBT flag
This patch makes creation of the BBT optional.
It adds a new platform-independent NAND-wide flag NAND_DONT_CREATE_BBT
This flag can be used by the board_nand_init function of a board. It is used by the soon-to-be-submitted board support code for various openmoko products.
Signed-off-by: Werner Almesberger werner@openmoko.org Signed-off-by: Harald Welte laforge@openmoko.org
---
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 748b266..27d5988 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -678,7 +678,8 @@ static int check_create (struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_des } create: /* Create the bad block table by scanning the device ? */ - if (!(td->options & NAND_BBT_CREATE)) + if (!(td->options & NAND_BBT_CREATE) || + (this->options & NAND_DONT_CREATE_BBT)) continue;
/* Create the table in memory by scanning the chip(s) */ diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 4cc4a7d..698ab2b 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -187,7 +187,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_ * This can only work if we have the ecc bytes directly behind the * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ #define NAND_HWECC_SYNDROME 0x00020000 - +/* Do not create an BBT if none is found. Overrides NAND_BBT_CREATE. */ +#define NAND_DONT_CREATE_BBT 0x00040000
/* Options set by nand scan */ /* Nand scan has allocated oob_buf */

On Sun, Jul 06, 2008 at 04:04:20PM +0800, Harald Welte wrote:
[PATCH] add new NAND_DONT_CRATE_BBT flag
This patch makes creation of the BBT optional.
It adds a new platform-independent NAND-wide flag NAND_DONT_CREATE_BBT
The testing branch of u-boot-nand-flash already has NAND_SKIP_BBTSCAN.
Are the semantics of this any different?
-Scott
participants (2)
-
Harald Welte
-
Scott Wood