Re: 2/5: Updates to SPI and mmc_spi: clock with cs inactive, kernel 2.6.19

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 26 January 2007 7:21 am, Hans-Peter Nilsson wrote:
> > From: David Brownell <[email protected]>

> > Just so we don't lose count here:  this is the *third* example of
> > an SPI protocol tweaking option that seems to be needed just to
> > support an MMC-over-SPI stack:
> > 
> >  - Claiming the SPI bus so that chipselect can stay high even
> >    between spi_message interactions (although you seemed not to
> >    run into that one);
> 
> You mentioned this is the reason for the spi_get_exclusive-patch
> you sent privately (thanks).  I hadn't seen that, and from my
> reading of the standard I read "bus transaction" (their wording
> for what's between cs deactivation) as a single byte or at least
> send and reply part of a command as separate "bus transactions".
> Yeah, there's only one SPI device on my bus.  To simulate other
> devices on the bus, chatting along when the SD/MMC SPI device
> has chip-select inactive, I experimented with sending "random"
> stuff while in the chip-select function like so:
> 
> ...
> 
> ... and *now* I see it. ;-) No card works.  Hm.  Modulo bugs in
> the above, I agree you need that claim-stuff if there's more
> than one device.  Still, I guess that's actually a rare
> configuration.

The issue is generic.  It shows up with JTAG (which you can
view as an application of SPI) as well as various other tools
I've seen.  As for rare ... hard to say.  I don't design boards,
and the ones where I look at SPI support have real MMC hardware
so they don't need mmc-over-spi.


> >  - Efficiency in the routine "poll for status" operation, where
> >    data must be read over MISO (CS high) until 0xff bytes stop;
> 
> That's for read.  For write, it's until the 0x0 bytes stop.  But
> this is a performance feature, not critical for basic function.

Right.

 
> >  - This issue, where a deselected device must be clocked.
> 
> I retract this patch and suggestion, given your later
> suggestion.  (Not worthwhile as a feature.)

OK, fine.  Temporary toggling of chipselect polarity ... that
doesn't _quite_ feel like a hack!

 
> > There's no "chip select" feature in the API.  It's only part of
> > the protocol described by messages delivered to the controller
> > driver.  Don't confuse the "bitbang" framework (which works with
> > more than just bitbanged hardware, of course) with the API; it's
> > just an implementation aid, and not one that all implementors
> > would choose to use.
> 
> Let me rephrase: some controllers (yes, they are using the
> bitbang framework but that's beside the point) do not deactivate
> chip-select; they may not have that signal programmable.

I think those controllers are best viewed as not talking SPI.

Or alternatively, as being so bare-bones that they expect to
have chipselects managed outside the controller.  (Which is not
a bad approach after all.)

- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux