diff options
| author | Simon Polette <spolette@adetelgroup.com> | 2009-05-27 11:19:39 -0400 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-05 13:16:31 -0400 |
| commit | f4fa697c26bcd9e942de26bad970f4de1da5a49b (patch) | |
| tree | 4ba4a23b34d4dcb0e3666d67f1c48d625d589646 | |
| parent | bd3fd62ecc99c709739cb969be76f44903a4043b (diff) | |
mtd: add on-flash BBT support for Atmel NAND driver
Just add a new on-flash-bbt module parameter.
Signed-off-by: Simon Polette <spolette@adetelgroup.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| -rw-r--r-- | drivers/mtd/nand/atmel_nand.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 47a33cec3793..2802992b39da 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
| 27 | #include <linux/moduleparam.h> | ||
| 27 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
| 28 | #include <linux/mtd/mtd.h> | 29 | #include <linux/mtd/mtd.h> |
| 29 | #include <linux/mtd/nand.h> | 30 | #include <linux/mtd/nand.h> |
| @@ -47,6 +48,9 @@ | |||
| 47 | #define no_ecc 0 | 48 | #define no_ecc 0 |
| 48 | #endif | 49 | #endif |
| 49 | 50 | ||
| 51 | static int on_flash_bbt = 0; | ||
| 52 | module_param(on_flash_bbt, int, 0); | ||
| 53 | |||
| 50 | /* Register access macros */ | 54 | /* Register access macros */ |
| 51 | #define ecc_readl(add, reg) \ | 55 | #define ecc_readl(add, reg) \ |
| 52 | __raw_readl(add + ATMEL_ECC_##reg) | 56 | __raw_readl(add + ATMEL_ECC_##reg) |
| @@ -459,12 +463,17 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
| 459 | 463 | ||
| 460 | if (host->board->det_pin) { | 464 | if (host->board->det_pin) { |
| 461 | if (gpio_get_value(host->board->det_pin)) { | 465 | if (gpio_get_value(host->board->det_pin)) { |
| 462 | printk("No SmartMedia card inserted.\n"); | 466 | printk(KERN_INFO "No SmartMedia card inserted.\n"); |
| 463 | res = ENXIO; | 467 | res = ENXIO; |
| 464 | goto err_no_card; | 468 | goto err_no_card; |
| 465 | } | 469 | } |
| 466 | } | 470 | } |
| 467 | 471 | ||
| 472 | if (on_flash_bbt) { | ||
| 473 | printk(KERN_INFO "atmel_nand: Use On Flash BBT\n"); | ||
| 474 | nand_chip->options |= NAND_USE_FLASH_BBT; | ||
| 475 | } | ||
| 476 | |||
| 468 | /* first scan to find the device and get the page size */ | 477 | /* first scan to find the device and get the page size */ |
| 469 | if (nand_scan_ident(mtd, 1)) { | 478 | if (nand_scan_ident(mtd, 1)) { |
| 470 | res = -ENXIO; | 479 | res = -ENXIO; |
