[PATCH 3/3] atmel_nand: add support for flash based bad block table
Marc Kleine-Budde
mkl at pengutronix.de
Tue Feb 22 06:13:05 EST 2011
Inspired by Simon Polette's the kernel commit
f4fa697c26bcd9e942de26bad970f4de1da5a49b.
Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
---
arch/arm/mach-at91/include/mach/board.h | 1 +
drivers/mtd/nand/atmel_nand.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h
index 1ab05ad..34a3966 100644
--- a/arch/arm/mach-at91/include/mach/board.h
+++ b/arch/arm/mach-at91/include/mach/board.h
@@ -34,6 +34,7 @@ struct atmel_nand_data {
u8 ale; /* address line number connected to ALE */
u8 cle; /* address line number connected to CLE */
u8 bus_width_16; /* buswidth is 16 bit */
+ u8 flash_bbt; /* use a flash based bbt */
u8 ecc_mode; /* NAND_ECC_* */
};
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index e8f85fc..85e4b24 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -436,6 +436,11 @@ static int __init atmel_nand_probe(struct device_d *dev)
}
}
+ if (host->board->flash_bbt) {
+ printk(KERN_INFO "atmel_nand: Use On Flash BBT\n");
+ nand_chip->options |= NAND_USE_FLASH_BBT;
+ }
+
/* first scan to find the device and get the page size */
if (nand_scan_ident(mtd, 1)) {
res = -ENXIO;
--
1.7.2.3
More information about the barebox
mailing list