All of lore.kernel.org
 help / color / mirror / Atom feed
From: Blair Barnett <bbarnett@nethra.us.com>
To: "Paulraj, Sandeep" <s-paulraj@ti.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: ONFI 4GB and beyond NAND support
Date: Fri, 05 Mar 2010 12:07:31 -0800	[thread overview]
Message-ID: <4B916483.9040900@nethra.us.com> (raw)
In-Reply-To: <0554BEF07D437848AF01B9C9B5F0BC5D9C10DBEB@dlee01.ent.ti.com>

Paulraj, Sandeep wrote:
>   
>> I have two questions for the MTD gang, but couldn't find the answer in
>> the archives, nor elsewhere on the web.
>>
>> 1. What's the plan, if any, for the MTD NAND layer to support the ONFI
>> standard?
>>     
> I guess somebody has to write the necessary code and send the patch.
> ONFI NANds get all the necessary info from a param table I believe. 
>   
O.K. That's fair.
>   
>> 2. What's the plan, if any, for the MTD NAND layer to support 4 GB NANDs
>> (and greater)?
>>     
> This is already there for more than a year. Use the latest kernels
>   
Let's see. I'm using 2.6.33, so that seems like a pretty new kernel. I 
think the problem may in the code for figuring out the NAND geometry in 
nand_get_flash_type(). If type->pagesize == 0,  0x46 is the extid value. 
Unfortunately, this decodes in the NAND code to the following geometry:

Writesize = 4096 bytes
oobsize= 128 bytes
erasesize = 64 K bytes (extid & 0x03)

Reading the chip's ONFI Page parameters, one gets this geometry:

writesize = 4096 bytes
oobsize = 224 bytes
erasesize = 1024 K bytes

It appears a simple fix for the erasesize is to use 0x7 as the mask, but 
the oobsize is a little more problematic.

The code
mtd->oobsize = (8 << (extid & 0x01)) * (mtd->writesize >> 9);

doesn't really work to create a 224 byte oobsize value, not to mention I 
don't know where to look to create the ECC structure required.

Do you have a preference for how to fix this?

-blair

  reply	other threads:[~2010-03-05 20:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05  3:34 ONFI 4GB and beyond NAND support Blair Barnett
2010-03-05 15:24 ` Paulraj, Sandeep
2010-03-05 20:07   ` Blair Barnett [this message]
2010-03-05 20:17     ` Paulraj, Sandeep
2010-03-05 21:32       ` Blair Barnett

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=4B916483.9040900@nethra.us.com \
    --to=bbarnett@nethra.us.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=s-paulraj@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 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.