[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 <[EMAIL PROTECTED]> Signed-off-by: Harald Welte <[EMAIL PROTECTED]> --- 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 */ -- - Harald Welte <[EMAIL PROTECTED]> http://laforge.gnumonks.org/ ============================================================================ "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)
signature.asc
Description: Digital signature
------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users