I am working on a Blackfin 537 project running uClinux.  The BF537 has a 
built-in hardware SPI port with up to seven slave select outputs, of which I 
can use four or five (the others aren't available because they share I/O pins 
with something else I need more).  I have 10 SPI devices I need to control.  
I am looking for advice about the best way to access more SPI devices (the 
way that will fit the best with how the Linux SPI driver works).  I can think 
of 
four options:

        #1:  Chain multiple SPI devices together like shift registers using the 
               same slave select.
        #2:  Use GPIO lines as additional slave select outputs.
        #3:  Use software and GPIO lines to make an additional bit-banged 
               SPI interface for the slow devices.
        #4:  Demultiplex the existing slave select outputs.

Option #1 is straightforward enough, but makes it difficult to write 
independent 
drivers if the chained devices serve different logical functions.  I suppose it 
would be possible to make separate drivers for each device, then make them 
connect to a virtual SPI port that would combine the data for the different 
devices into a longer data string and send it out to the chain of devices.  
Does 
Linux already have such a virtual SPI port?

Option #2:  It is easy enough to turn on a GPIO-based slave select before 
causing an SPI transfer, but how can I tell when the transfer has finished and 
it is safe to turn it off?  Is there a hook in the SPI driver for that?

Option #3:  If I bit-bang GPIO lines to control not only the slave selects (as 
with option #2) but also the SPI data and clock signals, it will be easy to 
control the sequence of events, but will be a lot slower than using the 
hardware-assisted SPI interface.  Does Linux already have code for a 
bit-banged SPI interface?  Where would I find docs for it?

Option #4:  I don't know if it is practical on the Blackfin or not.  What I 
have 
in mind is something like the way the 68HC16's queued SPI provides four 
programmable slave selects that can be used individually to select one of 
four devices, or demultiplexed to select one of up to 16 peripheral devices.  
Does the Linux SPI driver provide a way to specify that a combination of 
slave selects needs to be asserted to select a particular slave?

Thanks for any suggestions or advice.

Steve



---
Steve Strobel
Link Communications, Inc.
1035 Cerise Rd
Billings, MT 59101-7378
(406) 245-5002 ext 102
(406) 245-4889 (fax)
WWW: http://www.link-comm.com
MailTo:[EMAIL PROTECTED]

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to