From patchwork Mon May 25 15:44:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: mtd: Nand Atmel: add On Flash BBT support Date: Mon, 25 May 2009 05:44:22 -0000 From: simon polette X-Patchwork-Id: 27617 Message-Id: <72795ccb0905250844w13ed9798me95d70614050f676@mail.gmail.com> To: linux-mtd , linux-arm-kernel@lists.arm.linux.org.uk Cc: spolette@adetelgroup.com Hi, Here is a patch which add support for On Flash Bad Block Table on AT91 and AVR32 devices. Signed-off-by: Simon Polette --- drivers/mtd/nand/Kconfig | 9 +++++++++ drivers/mtd/nand/atmel_nand.c | 3 +++ 2 files changed, 12 insertions(+), 0 deletions(-) if (nand_scan_ident(mtd, 1)) { diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 890936d..c860688 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -333,6 +333,15 @@ config MTD_NAND_ATMEL_ECC_NONE endchoice +config MTD_NAND_ATMEL_FLASH_BBT + bool "Use On-Flash Bad Block Table" + depends on MTD_NAND_ATMEL + help + This enables the On-Flash BBT, which mean that the bad blocks + will be scanned one time then the BBT will be stored + in flash, so scanning Nand flash for bad blocks will be no more + necessary for the next boots. + config MTD_NAND_PXA3xx tristate "Support for NAND flash devices on PXA3xx" depends on MTD_NAND && PXA3xx diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 47a33ce..dca19dd 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -464,6 +464,9 @@ static int __init atmel_nand_probe(struct platform_device *pdev) goto err_no_card; } } +#ifdef CONFIG_MTD_NAND_ATMEL_FLASH_BBT + nand_chip->options |= NAND_USE_FLASH_BBT; +#endif /* first scan to find the device and get the page size */