How to distinguish MLC and SLC NANDs?

Brian Norris computersforpeace at gmail.com
Thu Sep 15 09:39:11 EDT 2011


On Thu, Sep 15, 2011 at 7:33 AM, Juergen Beisert <jbe at pengutronix.de> wrote:
> Is there a unique pattern for MLC
> or SLC in the mtd structure available after calling nand_scan_ident() to
> select what correction sum type should be used for the attached NAND?

Actually, there isn't anything available in struct mtd_info. This
belongs in struct nand_chip, actually, since it's a NAND-specific
feature. In fact, there is some data available there. As you can see
in nand_get_flash_type() in nand_base.c, we fill in the
`chip->cellinfo' field, then later use a mask on it like this:

chip->cellinfo & NAND_CI_CELLTYPE_MSK

According to the data sheets for *most* NAND parts, this is a safe way
of determining SLC vs. MLC (non-zero => MLC; zero => SLC), and we use
it for certain detection code paths. Note that if the chip uses ONFI,
you supply your own ID table, or the chip uses some of the older ID
codes, nand_base.c won't set chip->cellinfo for you; but it will
default to SLC I think, which is the correct option for old parts.

But it's up to you to determine your own reliance on this method. I
don't know of any users who rely on `chip->cellinfo &
NAND_CI_CELLTYPE_MSK' for this type of information.

Brian



More information about the linux-mtd mailing list