* [QUERY] Behavior of spi slave memories w.r.t chip select signal.
@ 2011-05-11 4:07 viresh kumar
2011-05-11 7:17 ` Jamie Iles
[not found] ` <4DCA0B77.8060700-qxv4g6HH51o@public.gmane.org>
0 siblings, 2 replies; 7+ messages in thread
From: viresh kumar @ 2011-05-11 4:07 UTC (permalink / raw)
To: spi-devel-general
Cc: Dinesh Kumar SHARMA, linus.walleij@stericsson.com,
Armando VISCONTI, Shiraz HASHIM, Vikas MANOCHA,
linux-arm-kernel@lists.infradead.org
Hello,
Following is what i understood after reading m25p80 driver and spi master
drivers in drivers/spi folder.
"chip_select signal controls start and end of transfer. For ex: if we have to read
status reg of spi memory, then we use write_and_then_read() routine. which writes
0x9F in one spi transfer and writes dummy bytes and reads rx reg in other transfer.
And these two transfers are part of single spi_message.
Now, it is controllable to handle cs, and if we send cs_change == 0, then chip select
is activated at start of message and deactivated at end of message, instead at end
of every transfer.
Which means, even if there is a delay between command and dummy bytes received at
spi memory, current transfer will not be terminated by memory as cs is low."
Is this correct??
Actually i am seeing a different behavior by some of the spi memories, like m25p10.
If there is a delay between read_sts_reg command and dummy bytes, then 0xFFFFFF is
returned in response. If there is no delay then transfer always passes.
--
viresh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.
2011-05-11 4:07 [QUERY] Behavior of spi slave memories w.r.t chip select signal viresh kumar
@ 2011-05-11 7:17 ` Jamie Iles
2011-05-11 7:19 ` viresh kumar
[not found] ` <4DCA0B77.8060700-qxv4g6HH51o@public.gmane.org>
1 sibling, 1 reply; 7+ messages in thread
From: Jamie Iles @ 2011-05-11 7:17 UTC (permalink / raw)
To: viresh kumar
Cc: Dinesh Kumar SHARMA, linus.walleij@stericsson.com,
Armando VISCONTI, Shiraz HASHIM, spi-devel-general, Vikas MANOCHA,
linux-arm-kernel@lists.infradead.org
On Wed, May 11, 2011 at 09:37:19AM +0530, viresh kumar wrote:
> Following is what i understood after reading m25p80 driver and spi
> master drivers in drivers/spi folder.
>
> "chip_select signal controls start and end of transfer. For ex: if we have to read
> status reg of spi memory, then we use write_and_then_read() routine. which writes
> 0x9F in one spi transfer and writes dummy bytes and reads rx reg in other transfer.
> And these two transfers are part of single spi_message.
>
> Now, it is controllable to handle cs, and if we send cs_change == 0, then chip select
> is activated at start of message and deactivated at end of message, instead at end
> of every transfer.
>
> Which means, even if there is a delay between command and dummy bytes received at
> spi memory, current transfer will not be terminated by memory as cs is low."
>
> Is this correct??
>
> Actually i am seeing a different behavior by some of the spi memories, like m25p10.
> If there is a delay between read_sts_reg command and dummy bytes, then 0xFFFFFF is
> returned in response. If there is no delay then transfer always passes.
What SPI controller are you using? I've seen a similar issue with the
Synopsys DesignWare SPI controller where the controller manages the chip
select itself, and once the FIFO is emptied the CS goes away, but the
flash chip requires it to stay high for the whole transaction. In this
case the workaround is to use a GPIO as a chip select and there are
other controllers that do the same thing for the same reason (I think
that pxa2xx_spi is one of them).
Jamie
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.
2011-05-11 7:17 ` Jamie Iles
@ 2011-05-11 7:19 ` viresh kumar
0 siblings, 0 replies; 7+ messages in thread
From: viresh kumar @ 2011-05-11 7:19 UTC (permalink / raw)
To: Jamie Iles
Cc: Dinesh Kumar SHARMA, Linus WALLEIJ, Armando VISCONTI,
Shiraz HASHIM, spi-devel-general@lists.sourceforge.net,
Vikas MANOCHA, linux-arm-kernel@lists.infradead.org
On 05/11/2011 12:47 PM, Jamie Iles wrote:
> What SPI controller are you using? I've seen a similar issue with the
> Synopsys DesignWare SPI controller where the controller manages the chip
> select itself, and once the FIFO is emptied the CS goes away, but the
> flash chip requires it to stay high for the whole transaction. In this
> case the workaround is to use a GPIO as a chip select and there are
> other controllers that do the same thing for the same reason (I think
> that pxa2xx_spi is one of them).
I am using amba pl022 controller and using external gpio's to control
chip select signal. cs is kept low for entire message, but still i am facing
this issue.
--
viresh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.
[not found] ` <4DCA0B77.8060700-qxv4g6HH51o@public.gmane.org>
@ 2011-05-13 3:52 ` viresh kumar
[not found] ` <4DCCAB19.2020302-qxv4g6HH51o@public.gmane.org>
2011-05-13 9:04 ` Jamie Iles
0 siblings, 2 replies; 7+ messages in thread
From: viresh kumar @ 2011-05-13 3:52 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org
Cc: Dinesh Kumar SHARMA, Armando VISCONTI, Shiraz HASHIM, Jamie Iles,
Vikas MANOCHA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
On 05/11/2011 09:37 AM, viresh kumar wrote:
>
> Hello,
>
> Following is what i understood after reading m25p80 driver and spi master
> drivers in drivers/spi folder.
>
> "chip_select signal controls start and end of transfer. For ex: if we have to read
> status reg of spi memory, then we use write_and_then_read() routine. which writes
> 0x9F in one spi transfer and writes dummy bytes and reads rx reg in other transfer.
> And these two transfers are part of single spi_message.
>
> Now, it is controllable to handle cs, and if we send cs_change == 0, then chip select
> is activated at start of message and deactivated at end of message, instead at end
> of every transfer.
>
> Which means, even if there is a delay between command and dummy bytes received at
> spi memory, current transfer will not be terminated by memory as cs is low."
>
> Is this correct??
>
> Actually i am seeing a different behavior by some of the spi memories, like m25p10.
> If there is a delay between read_sts_reg command and dummy bytes, then 0xFFFFFF is
> returned in response. If there is no delay then transfer always passes.
>
Linus, Jamie,
Have you ever seen this kind of issue? Which spi slave memories did you used for testing?
I am using standard pl0022 and m25p80 driver. Tried in all modes: polling, interrupt, dma.
--
viresh
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.
[not found] ` <4DCCAB19.2020302-qxv4g6HH51o@public.gmane.org>
@ 2011-05-13 6:54 ` Linus Walleij
[not found] ` <BANLkTik2OxGdQ7z1JBAsE+=gc5UCgx3wEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2011-05-13 6:54 UTC (permalink / raw)
To: viresh kumar
Cc: Dinesh Kumar SHARMA, martin.bergstrom-0IS4wlFg1OjSUeElwK9/Pw,
Armando VISCONTI, Marcus COOPER, Shiraz HASHIM, Jamie Iles,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Vikas MANOCHA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
2011/5/13 viresh kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>:
> On 05/11/2011 09:37 AM, viresh kumar wrote:
>>
>> Hello,
>>
>> Following is what i understood after reading m25p80 driver and spi master
>> drivers in drivers/spi folder.
>>
>> "chip_select signal controls start and end of transfer. For ex: if we have to read
>> status reg of spi memory, then we use write_and_then_read() routine. which writes
>> 0x9F in one spi transfer and writes dummy bytes and reads rx reg in other transfer.
>> And these two transfers are part of single spi_message.
>>
>> Now, it is controllable to handle cs, and if we send cs_change == 0, then chip select
>> is activated at start of message and deactivated at end of message, instead at end
>> of every transfer.
>>
>> Which means, even if there is a delay between command and dummy bytes received at
>> spi memory, current transfer will not be terminated by memory as cs is low."
>>
>> Is this correct??
>>
>> Actually i am seeing a different behavior by some of the spi memories, like m25p10.
>> If there is a delay between read_sts_reg command and dummy bytes, then 0xFFFFFF is
>> returned in response. If there is no delay then transfer always passes.
>>
>
> Linus, Jamie,
>
> Have you ever seen this kind of issue? Which spi slave memories did you used for testing?
> I am using standard pl0022 and m25p80 driver. Tried in all modes: polling, interrupt, dma.
Not really. I'll throw in a few people on CC and see if they have some hints.
Linus Walleij
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.
2011-05-13 3:52 ` viresh kumar
[not found] ` <4DCCAB19.2020302-qxv4g6HH51o@public.gmane.org>
@ 2011-05-13 9:04 ` Jamie Iles
1 sibling, 0 replies; 7+ messages in thread
From: Jamie Iles @ 2011-05-13 9:04 UTC (permalink / raw)
To: viresh kumar
Cc: Dinesh Kumar SHARMA, linus.walleij@stericsson.com,
Armando VISCONTI, Shiraz HASHIM, Jamie Iles, spi-devel-general,
Vikas MANOCHA, linux-arm-kernel@lists.infradead.org
On Fri, May 13, 2011 at 09:22:57AM +0530, viresh kumar wrote:
> On 05/11/2011 09:37 AM, viresh kumar wrote:
> > Actually i am seeing a different behavior by some of the spi
> > memories, like m25p10.
> > If there is a delay between read_sts_reg command and dummy bytes, then 0xFFFFFF is
> > returned in response. If there is no delay then transfer always passes.
> >
>
> Linus, Jamie,
>
> Have you ever seen this kind of issue? Which spi slave memories did you used for testing?
> I am using standard pl0022 and m25p80 driver. Tried in all modes: polling, interrupt, dma.
No, not that exact issue. I've seen with the Synopsys DesignWare
controller that the fifo emptying causing cs to drop can result in all
0's being read back from a m25p80, but not all 1's.
Jamie
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [QUERY] Behavior of spi slave memories w.r.t chip select signal.
[not found] ` <BANLkTik2OxGdQ7z1JBAsE+=gc5UCgx3wEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-05-13 9:20 ` viresh kumar
0 siblings, 0 replies; 7+ messages in thread
From: viresh kumar @ 2011-05-13 9:20 UTC (permalink / raw)
To: Linus Walleij, Jamie Iles
Cc: Dinesh Kumar SHARMA, Martin BERGSTROM, Armando VISCONTI,
Marcus COOPER, Shiraz HASHIM,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Vikas MANOCHA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
On 05/13/2011 12:24 PM, Linus Walleij wrote:
> 2011/5/13 viresh kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>:
>> Linus, Jamie,
>>
>> Have you ever seen this kind of issue? Which spi slave memories did you used for testing?
>> I am using standard pl0022 and m25p80 driver. Tried in all modes: polling, interrupt, dma.
>
> Not really. I'll throw in a few people on CC and see if they have some hints.
>
Thanks guys.
Issue is solved now, data must be latched on Rising Edge and i have passed phase as falling edge.
--
viresh
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-05-13 9:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 4:07 [QUERY] Behavior of spi slave memories w.r.t chip select signal viresh kumar
2011-05-11 7:17 ` Jamie Iles
2011-05-11 7:19 ` viresh kumar
[not found] ` <4DCA0B77.8060700-qxv4g6HH51o@public.gmane.org>
2011-05-13 3:52 ` viresh kumar
[not found] ` <4DCCAB19.2020302-qxv4g6HH51o@public.gmane.org>
2011-05-13 6:54 ` Linus Walleij
[not found] ` <BANLkTik2OxGdQ7z1JBAsE+=gc5UCgx3wEA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-13 9:20 ` viresh kumar
2011-05-13 9:04 ` Jamie Iles
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).