mtd: Add bad block table overrides to Davinci NAND driver

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 30 07:59:02 EST 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f611a79fe9859a30f2a7ae94b4d24f8e2dd75c91
Commit:     f611a79fe9859a30f2a7ae94b4d24f8e2dd75c91
Parent:     837479d25e221ba616de2c734f58e1decd8cdb95
Author:     Mark A. Greer <mgreer at mvista.com>
AuthorDate: Mon Oct 12 16:16:37 2009 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Nov 30 11:31:09 2009 +0000

    mtd: Add bad block table overrides to Davinci NAND driver
    
    The existing NAND infrastructure allows the default main and
    mirror bad block tables to be overridden in nand_default_bbt().
    However, the davinci_nand driver does not support this.  Add
    that support by adding fields to the davinci driver's platform
    data so platform code can pass in their own bbt's and make the
    davinci_nand driver honor them.
    
    Signed-off-by: Mark A. Greer <mgreer at mvista.com>
    Signed-off-by: Kevin Hilman <khilman at deeprootsystems.com>
    CC: Sudhakar Rajashekhara <sudhakar.raj at ti.com>
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 arch/arm/mach-davinci/include/mach/nand.h |    4 ++++
 drivers/mtd/nand/davinci_nand.c           |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/include/mach/nand.h b/arch/arm/mach-davinci/include/mach/nand.h
index b520c4b..b2ad809 100644
--- a/arch/arm/mach-davinci/include/mach/nand.h
+++ b/arch/arm/mach-davinci/include/mach/nand.h
@@ -79,6 +79,10 @@ struct davinci_nand_pdata {		/* platform_data */
 
 	/* e.g. NAND_BUSWIDTH_16 or NAND_USE_FLASH_BBT */
 	unsigned		options;
+
+	/* Main and mirror bbt descriptor overrides */
+	struct nand_bbt_descr	*bbt_td;
+	struct nand_bbt_descr	*bbt_md;
 };
 
 #endif	/* __ARCH_ARM_DAVINCI_NAND_H */
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 68cc924..fe3eba8 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -591,6 +591,8 @@ static int __init nand_davinci_probe(struct platform_device *pdev)
 
 	/* options such as NAND_USE_FLASH_BBT or 16-bit widths */
 	info->chip.options	= pdata->options;
+	info->chip.bbt_td	= pdata->bbt_td;
+	info->chip.bbt_md	= pdata->bbt_md;
 
 	info->ioaddr		= (uint32_t __force) vaddr;
 



More information about the linux-mtd-cvs mailing list