linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: Blackfin NFC: fix badblock location with BootROM OOB
@ 2010-10-16 22:26 Mike Frysinger
  2010-10-17  8:49 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2010-10-16 22:26 UTC (permalink / raw)
  To: linux-mtd, David Woodhouse; +Cc: uclinux-dist-devel

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@gentoo.org>
---
 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);
 
-- 
1.7.3.1

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

* Re: [PATCH] mtd: Blackfin NFC: fix badblock location with BootROM OOB
  2010-10-16 22:26 [PATCH] mtd: Blackfin NFC: fix badblock location with BootROM OOB Mike Frysinger
@ 2010-10-17  8:49 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-10-17  8:49 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: David Woodhouse, linux-mtd, uclinux-dist-devel

On Sat, 2010-10-16 at 18:26 -0400, Mike Frysinger wrote:
> 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@gentoo.org>
> ---
>  drivers/mtd/nand/bf5xx_nand.c |   14 ++++----------
>  1 files changed, 4 insertions(+), 10 deletions(-)

Taken both patches to l2-mtd-2.6.git.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

end of thread, other threads:[~2010-10-17  8:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-16 22:26 [PATCH] mtd: Blackfin NFC: fix badblock location with BootROM OOB Mike Frysinger
2010-10-17  8:49 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).