All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Mallon <ryan-7Wk5F4Od5/oYd5yxfr4S2w@public.gmane.org>
To: Mika Westerberg <mika.westerberg-X3B1VOXEql0@public.gmane.org>
Cc: "spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org"
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Martin Guy <martinwguy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v4 1/2] spi: implemented driver for Cirrus EP93xx SPI controller
Date: Fri, 23 Apr 2010 09:29:23 +1200	[thread overview]
Message-ID: <4BD0BFB3.9060907@bluewatersys.com> (raw)
In-Reply-To: <20100422054519.GA26418-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>

Mika Westerberg wrote:
> On Wed, Apr 21, 2010 at 01:00:56PM -0500, H Hartley Sweeten wrote:
>> Same results are your v4 driver.  But, I think your on the right track.
> 
> Thanks for testing.
> 
>> I think the problem is in the ep93xx_spi_read_write routine.  That function
>> returns 0 as long as there is still data left in the current transfer.  The
>> only time it doesn't return 0, which will cause the can_continue, is when:
>>
>> 	if (espi->rx == t->len) {
>> 		msg->actual_length += t->len;
>> 		return t->len;
>> 	}
>>
>> At this point the tx and rx fifos will both be empty, which causes the SSP
>> peripheral to raise the SFRM signal.
> 
> True.
> 
>> A picture is worth a thousand words... Attached is a logic analyzer capture
>> of the Read-ID command and response from the SPI Flash.  EGPIO7 is my chip
>> select to the flash.  The first 4 SPI MOSI (Tx) blocks are the 0x90, 0x00,
>> 0x00, 0x00 command to the flash.  You will notice that the SFRM line is
>> asserted for those bytes.  A bit later are the 2 SPI MISO (Rx) responses
>> from the flash with the ManID/DevID, again with the SFRM line asserted.
> 
> Yeah, it clearly shows that SFRMOUT is deasserted between transfers :(
> 
> I will try to work out some sort of hack which will keep the FIFOs from
> emptying.
> 
> MW

I still have not found time to test this, but I think this is the
problem we had we resulted in us using polling mode rather than
interrupts. If the spi fifo empties then it will deassert the frame
signal. By using polling code we could ensure that the fifos would not
drain at the incorrect time. The other solution is to use an externally
drivable signal for the frame (such as a gpio), but this is obviously
not possible on some existing hardware.

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan-7Wk5F4Od5/oYd5yxfr4S2w@public.gmane.org         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

------------------------------------------------------------------------------

WARNING: multiple messages have this Message-ID (diff)
From: ryan@bluewatersys.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/2] spi: implemented driver for Cirrus EP93xx SPI controller
Date: Fri, 23 Apr 2010 09:29:23 +1200	[thread overview]
Message-ID: <4BD0BFB3.9060907@bluewatersys.com> (raw)
In-Reply-To: <20100422054519.GA26418@gw.healthdatacare.com>

Mika Westerberg wrote:
> On Wed, Apr 21, 2010 at 01:00:56PM -0500, H Hartley Sweeten wrote:
>> Same results are your v4 driver.  But, I think your on the right track.
> 
> Thanks for testing.
> 
>> I think the problem is in the ep93xx_spi_read_write routine.  That function
>> returns 0 as long as there is still data left in the current transfer.  The
>> only time it doesn't return 0, which will cause the can_continue, is when:
>>
>> 	if (espi->rx == t->len) {
>> 		msg->actual_length += t->len;
>> 		return t->len;
>> 	}
>>
>> At this point the tx and rx fifos will both be empty, which causes the SSP
>> peripheral to raise the SFRM signal.
> 
> True.
> 
>> A picture is worth a thousand words... Attached is a logic analyzer capture
>> of the Read-ID command and response from the SPI Flash.  EGPIO7 is my chip
>> select to the flash.  The first 4 SPI MOSI (Tx) blocks are the 0x90, 0x00,
>> 0x00, 0x00 command to the flash.  You will notice that the SFRM line is
>> asserted for those bytes.  A bit later are the 2 SPI MISO (Rx) responses
>> from the flash with the ManID/DevID, again with the SFRM line asserted.
> 
> Yeah, it clearly shows that SFRMOUT is deasserted between transfers :(
> 
> I will try to work out some sort of hack which will keep the FIFOs from
> emptying.
> 
> MW

I still have not found time to test this, but I think this is the
problem we had we resulted in us using polling mode rather than
interrupts. If the spi fifo empties then it will deassert the frame
signal. By using polling code we could ensure that the fifos would not
drain at the incorrect time. The other solution is to use an externally
drivable signal for the frame (such as a gpio), but this is obviously
not possible on some existing hardware.

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

  parent reply	other threads:[~2010-04-22 21:29 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 15:11 [PATCH v4 0/2] spi: driver for Cirrus EP93xx SPI controller Mika Westerberg
2010-04-20 15:11 ` Mika Westerberg
     [not found] ` <cover.1271774845.git.mika.westerberg-X3B1VOXEql0@public.gmane.org>
2010-04-20 15:11   ` [PATCH v4 1/2] spi: implemented " Mika Westerberg
2010-04-20 15:11     ` Mika Westerberg
     [not found]     ` <e96939d18bcbfb7a28ba4a925d7788884566db8c.1271774845.git.mika.westerberg-X3B1VOXEql0@public.gmane.org>
2010-04-20 17:24       ` H Hartley Sweeten
2010-04-20 17:24         ` H Hartley Sweeten
     [not found]         ` <0D753D10438DA54287A00B0270842697636D7F4E7F-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-21  7:16           ` Mika Westerberg
2010-04-21  7:16             ` Mika Westerberg
     [not found]             ` <20100421071629.GL19534-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-21 16:47               ` H Hartley Sweeten
2010-04-21 16:47                 ` H Hartley Sweeten
     [not found]                 ` <0D753D10438DA54287A00B0270842697636D8C84DA-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-21 16:54                   ` Mika Westerberg
2010-04-21 16:54                     ` Mika Westerberg
     [not found]                     ` <20100421165420.GP19534-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-22  2:47                       ` H Hartley Sweeten
2010-04-22  2:47                         ` H Hartley Sweeten
     [not found]                         ` <0D753D10438DA54287A00B0270842697636D8C8CDD-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-22  5:53                           ` Mika Westerberg
2010-04-22  5:53                             ` Mika Westerberg
2010-04-22 14:11                           ` Martin Guy
2010-04-22 14:11                             ` Martin Guy
2010-04-22 14:28                           ` Martin Guy
2010-04-22 14:28                             ` Martin Guy
     [not found]                             ` <x2g56d259a01004220728i7f07d492t4c4f63e0ef2e38d9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-22 17:39                               ` H Hartley Sweeten
2010-04-22 17:39                                 ` H Hartley Sweeten
     [not found]                                 ` <0D753D10438DA54287A00B0270842697636D940C95-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-22 20:19                                   ` Martin Guy
2010-04-22 20:19                                     ` Martin Guy
2010-04-20 22:16       ` H Hartley Sweeten
2010-04-20 22:16         ` H Hartley Sweeten
     [not found]         ` <0D753D10438DA54287A00B0270842697636D85BCCC-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-20 23:54           ` Martin Guy
2010-04-20 23:54             ` Martin Guy
     [not found]             ` <z2h56d259a01004201654y93f6c533j11b5accd7e2f46e7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-21  0:11               ` H Hartley Sweeten
2010-04-21  0:11                 ` H Hartley Sweeten
     [not found]                 ` <0D753D10438DA54287A00B0270842697636D85BDD8-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-21  0:43                   ` H Hartley Sweeten
2010-04-21  0:43                     ` [spi-devel-general] " H Hartley Sweeten
2010-04-21  1:10                   ` Martin Guy
2010-04-21  1:10                     ` Martin Guy
     [not found]                     ` <n2u56d259a01004201810j22c17bcfn9fee59e9c65c4d7f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-21  1:52                       ` H Hartley Sweeten
2010-04-21  1:52                         ` H Hartley Sweeten
     [not found]                         ` <0D753D10438DA54287A00B0270842697636D85BE26-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-21  7:00                           ` Mika Westerberg
2010-04-21  7:00                             ` Mika Westerberg
2010-04-21 10:46                           ` Mika Westerberg
2010-04-21 10:46                             ` Mika Westerberg
     [not found]                             ` <20100421104651.GO19534-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-21 18:00                               ` H Hartley Sweeten
2010-04-21 18:00                                 ` H Hartley Sweeten
     [not found]                                 ` <0D753D10438DA54287A00B0270842697636D8C8672-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-22  5:45                                   ` Mika Westerberg
2010-04-22  5:45                                     ` Mika Westerberg
     [not found]                                     ` <20100422054519.GA26418-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-22 21:29                                       ` Ryan Mallon [this message]
2010-04-22 21:29                                         ` Ryan Mallon
2010-04-22 17:55                                   ` Mika Westerberg
2010-04-22 17:55                                     ` Mika Westerberg
2010-04-22 20:43                                     ` H Hartley Sweeten
2010-04-22 20:43                                       ` H Hartley Sweeten
     [not found]                                       ` <0D753D10438DA54287A00B0270842697636D9410F0-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-23  5:20                                         ` Mika Westerberg
2010-04-23  5:20                                           ` Mika Westerberg
     [not found]                                           ` <20100423052003.GF26418-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-23 17:24                                             ` H Hartley Sweeten
2010-04-23 17:24                                               ` H Hartley Sweeten
     [not found]                                               ` <0D753D10438DA54287A00B0270842697636D9419BC-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-23 23:01                                                 ` H Hartley Sweeten
2010-04-23 23:01                                                   ` [spi-devel-general] " H Hartley Sweeten
     [not found]                                                   ` <0D753D10438DA54287A00B0270842697636D9B794A-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-25  9:29                                                     ` Martin Guy
2010-04-25  9:29                                                       ` [spi-devel-general] " Martin Guy
     [not found]                                                       ` <y2x56d259a01004250229he9cb2ee3pf69669c9226f80fb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-25  9:38                                                         ` Martin Guy
2010-04-25  9:38                                                           ` [spi-devel-general] " Martin Guy
     [not found]                                                           ` <m2l56d259a01004250238s99d6c869s1ee084b36f9736a0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-25 20:25                                                             ` H Hartley Sweeten
2010-04-25 20:25                                                               ` [spi-devel-general] " H Hartley Sweeten
     [not found]                                                               ` <0D753D10438DA54287A00B0270842697636D9B7E66-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-26 10:02                                                                 ` Mika Westerberg
2010-04-26 10:02                                                                   ` [spi-devel-general] " Mika Westerberg
     [not found]                                                                   ` <20100426100258.GG26418-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-26 16:54                                                                     ` H Hartley Sweeten
2010-04-26 16:54                                                                       ` [spi-devel-general] " H Hartley Sweeten
2010-04-26 10:09                                                                 ` Mika Westerberg
2010-04-26 10:09                                                                   ` [spi-devel-general] " Mika Westerberg
2010-04-26 14:35                                                                 ` Martin Guy
2010-04-26 14:35                                                                   ` [spi-devel-general] " Martin Guy
     [not found]                                                                   ` <k2l56d259a01004260735nb44e9dddy5b08668787070ac7-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-26 17:05                                                                     ` H Hartley Sweeten
2010-04-26 17:05                                                                       ` [spi-devel-general] " H Hartley Sweeten
2010-04-29 18:30                     ` Mika Westerberg
2010-04-21  6:37         ` Mika Westerberg
2010-04-21  6:37           ` Mika Westerberg
     [not found]           ` <20100421063712.GJ19534-WfG2TfFPcQ9S6P4I59wummXnswh1EIUO@public.gmane.org>
2010-04-21 17:08             ` H Hartley Sweeten
2010-04-21 17:08               ` H Hartley Sweeten
2010-04-24 18:14       ` Martin Guy
2010-04-24 18:14         ` Martin Guy
     [not found]         ` <p2h56d259a01004241114qb1b1815em9657e5a857a9d4ee-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-25 19:55           ` H Hartley Sweeten
2010-04-25 19:55             ` H Hartley Sweeten
     [not found]             ` <0D753D10438DA54287A00B0270842697636D9B7E4F-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2010-04-26 10:34               ` Mika Westerberg
2010-04-26 10:34                 ` Mika Westerberg
2010-04-26 12:58               ` Martin Guy
2010-04-26 12:58                 ` Martin Guy
2010-04-20 15:11   ` [PATCH v4 2/2] ep93xx: SPI driver platform support code Mika Westerberg
2010-04-20 15:11     ` Mika Westerberg
     [not found]     ` <509a89ad62001de9de23129b4c34148aef28ef19.1271774845.git.mika.westerberg-X3B1VOXEql0@public.gmane.org>
2010-04-20 16:35       ` H Hartley Sweeten
2010-04-20 16:35         ` H Hartley Sweeten

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=4BD0BFB3.9060907@bluewatersys.com \
    --to=ryan-7wk5f4od5/oyd5yxfr4s2w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=martinwguy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=mika.westerberg-X3B1VOXEql0@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.