LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
Cc: linux-kernel@vger.kernel.org, mikael.starvik@axis.com,
	spi-devel-general@lists.sourceforge.net
Subject: Re: 2/5: Updates to SPI and mmc_spi: clock with cs inactive, kernel 2.6.19
Date: Fri, 26 Jan 2007 15:31:10 -0800	[thread overview]
Message-ID: <200701261531.11141.david-b@pacbell.net> (raw)
In-Reply-To: <200701261521.l0QFLjlv003816@ignucius.se.axis.com>

On Friday 26 January 2007 7:21 am, Hans-Peter Nilsson wrote:
> > From: David Brownell <david-b@pacbell.net>

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


  reply	other threads:[~2007-01-27  0:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25  4:50 Hans-Peter Nilsson
2007-01-25 13:05 ` David Brownell
2007-01-26 15:21   ` Hans-Peter Nilsson
2007-01-26 23:31     ` David Brownell [this message]
2007-01-26  1:28 ` David Brownell
2007-01-26 16:01   ` [PATCH] take 2: mmc_spi update, 2.6.19 Hans-Peter Nilsson

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=200701261531.11141.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=hans-peter.nilsson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikael.starvik@axis.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    --subject='Re: 2/5: Updates to SPI and mmc_spi: clock with cs inactive, kernel 2.6.19' \
    /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

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