From: Stephen Street <stephen@streetfiresound.com>
To: Mike Lee <eemike@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFC] simple SPI controller on PXA2xx SSP port, refresh
Date: Tue, 01 Nov 2005 10:35:31 -0800 [thread overview]
Message-ID: <1130870131.10324.51.camel@localhost.localdomain> (raw)
In-Reply-To: <1ffb4b070510291125j1fad2362xe40843f7719c611d@mail.gmail.com>
On Sun, 2005-10-30 at 02:25 +0800, Mike Lee wrote:
> Thanks for your info. I am working hard with that.
>
Sorry for delayed response.
I'm assuming the you board is configured with the PXA as a SPI master
and the chip you are talking to is the slave (part number of the slave
chip would be helpful). Which SSP port are you trying to use?
> What in my mind is that SPI clk is only triggered by master and master
> read/write at the same time. But how could master know the read data
> is valid?
The master determines when the data is valid by asserting the slave chip
select.
> is it determine by the protocol driver?
Yes, but setup by the board init code.
> In a case, when
> master place a tx-only msg to the controller driver, and slave request
> to send in the middle of the transaction. The data from slave will
> push into the rx buffer of the tx-only msg and finally ignore by the
> protocol driver......
I do not believe this can happen when the PXA is in master mode and the
chip is a slave.
> I really get confused to this "full" duplex
> transmittion. Could anyone tell me the real situation?
>
The PXA SPI master setup only generates a spi data clock when there is
data in the tx fifo thus to read you must write first even if you only
send zeros. The SSP port can be setup to use a free running clock but
this leads to coordination problems with the chip select and is a
limited use when the PXA is the SPI master. To make this work you will
need to allow the SSP to manage the chip select, see the PXA
documentation.
I would strongly recommend attaching a logic analyzer to the SSP port
you are trying to get working.
>
> Also, in your pxa_spi driver, you always read before write in the
> interrupt handler. If rx and tx is pointing to the same buffer,
> reading data will always overwrite the tx data. why not write before
> read?
See above. Must write to read.
>
> I am new to SPI , and with this loose bus structure i could not find a
> good reference for me to study deeper. Do you have any reference
> source?
I never found any documentation on the net, usually the data-sheet for
the chip you are talking to specifies the SPI requirements (master,
slave, clocks, chip selects, etc). Can you send me a link to the chip?
-Stephen
next prev parent reply other threads:[~2005-11-01 18:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-25 23:48 [PATCH/RFC] simple SPI controller on PXA2xx SSP port, refresh stephen
2005-10-27 11:33 ` Mike Lee
2005-10-27 16:41 ` Stephen Street
2005-10-29 18:25 ` Mike Lee
2005-11-01 18:35 ` Stephen Street [this message]
2005-11-03 9:37 ` Mike Lee
2005-11-04 18:11 ` Stephen Street
2005-11-04 20:36 ` Mark Underwood
2005-11-07 20:43 ` Mark Underwood
-- strict thread matches above, loose matches on Subject: below --
2005-11-04 0:15 David Brownell
2005-11-04 18:52 ` Stephen Street
2005-11-04 20:16 ` David Brownell
2005-11-04 23:38 ` Stephen Street
2005-11-05 0:54 ` David Brownell
2005-11-05 2:28 ` Stephen Street
2005-11-05 20:58 ` David Brownell
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=1130870131.10324.51.camel@localhost.localdomain \
--to=stephen@streetfiresound.com \
--cc=eemike@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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