All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix 2k pagesize NAND on i.MX27
@ 2009-07-14 14:00 Eric Benard
  2009-07-15  7:32 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Benard @ 2009-07-14 14:00 UTC (permalink / raw)
  To: linux-mtd; +Cc: linux-arm-kernel

This patch allows i.MX27 to support 2k pagesize NAND flash.
We are using a Micron 1.8V NAND flash : MT29F4G08ABDWP-ET
Without this patch, all sectors are marked as bad eraseblock.

Signed-off-by: Eric Benard <eric@eukrea.com>
Acked-by : Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/nand/mxc_nand.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 76beea4..65b26d5 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -857,6 +857,17 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 	}
 }
 
+/* Define some generic bad / good block scan pattern which are used
+ * while scanning a device for factory marked good / bad blocks. */
+static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
+
+static struct nand_bbt_descr smallpage_memorybased = {
+	.options = NAND_BBT_SCAN2NDPAGE,
+	.offs = 5,
+	.len = 1,
+	.pattern = scan_ff_pattern
+};
+
 static int __init mxcnd_probe(struct platform_device *pdev)
 {
 	struct nand_chip *this;
@@ -973,7 +984,10 @@ static int __init mxcnd_probe(struct platform_device *pdev)
 		goto escan;
 	}
 
-	host->pagesize_2k = (mtd->writesize == 2048) ? 1 : 0;
+	if (mtd->writesize == 2048) {
+		host->pagesize_2k = 1;
+		this->badblock_pattern = &smallpage_memorybased;
+	}
 
 	if (this->ecc.mode == NAND_ECC_HW) {
 		switch (mtd->oobsize) {
-- 
1.6.0.4

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

* Re: [PATCH 1/1] Fix 2k pagesize NAND on i.MX27
  2009-07-14 14:00 [PATCH 1/1] Fix 2k pagesize NAND on i.MX27 Eric Benard
@ 2009-07-15  7:32 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2009-07-15  7:32 UTC (permalink / raw)
  To: Eric Benard; +Cc: linux-mtd, linux-arm-kernel

Eric Benard wrote:
> This patch allows i.MX27 to support 2k pagesize NAND flash.
> We are using a Micron 1.8V NAND flash : MT29F4G08ABDWP-ET
> Without this patch, all sectors are marked as bad eraseblock.
> 
> Signed-off-by: Eric Benard <eric@eukrea.com>
> Acked-by : Sascha Hauer <s.hauer@pengutronix.de>

The previous version of your patch is sitting in l2-mtd-2.6.git
and waiting for dwmw2 already.

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

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

end of thread, other threads:[~2009-07-15  7:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 14:00 [PATCH 1/1] Fix 2k pagesize NAND on i.MX27 Eric Benard
2009-07-15  7:32 ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.