| Submitter | simon polette |
|---|---|
| Date | May 27, 2009, 10 a.m. |
| Message ID | <72795ccb0905270300p7ac111fduba8d656a8031a96c@mail.gmail.com> |
| Download | mbox | patch |
| Permalink | /patch/27723/ |
| State | New |
| Headers | show |
Comments
On Wed, 2009-05-27 at 12:00 +0200, simon polette wrote:
> Hoping the patch is correct now :
Did you that test this driver with on-flash BBT? Does it
work? Did you try marking/un-marking blocks bad? I'm just
curious.
I added your patch to my l2-mtd-2.6.git.
2009/5/27 Artem Bityutskiy <dedekind@infradead.org>: > On Wed, 2009-05-27 at 12:00 +0200, simon polette wrote: >> Hoping the patch is correct now : > > Did you that test this driver with on-flash BBT? Does it > work? Did you try marking/un-marking blocks bad? I'm just > curious. > > I added your patch to my l2-mtd-2.6.git. > > -- > Best regards, > Artem Bityutskiy (Битюцкий Артём) > > Yes I test it on a AT91SAM9261EK board and it work find, but I didn't try to mark blocks as bad. Best regards.
Patch
Signed-off-by: Simon Polette <spolette@adetelgroup.com> --- 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 47a33ce..2802992 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -24,6 +24,7 @@ #include <linux/slab.h> #include <linux/module.h> +#include <linux/moduleparam.h> #include <linux/platform_device.h> #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h> @@ -47,6 +48,9 @@ #define no_ecc 0 #endif +static int on_flash_bbt = 0; +module_param(on_flash_bbt, int, 0); + /* Register access macros */ #define ecc_readl(add, reg) \ __raw_readl(add + ATMEL_ECC_##reg) @@ -459,12 +463,17 @@ static int __init atmel_nand_probe(struct platform_device *pdev) if (host->board->det_pin) { if (gpio_get_value(host->board->det_pin)) { - printk("No SmartMedia card inserted.\n"); + printk(KERN_INFO "No SmartMedia card inserted.\n"); res = ENXIO; goto err_no_card; } } + if (on_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.6.0.4