[U-Boot-Users] [PATCH] make creation of nand bad block table optional
Harald Welte
laforge at gnumonks.org
Sun Jul 6 10:04:20 CEST 2008
[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 at openmoko.org>
Signed-off-by: Harald Welte <laforge at 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 */
--
- Harald Welte <laforge at gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080706/3b23c75c/attachment.pgp
More information about the U-Boot
mailing list