mtd: Blackfin NFC: fix badblock location with BootROM OOB

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun Oct 24 20:59:11 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5954c47c2194abcdeeae5f752e64b7c75770dbd3
Commit:     5954c47c2194abcdeeae5f752e64b7c75770dbd3
Parent:     d031c22643ce5f0f92eb06735498f63b7bc3e447
Author:     Mike Frysinger <vapier at gentoo.org>
AuthorDate: Sat Oct 16 18:26:59 2010 -0400
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Oct 25 01:15:22 2010 +0100

    mtd: Blackfin NFC: fix badblock location with BootROM OOB
    
    The bbt structure isn't actually used, just the badblockpos.  This lets
    the driver correctly handle badblocks with the different OOB layout with
    certain sized flashes.  Previously, the blocks would all be reported as
    bad and be completely unusable.
    
    Signed-off-by: Mike Frysinger <vapier at gentoo.org>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/bf5xx_nand.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 6fbeefa..79947be 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -110,15 +110,6 @@ static const unsigned short bfin_nfc_pin_req[] =
 	 0};
 
 #ifdef CONFIG_MTD_NAND_BF5XX_BOOTROM_ECC
-static uint8_t bbt_pattern[] = { 0xff };
-
-static struct nand_bbt_descr bootrom_bbt = {
-	.options = 0,
-	.offs = 63,
-	.len = 1,
-	.pattern = bbt_pattern,
-};
-
 static struct nand_ecclayout bootrom_ecclayout = {
 	.eccbytes = 24,
 	.eccpos = {
@@ -809,7 +800,6 @@ static int __devinit bf5xx_nand_probe(struct platform_device *pdev)
 	/* setup hardware ECC data struct */
 	if (hardware_ecc) {
 #ifdef CONFIG_MTD_NAND_BF5XX_BOOTROM_ECC
-		chip->badblock_pattern = &bootrom_bbt;
 		chip->ecc.layout = &bootrom_ecclayout;
 #endif
 		chip->read_buf      = bf5xx_nand_dma_read_buf;
@@ -830,6 +820,10 @@ static int __devinit bf5xx_nand_probe(struct platform_device *pdev)
 		goto out_err_nand_scan;
 	}
 
+#ifdef CONFIG_MTD_NAND_BF5XX_BOOTROM_ECC
+	chip->badblockpos = 63;
+#endif
+
 	/* add NAND partition */
 	bf5xx_nand_add_partition(info);
 



More information about the linux-mtd-cvs mailing list