public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Andrei Andreyanau <a.andreyanau@sam-solutions.com>
To: "Gupta, Pekon" <pekon@ti.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: Incorrect detection of Micron MT29F32G08
Date: Fri, 20 Sep 2013 13:47:23 +0300	[thread overview]
Message-ID: <523C27BB.5050900@sam-solutions.com> (raw)
In-Reply-To: <20980858CB6D3A4BAE95CA194937D5E73EA13155@DBDE04.ent.ti.com>

Hi, Pekon
17.09.2013 15:30, Gupta, Pekon пишет:
>> Hi, I've faced a problem with the Micron NAND MT29F32G08, which is 4GiBs, 8K blocks per LUN, 224b OOB, 512K erase size, has two planes 4k blocks each. In the kernel (I use v3.0.35) it is detected
>> as 2GiB device. Only when I disable part of the code which belongs to ONFI detection, add definition for this device in nand_ids.c (device has id=0x48), add 224b OOB table, I can see that it's a
>> 4GiBs device, but when I'm trying formatting the largest partition (I have 4 partitions - barebox, env, kernel, rootfs <- the largest) - it drops an I/O error about bad blocks (I did scan and mark
>> all bad blocks before)... It seems to me that the amount of pages per lun is not detected correctly which leads to incorrect detection of device's size etc. Bad thing is that the datasheet for a/m
>> NAND doesn't contain what are the values from NAND-device registers mean (or I missed something). Could you please suggest where to dig? 
> You can try printing values of following towards end of nand_scan_tail() in drivers/mtd/nand/nand_base.c - mtd->writesize - mtd->erasesize - mtd->oobsize 
Here it is what the kernel givewithout any modifications (I mean - with ONFI-support enabled):
...
ONFI flash detected
ONFI param page 0 valid
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x48 (Micron MT29F32G08AFACAWP)
=============nand_scan_tail=============
- writesize=4096
- erasesize=524288
- oobsize=224
gpmi-nand imx6q-gpmi-nand.0: enable asynchronous EDO mode 5
Bad block table not found for chip 0
Creating 4 MTD partitions on "gpmi-nand":
0x000000000000-0x000000200000 : "bootloader"
0x000000200000-0x000000600000 : "env"
0x000000600000-0x000000e00000 : "kernel"
0x000000e00000-0x000080000000 : "filesystem"
GPMI NAND driver registered. (IMX)

mtd_debug output (for "filesystem"):
$mtd_debug info /dev/mtd5
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_WRITEABLE
mtd.size = 2132803584 (1G)
mtd.erasesize = 524288 (512K)
mtd.writesize = 4096 (4K)
mtd.oobsize = 224
regions = 0

What I get when I disable ONFI detection:
GPIO NAND driver, © 2004 Simtec Electronics
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x48 (Micron NAND 4GiB 3,3V 8-bit)
=============nand_scan_tail=============
- writesize=4096
- erasesize=524288
- oobsize=224
Bad block table not found for chip 0
Creating 4 MTD partitions on "gpmi-nand":
0x000000000000-0x000000200000 : "bootloader"
0x000000200000-0x000000600000 : "env"
0x000000600000-0x000000e00000 : "kernel"
0x000000e00000-0x000100000000 : "filesystem"
GPMI NAND driver registered. (IMX)

mtd_debug output (for "filesystem"):
$mtd_debug info /dev/mtd5
mtd.type = MTD_NANDFLASH
mtd.flags = MTD_WRITEABLE
mtd.size = 4280287232 (3G)
mtd.erasesize = 524288 (512K)
mtd.writesize = 4096 (4K)
mtd.oobsize = 224
regions = 0

What do you think?

Thanks in advance,
Andrei

  reply	other threads:[~2013-09-20 10:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17  7:02 Incorrect detection of Micron MT29F32G08 Andrei Andreyanau
2013-09-17 12:30 ` Gupta, Pekon
2013-09-20 10:47   ` Andrei Andreyanau [this message]
2013-09-20 11:23     ` Gupta, Pekon
2013-09-20 11:46       ` Andrei Andreyanau
2013-09-20 13:24         ` Gupta, Pekon

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=523C27BB.5050900@sam-solutions.com \
    --to=a.andreyanau@sam-solutions.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pekon@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox