support DUAL and QUAD[patch v1]

Gupta, Pekon pekon at ti.com
Mon Jul 22 08:55:53 EDT 2013


Hi Shijie,
> 
> Hello Huang,
> 
> Huang Shijie wrote on 2013-07-22:
> > 于 2013年07月22日 17:56, Gupta, Pekon 写道:
> >> (b) struct spi_transfer: if each transfer of same message need to be
> >> transferred at different width. 	Example: Command @ Single-SPI
> >>   followed by Data @ Quad-SPI
> > I am coding the QuadSpi driver for Freescale's Vybrid now.
> >
> > I think we dot need to change the spi code. the spi layer should not
> > know the different width of the command and the data, let the qspi
> > driver does it.
> NO!
> >
> > In the m25p_probe(), after we knows that the qspi driver and flash
> > support the Quad read, so we can set the
> > m25p->read_opcode to 0xeb or 0xec. In the qspi driver, it can do the
> > real job.
> No, the qspi driver (as example here) should provide a transparent interface
> only,
> and the mp25p80 driver, which knows the details of the flash, has to provide
> the information
> which parts of a transfer has to be done in single-/dual- or quad-mode.
> Otherwise you always need to extend the qspi driver for new flashes.
> 
A QSPI interface can be connected to external-Flash and to Camera also.

- A camera interface may only require static config of Quad-mode.

- A Flash may require dynamic switching between Single-SPI or Quad-SPI
based on type of message, like Flash erase command need to be sent 
only Single-SPI mode, where as Read/Write Data can be done on
Quad-SPI mode to increase throughput. Here only the flash driver would 
know, which commands to send on Single-SPI and which on Quad-SPI. 

Thus, its better that channel-width information is passed by upper layer
driver along with spi_message, so that QSPI-controller driver can
dynamically switch between the modes.
This also keeps QSPI driver generic irrespective of devices connected to it.


with regards, pekon


More information about the linux-mtd mailing list