Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1297380 > unrolled thread

[RFC] spi: dw: support setting tmode dynamically

Started byJisheng Zhang <jszhang@marvell.com>
First post2015-12-23 12:30 +0100
Last post2015-12-23 13:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RFC] spi: dw: support setting tmode dynamically Jisheng Zhang <jszhang@marvell.com> - 2015-12-23 12:30 +0100
    Re: [RFC] spi: dw: support setting tmode dynamically Mark Brown <broonie@kernel.org> - 2015-12-23 13:20 +0100
      Re: [RFC] spi: dw: support setting tmode dynamically Jisheng Zhang <jszhang@marvell.com> - 2015-12-23 13:40 +0100

#1297380 — [RFC] spi: dw: support setting tmode dynamically

FromJisheng Zhang <jszhang@marvell.com>
Date2015-12-23 12:30 +0100
Subject[RFC] spi: dw: support setting tmode dynamically
Message-ID<qIPMe-vw-23@gated-at.bofh.it>
Hi all,

Currently the spi-dw tmode is fixed to SPI_TMOD_TR if cs_control is NULL, but we
need to set it as SPI_TMOD_EPROMREAD to read nor flash, my solution is to add and
export one functions to set the tmode, then the nor flash driver call it
before reading and set back to SPI_TMOD_TR after done.

Is there any elegant solution from SPI framework? Any suggestions are appreciated!

Thanks,
Jisheng
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1297410

FromMark Brown <broonie@kernel.org>
Date2015-12-23 13:20 +0100
Message-ID<qIQyC-11R-21@gated-at.bofh.it>
In reply to#1297380

[Multipart message — attachments visible in raw view] — view raw

On Wed, Dec 23, 2015 at 07:23:38PM +0800, Jisheng Zhang wrote:

> Currently the spi-dw tmode is fixed to SPI_TMOD_TR if cs_control is NULL, but we
> need to set it as SPI_TMOD_EPROMREAD to read nor flash, my solution is to add and
> export one functions to set the tmode, then the nor flash driver call it
> before reading and set back to SPI_TMOD_TR after done.

What does this mean - what is TMOD and why do we need to set it to read
NOR flash?  I've no information on this controller...

[toc] | [prev] | [next] | [standalone]


#1297430

FromJisheng Zhang <jszhang@marvell.com>
Date2015-12-23 13:40 +0100
Message-ID<qIQRY-18q-31@gated-at.bofh.it>
In reply to#1297410
Dear Mark,

On Wed, 23 Dec 2015 12:15:12 +0000 Mark Brown wrote:

> On Wed, Dec 23, 2015 at 07:23:38PM +0800, Jisheng Zhang wrote:
> 
> > Currently the spi-dw tmode is fixed to SPI_TMOD_TR if cs_control is NULL, but we
> > need to set it as SPI_TMOD_EPROMREAD to read nor flash, my solution is to add and
> > export one functions to set the tmode, then the nor flash driver call it
> > before reading and set back to SPI_TMOD_TR after done.  
> 
> What does this mean - what is TMOD and why do we need to set it to read
> NOR flash?  I've no information on this controller...

TMOD is one field of DW_SPI_CTRL0. Its available value could be:

0: Transmit and Receive

1: Transmit only

2: Receive only

3: EEPROM Read

If the one spi nor flash is connected to the SPI host, so far I can only succeed
to read the nor flash content after setting the TMOD field as 3.

Thanks,
Jisheng
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web