[U-Boot] Add spi nand support in u-boot

Peter Pan 潘栋 (peterpandong) peterpandong at micron.com
Wed May 20 09:53:56 CEST 2015


On 30 April 2015 at 17:09, Jagan Teki wrote:
> On 30 April 2015 at 12:16, Peter Pan 潘栋 (peterpandong)
> <peterpandong at micron.com> wrote:
> > Hi All,
> >
> >
> >
> > I’d like to add spi nand support in u-boot. But I don’t know where
> should
> >
> > the spi nand drivers put in and how to define the architecture.
> >
> >
> >
> > I find that currently spi_flash in u-boot means spi nor flash. Should
> I
> > create
> >
> > a struct spi_nand_flash or make spi_flash compatible?
> 
> Honestly, the current spi flash code which deals with nor devices are
> has some issue
> like spi-nor specific logic is part of spi-bus like the situation was
> Linux is in before "spi-nor"
> 
> We're working on the spi-nor[1] front, hopefully by next release we
> might have some progress
> on that, I recommend you to start spi-nand as you're trying for Linux.
> I would help you at any point
> as I'm going to work on this spi-nor.
> 
> [1] http://git.denx.de/?p=u-boot/u-boot-
> spi.git;a=shortlog;h=refs/heads/spi-nor
>

I looked through your code. It is really great to port Linux new spi nor
framework in u-boot.

I'm working on spi-nand in u-boot now. And I find some issues. Maybe we
can have a discussion.
  1. Currently spi_flash struct is tied with spi nor, as spi nand is also
     a kind of spi flash. I think we should make spi_flash struct shareable.
  2. In Linux, we can use parameter .tx_nbits and .rx_nbits in spi_transfer
     struct to tell controller driver to use 1bit, 2bits or 4bits to transfer
     data. But I didn't find a way to do it in u-boot. Maybe we can add some
     transfer flags to do this.
  3. Should we use spi nand via "sf" command set or create another command set?

Any suggestion is appreciated.

Thanks
Peter Pan


More information about the U-Boot mailing list