Patchwork mtd/nand: Add NAND chip ID to support Micron 4k pagesize NAND chip

login
register
mail settings
Submitter Shengzhou Liu
Date Nov. 23, 2011, 2:59 a.m.
Message ID <1322017153-6783-1-git-send-email-Shengzhou.Liu@freescale.com>
Download mbox | patch
Permalink /patch/127207/
State New
Headers show

Comments

Shengzhou Liu - Nov. 23, 2011, 2:59 a.m.
Add NAND chip ID 0x38 in ids table to support Micron 4k large-page NAND chip.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 drivers/mtd/nand/nand_ids.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Brian Norris - Nov. 23, 2011, 5:23 p.m.
Hi,

On Tue, Nov 22, 2011 at 6:59 PM, Shengzhou Liu
<Shengzhou.Liu@freescale.com> wrote:
> Add NAND chip ID 0x38 in ids table to support Micron 4k large-page NAND chip.

Do you have an example part number for which this patch is necessary?
I see that Micron MT29F8G08ABABA, for instance, has this ID, but
listing its ID in nand_ids.c is useless because there is no ID
decoding pattern for the rest of its ID string. AFAIK, all 0x38 chips
are ONFI-only and should not be included in nand_ids.c.

Brian
Jean-Sébastien Gagnon - Nov. 23, 2011, 5:40 p.m.
If we really want to add a line for the Micron MT29F8G08ABABA, 
The line should be like this, since we cannot detect the layout:

+	{"NAND 1GiB 3,3V 8-bit",	0x38, 4096, 1024, 0x80000, LP_OPTIONS | NAND_NO_SUBPAGE_WRITE},

But like Brian said, ONFI should be used, otherwise, any newer device with the same ID (0x38) will
Probably be detected with wrong settings.

Also note that this device must be used with at least 4 ECC bits/512 bytes.

J-S

> 
> Hi,
>
> On Tue, Nov 22, 2011 at 6:59 PM, Shengzhou Liu
> <Shengzhou.Liu@freescale.com> wrote:
> > Add NAND chip ID 0x38 in ids table to support Micron 4k large-page NAND chip.
>
> Do you have an example part number for which this patch is necessary?
> I see that Micron MT29F8G08ABABA, for instance, has this ID, but
> listing its ID in nand_ids.c is useless because there is no ID
> decoding pattern for the rest of its ID string. AFAIK, all 0x38 chips
> are ONFI-only and should not be included in nand_ids.c.
>
> Brian
Brian Norris - Nov. 23, 2011, 5:51 p.m.
2011/11/23 Jean-Sébastien Gagnon <jsgagnon@vizimax.com>:
> If we really want to add a line for the Micron MT29F8G08ABABA,
> The line should be like this, since we cannot detect the layout:
>
> +       {"NAND 1GiB 3,3V 8-bit",        0x38, 4096, 1024, 0x80000, LP_OPTIONS | NAND_NO_SUBPAGE_WRITE},

This would give the wrong OOB-size, though, since this hard-coding
mechanism assumes that:
    mtd->oobsize = mtd->writesize / 32;
Thus, we get oobsize = 128 instead of oobsize = 224.

> But like Brian said, ONFI should be used, otherwise, any newer device with the same ID (0x38) will
> Probably be detected with wrong settings.

None exist that I know of for now but valid point.

Brian

Patch

diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index 00cf1b0..23ed1d2 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -106,6 +106,7 @@  struct nand_flash_dev nand_flash_ids[] = {
 	/* 8 Gigabit */
 	{"NAND 1GiB 1,8V 8-bit",	0xA3, 0, 1024, 0, LP_OPTIONS},
 	{"NAND 1GiB 3,3V 8-bit",	0xD3, 0, 1024, 0, LP_OPTIONS},
+	{"NAND 1GiB 3,3V 8-bit",	0x38, 0, 1024, 0, LP_OPTIONS},
 	{"NAND 1GiB 1,8V 16-bit",	0xB3, 0, 1024, 0, LP_OPTIONS16},
 	{"NAND 1GiB 3,3V 16-bit",	0xC3, 0, 1024, 0, LP_OPTIONS16},