linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PXA270 SPI + SD card
@ 2009-11-04 21:53 Cliff Brake
       [not found] ` <f96d234e0911041353o25aeee4aqbb482f162aaeac5f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Cliff Brake @ 2009-11-04 21:53 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hello,

I'm trying to get a PXA270 to talk to a SD card via SPI.  Has anyone
else done this?

One of the requirements is the CS stay low for the entire transaction.
 Can this be done with the PXA270 controlling the frame (CS) signal,
or is GPIO control typically required?

Any pointers welcome.

Thanks,
Cliff

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PXA270 SPI + SD card
       [not found] ` <f96d234e0911041353o25aeee4aqbb482f162aaeac5f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-11-04 21:54   ` Cliff Brake
       [not found]     ` <f96d234e0911041354p1f11e415g427ec9b74ff4d25b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Cliff Brake @ 2009-11-04 21:54 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Wed, Nov 4, 2009 at 4:53 PM, Cliff Brake <cliff.brake-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello,
>
> I'm trying to get a PXA270 to talk to a SD card via SPI.  Has anyone
> else done this?
>
> One of the requirements is the CS stay low for the entire transaction.
>  Can this be done with the PXA270 controlling the frame (CS) signal,
> or is GPIO control typically required?

Also, what SPI mode is typically used for SD?  Looks like 0 and 3 are
the closest (http://elm-chan.org/docs/spi_e.html).

Thanks,
Cliff

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PXA270 SPI + SD card
       [not found]     ` <f96d234e0911041354p1f11e415g427ec9b74ff4d25b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-11-04 23:27       ` Ned Forrester
  2009-11-05  6:17       ` Baruch Siach
  1 sibling, 0 replies; 4+ messages in thread
From: Ned Forrester @ 2009-11-04 23:27 UTC (permalink / raw)
  To: Cliff Brake; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On 11/04/2009 04:54 PM, Cliff Brake wrote:
> On Wed, Nov 4, 2009 at 4:53 PM, Cliff Brake <cliff.brake-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hello,
>>
>> I'm trying to get a PXA270 to talk to a SD card via SPI.  Has anyone
>> else done this?

I haven't used an SD card, but...

>> One of the requirements is the CS stay low for the entire transaction.
>>  Can this be done with the PXA270 controlling the frame (CS) signal,
>> or is GPIO control typically required?

A GPIO is typically used.  The PXA2xx processors lack a
multi-chip-select function for SPI devices, so one has to use a GPIO if
more than one device is on the bus.  Back in 2.6.20, there was a
cs_control() call back to allow the pxa2xx_spi.c driver to control a
separately allocated GPIO line.  I think there is now a more generalized
procedure in the kernel to specify the GPIO that is to be used for each
device on the bus.

> Also, what SPI mode is typically used for SD?  Looks like 0 and 3 are
> the closest (http://elm-chan.org/docs/spi_e.html).

Not sure on that one.  I think there was a lot of discussion about that
a couple of years ago when someone was getting SD cards to work.  You
might want to search the archives if no one answers you directly.

-- 
Ned Forrester                                       nforrester-/d+BM93fTQY@public.gmane.org
Oceanographic Systems Lab                                  508-289-2226
Applied Ocean Physics and Engineering Dept.
Woods Hole Oceanographic Institution          Woods Hole, MA 02543, USA
http://www.whoi.edu/
http://www.whoi.edu/sbl/liteSite.do?litesiteid=7212
http://www.whoi.edu/hpb/Site.do?id=1532
http://www.whoi.edu/page.do?pid=10079


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PXA270 SPI + SD card
       [not found]     ` <f96d234e0911041354p1f11e415g427ec9b74ff4d25b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2009-11-04 23:27       ` Ned Forrester
@ 2009-11-05  6:17       ` Baruch Siach
  1 sibling, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2009-11-05  6:17 UTC (permalink / raw)
  To: Cliff Brake; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi Cliff,

On Wed, Nov 04, 2009 at 04:54:18PM -0500, Cliff Brake wrote:
> Also, what SPI mode is typically used for SD?  Looks like 0 and 3 are
> the closest (http://elm-chan.org/docs/spi_e.html).

I've found this in drivers/mmc/host/mmc_spi.c:mmc_spi_probe():

        /* MMC and SD specs only seem to care that sampling is on the
         * rising edge ... meaning SPI modes 0 or 3.  So either SPI mode
         * should be legit.  We'll use mode 0 since the steady state is 0,
         * which is appropriate for hotplugging, unless the platform data
         * specify mode 3 (if hardware is not compatible to mode 0).
         */
        if (spi->mode != SPI_MODE_3)
                spi->mode = SPI_MODE_0;

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-05  6:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-04 21:53 PXA270 SPI + SD card Cliff Brake
     [not found] ` <f96d234e0911041353o25aeee4aqbb482f162aaeac5f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-04 21:54   ` Cliff Brake
     [not found]     ` <f96d234e0911041354p1f11e415g427ec9b74ff4d25b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-04 23:27       ` Ned Forrester
2009-11-05  6:17       ` Baruch Siach

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).