public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd: Nand Atmel: add On Flash BBT support
@ 2009-05-25 15:44 simon polette
  2009-05-26  7:32 ` Artem Bityutskiy
  0 siblings, 1 reply; 11+ messages in thread
From: simon polette @ 2009-05-25 15:44 UTC (permalink / raw)
  To: linux-mtd, linux-arm-kernel; +Cc: spolette

Hi,

Here is a patch which add support for On Flash Bad Block Table on AT91 and
AVR32 devices.

Signed-off-by: Simon Polette <spolette@adetelgroup.com>
---
 drivers/mtd/nand/Kconfig      |    9 +++++++++
 drivers/mtd/nand/atmel_nand.c |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

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 */
 	if (nand_scan_ident(mtd, 1)) {
-- 
1.6.0.4

--
Best regards,
Simon Polette
Adeneo - Adetelgroup

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-05-27 14:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 15:44 [PATCH] mtd: Nand Atmel: add On Flash BBT support simon polette
2009-05-26  7:32 ` Artem Bityutskiy
2009-05-26  9:40   ` simon polette
2009-05-26  9:43     ` Artem Bityutskiy
2009-05-26  9:47       ` simon polette
2009-05-26 10:21         ` simon polette
2009-05-26 11:55           ` simon polette
2009-05-27  6:21             ` Artem Bityutskiy
2009-05-27 10:00               ` simon polette
2009-05-27 13:37                 ` Artem Bityutskiy
2009-05-27 14:44                   ` simon polette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox