Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Sourav Poddar <sourav.poddar@ti.com>
To: yuhang wang <wangyuhang2014@gmail.com>
Cc: linux-mtd <linux-mtd-bounces@lists.infradead.org>,
	Johannes Stezenbach <js@sig21.net>,
	Grant Likely <grant.likely@secretlab.ca>,
	Mark Brown <broonie@kernel.org>,
	linux-mtd@lists.infradead.org, Thomas.Betker@rohde-schwarz.com,
	spi-devel-general@lists.sourceforge.net,
	linux-arm-kernel@lists.infradead.org
Subject: Re: SPI: DUAL/QUAD support
Date: Fri, 5 Jul 2013 14:25:15 +0530	[thread overview]
Message-ID: <51D689F3.3070605@ti.com> (raw)
In-Reply-To: <CAHSAbzNvMo_oeaqtzO8-xDm-L-f8wVccVqfuVqbR=OwqWJhVwg@mail.gmail.com>

On Friday 05 July 2013 02:18 PM, yuhang wang wrote:
>> To add to all the discussion going on,
>> I am using a qspi controller with a spansion flash device.
>> I tried using quad read mode bit, and what is required to change in
>> my case is the following:
>>
>> 1. enable quad mode in flash configuration register.
>> 2. change my read opcode to QUAD READ opcode according to flash datasheet.
>> 3. Configure my qspi controller cmd reg to use 6 PIN whenever quad mode is
>> used.
>>
> Sorry, to the third point I am still not very clear. The first time,
> spi controller should send
> QUAD READ opcode to your spansion flash with 1 line, then receive datas from
> flash with 4 lines. So how does your controller master this process
> automatically.
>
> Please give me some details.
>
Its like, you pass txbuf and rxbuf from the spi core to your controller
driver. So, if your txbuf is not null then configure the controller
cmd register with WRITE_SINGLE and if rxbuf is not null then
configure the controller cmd register with READ_QUAD.

Something like this,
                 if (txbuf) {
                         dra7xxx_writel_data(qspi, *txbuf++,
                                 QSPI_SPI_DATA_REG, wlen);
                         dra7xxx_writel(qspi, qspi->dc, QSPI_SPI_DC_REG);
                         dra7xxx_writel(qspi, qspi->cmd | QSPI_WR_SNGL,
                                         QSPI_SPI_CMD_REG);
                         wait_for_completion(&qspi->word_complete);
                 }
                 if (rxbuf) {
                         printk("rx cmd %08x dc %08x\n",
                                 qspi->cmd | QSPI_RD_QUAD, qspi->dc);
                         dra7xxx_writel(qspi, INT_EN, 
QSPI_INTR_ENABLE_SET_REG);
                         dra7xxx_writel(qspi, qspi->dc, QSPI_SPI_DC_REG);
                     if (!quad_mode)
                             dra7xxx_writel(qspi, qspi->cmd | QSPI_RD_SNGL,
                                             QSPI_SPI_CMD_REG);
                     else
                             dra7xxx_writel(qspi, qspi->cmd | QSPI_RD_QUAD,
                                             QSPI_SPI_CMD_REG);
                  .......
                 }
> Thanks

  reply	other threads:[~2013-07-05  8:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 11:36 SPI: DUAL/QUAD support yuhang wang
     [not found] ` <CAHSAbzPNDSr_6N79fh0DTWSEg8buRRPyiw8SPodtKLPjzWXJsg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-04 13:00   ` Johannes Stezenbach
     [not found]     ` <20130704130017.GA25997-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
2013-07-04 14:58       ` Thomas.Betker-Bf/A/FSCP0w3s4ca2cGeAgC/G2K4zDHf
2013-07-04 15:49         ` Mark Brown
     [not found]           ` <20130704154927.GE27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-04 16:04             ` Thomas.Betker-Bf/A/FSCP0w3s4ca2cGeAgC/G2K4zDHf
     [not found]               ` <OFAD729A05.8C915625-ONC1257B9E.00576B25-C1257B9E.0058477D-Bf/A/FSCP0w3s4ca2cGeAgC/G2K4zDHf@public.gmane.org>
2013-07-05  6:25                 ` yuhang wang
     [not found]                   ` <CAHSAbzOg+uHndydSC43moF7pijc67pqzB2rPnY69ynXHEzw79g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05  6:45                     ` Gupta, Pekon
     [not found]                       ` <20980858CB6D3A4BAE95CA194937D5E73E9E4C2E-yXqyApvAXouIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-07-05  7:35                         ` Johannes Stezenbach
     [not found]                           ` <20130705073550.GA24258-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
2013-07-05  7:41                             ` Sourav Poddar
2013-07-05  8:04                             ` Gupta, Pekon
2013-07-05  7:40                     ` Sourav Poddar
     [not found]                       ` <51D67851.8020402-l0cyMroinI0@public.gmane.org>
2013-07-05  8:48                         ` yuhang wang
2013-07-05  8:55                           ` Sourav Poddar [this message]
     [not found]                             ` <51D689F3.3070605-l0cyMroinI0@public.gmane.org>
2013-07-05  9:07                               ` yuhang wang
     [not found]                                 ` <CAHSAbzM1PGoMXFNOmB7guDsVWYnRoRy89-bufHYpPz5+odnd8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05  9:08                                   ` Sourav Poddar
     [not found]                                     ` <51D68D14.7090606-l0cyMroinI0@public.gmane.org>
2013-07-05  9:17                                       ` yuhang wang
     [not found]                                         ` <CAHSAbzMfvfdDtTh=3zeBni4fNMAHEMdTJLJU-Oc13HJUqCUj0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05  9:27                                           ` Sourav Poddar
     [not found]                                             ` <51D69197.7060802-l0cyMroinI0@public.gmane.org>
2013-07-05 10:24                                               ` yuhang wang
     [not found]                                                 ` <CAHSAbzP1-RVot+hhtY_DcBK=u5n2234eb9WOKLESwvUNax7+pA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05 14:34                                                   ` Johannes Stezenbach
     [not found]                                                     ` <20130705143452.GA7738-FF7aIK3TAVNeoWH0uzbU5w@public.gmane.org>
2013-07-05 15:41                                                       ` yuhang wang
2013-07-04 14:36 ` Mark Brown
     [not found]   ` <20130704143645.GA27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-04 18:06     ` Johannes Stezenbach
2013-07-04 19:12       ` Mark Brown
     [not found]         ` <20130704191216.GK27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-05  9:41           ` yuhang wang
2013-07-05 10:12             ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2013-07-04  7:07 SPI : " 王宇航
2013-07-04  9:00 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51D689F3.3070605@ti.com \
    --to=sourav.poddar@ti.com \
    --cc=Thomas.Betker@rohde-schwarz.com \
    --cc=broonie@kernel.org \
    --cc=grant.likely@secretlab.ca \
    --cc=js@sig21.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd-bounces@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=wangyuhang2014@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox