[U-Boot] [PATCH] mtd: nand: mxs: Add support for multiple NAND chips

Scott Wood scottwood at freescale.com
Mon Dec 8 23:53:02 CET 2014


On Sun, 2014-12-07 at 06:26 +0100, Marek Vasut wrote:
> On Sunday, December 07, 2014 at 02:50:25 AM, Scott Wood wrote:
> > On Sun, 2014-12-07 at 02:32 +0100, Marek Vasut wrote:
> > > On Sunday, December 07, 2014 at 12:45:30 AM, Scott Wood wrote:
> > > > On Sat, 2014-12-06 at 14:07 +0100, Marek Vasut wrote:
> > > > > On Tuesday, December 02, 2014 at 02:26:14 PM, Stefan Roese wrote:
> > > > > > This patch adds support for multiple NAND chips connected to the
> > > > > > i.MX6. Linux already supports this configuration. So lets port
> > > > > > the missing features to the U-Boot driver to support more than
> > > > > > one NAND chip here as well.
> > > > > > 
> > > > > > The necessary changes in detail are:
> > > > > > 
> > > > > > - Only use DMA channel 0 for all NAND chips:
> > > > > >   Linux: a7c12d01 (mtd: gpmi: use DMA channel 0 for all the
> > > > > >   
> > > > > >                    nand chips)
> > > > > >          
> > > > > >          d159d8b7 (mtd: gpmi: decouple the chip select from
> > > > > >          
> > > > > >                    the DMA channel)
> > > > > > 
> > > > > > - On i.MX6 only use ready/busy pin for CS0:
> > > > > >   Linux: 7caa4fd2 (mtd: gpmi: imx6: fix the wrong method for
> > > > > >   
> > > > > >                    checking ready/busy)
> > > > > > 
> > > > > > To enable this feature the board needs to configure
> > > > > > CONFIG_SYS_NAND_MAX_CHIPS to 2 (or more).
> > > > > > 
> > > > > > With these changes I'm able to detect and acces 2 NAND chips:
> > > > > > 
> > > > > > => nand device
> > > > > > 
> > > > > > Device 0: 2x nand0, sector size 128 KiB
> > > > > > 
> > > > > >   Page size      2048 b
> > > > > >   OOB size         64 b
> > > > > >   Erase size   131072 b
> > > > > 
> > > > > Shouldn't you see "Device 0" and "Device 1" ?
> > > > 
> > > > The "2x" indicates that there are two identical chips being treated as
> > > > a single device (chip->numchips).
> > > 
> > > Is that correct ? What if I have two different NAND chips on this
> > > controller?
> > 
> > Then they need to be represented as separate NAND devices, rather than
> > multiple chips on one device.
> 
> Gee, I wouldn't have though of that, really ;-)

Well, you asked a vague question...

> So is this patch correct or not ?

In all its details?  I don't know, as I'm not familiar with the
hardware.  With regards to the question about non-identical devices,
this patch doesn't add support for that.  So it's a question of what the
requirements are, and whether it's being used in the right
circumstances.  If you have non-identical NAND chips, make sure
CONFIG_SYS_NAND_MAX_CHIPS is 1.

A better question might be, does this approach make sense, versus
implementing support for multiple devices?  What does Linux support?

-Scott




More information about the U-Boot mailing list