All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: Gabriel Tisan <gabriel.tisan@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: nand_imx 4k support ?
Date: Mon, 2 Apr 2012 11:08:57 +0200	[thread overview]
Message-ID: <20120402110857.1fceff5a@eb-e6520> (raw)
In-Reply-To: <CAD9ZU8D0a8BRAtAN8_9Hz_75Lek=N_i_F+jjXvfR1gxMsPNZ3A@mail.gmail.com>

Le Mon, 2 Apr 2012 11:03:06 +0200,
Gabriel Tisan <gabriel.tisan@gmail.com> a écrit :

> Yes, Baruch I meant write support, especially ECC layout for 4K flashes.
> 
> Actually the 4k flashes could have 128 or 218 bytes OOB.
> 
> Could you point me to some docs about this layout ? I use a flash with
> 218 bytes spare.
> 
here is a (dirty) patch which force the NFC configuration :

diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index 85cfbed..182a7ff 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -805,7 +812,7 @@ static void preset_v3(struct mtd_info *mtd)
 		config2 |= NFC_V3_CONFIG2_PS_2048;
 		config2 |= NFC_V3_CONFIG2_NUM_ADDR_PHASE1(addr_phases);
 	} else if (mtd->writesize == 4096) {
-		config2 |= NFC_V3_CONFIG2_PS_4096;
+		config2 |= NFC_V3_CONFIG2_PS_4096 | 1;
 		config2 |= NFC_V3_CONFIG2_NUM_ADDR_PHASE1(addr_phases);
 	} else {
 		config2 |= NFC_V3_CONFIG2_PS_512;
@@ -817,13 +824,14 @@ static void preset_v3(struct mtd_info *mtd)
 			config2 |= NFC_V3_MX51_CONFIG2_PPB(
 					ffs(mtd->erasesize /
mtd->writesize) - 6); else
-			config2 |= NFC_V3_MX53_CONFIG2_PPB(
-					ffs(mtd->erasesize /
mtd->writesize) - 6);
+			config2 |= 0x200; /*NFC_V3_MX53_CONFIG2_PPB(
+					ffs(mtd->erasesize /
mtd->writesize) - 6);*/ host->eccsize = get_eccsize(mtd);
-		if (host->eccsize == 8)
+//		if (host->eccsize == 8)
 			config2 |= NFC_V3_CONFIG2_ECC_MODE_8;
 	}
-
+	printf("config2 : %x\n", config2);
+	config2 = 0x706da17A;
 	writel(config2, NFC_V3_CONFIG2);
 
 	config3 = NFC_V3_CONFIG3_NUM_OF_DEVICES(0) |
@@ -835,6 +843,8 @@ static void preset_v3(struct mtd_info *mtd)
 	if (!(chip->options & NAND_BUSWIDTH_16))
 		config3 |= NFC_V3_CONFIG3_FW8;
 
+	printf("config3 : %x\n", config3);
+	config3= 0x1a8608;
 	writel(config3, NFC_V3_CONFIG3);
 
 	writel(0, NFC_V3_DELAY_LINE);
@@ -1064,7 +1074,7 @@ static int __init imxnd_probe(struct device_d
*dev) host->main_area0 = host->base;
 		host->regs = host->base + 0xe00;
 		host->spare0 = host->base + 0x800;
-		host->spare_len = 16;
+		host->spare_len = 64;
 		oob_smallpage = &nandv1_hw_eccoob_smallpage;
 		oob_largepage = &nandv1_hw_eccoob_largepage;
 	} else if (nfc_is_v3_2()) {

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-04-02  9:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01  9:58 nand_imx 4k support ? Gabriel Tisan
2012-04-01 10:49 ` Baruch Siach
2012-04-01 12:45   ` Eric Bénard
2012-04-01 12:52     ` Baruch Siach
2012-04-01 13:05       ` Eric Bénard
2012-04-02  9:03         ` Gabriel Tisan
2012-04-02  9:08           ` Eric Bénard [this message]
2012-04-02 11:30           ` Baruch Siach
2012-04-02 11:39             ` Gabriel Tisan
2012-04-02 11:47               ` Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120402110857.1fceff5a@eb-e6520 \
    --to=eric@eukrea.com \
    --cc=barebox@lists.infradead.org \
    --cc=gabriel.tisan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.