SPI low level driver for Virtex

Thomas Doerfler Thomas.Doerfler at embedded-brains.de
Sat Feb 2 09:38:02 UTC 2008


Hi Robert,

Robert S. Grimes schrieb:
> Hi Thomas,
> 
> How have you been?  Hope all is well, and the New Year hasn't lost all 
> of its glow - yet!

Actally the new year has started almost as hectically as the last has 
ended, but now I see a golw at the end of the tunnel and its is really 
near :-) (no it is not a Truck heading for me...)

We had really nice chrismas holidays anyway. And we are just packing for 
a week in Austria for skiing.
> 
> It's finally about time I get going on the SPI driver for the Virtex4.  
> I've poked around a little bit, and I think I have a rough idea of what 
> needs to be done.  Here is my understanding.
> 
> Low-level Driver - This belongs in the BSP.  It seems you've implemented 
> one in rtems/c/src/lib/libbsp/powerpc/gen83xx/spi recently.  I assume a 
> good strategy for me is to copy that and customize it for the V4 - is 
> that right?

Actually the mpc83xx driver is split into two parts (or three):
- One is formed by the extended libi2c, it now supports also SPI devies.
- Then we have the "real" driver in libcpu/mpc83xx/spi, which does the 
actual data transfers and has most of the interfaces needed.
- And finally, since most SPI implementations need dedicated GPIO-lines 
to select the addressed hardware device, we need a small board specific 
layer. This (and the encapsulated initialization) is in 
libbsp/powerpc/gen83xx.

I gues the last two pieces could be integrated into one for the virtex. 
If somebody wants to use the SPI with different GPIO lines to select the 
devies, the BSP should get some conditional compilation stuff.

> 
> High-level Driver - It looks to me that the possibility of using a chip 
> select (CS) to frame an multi-byte "transaction" (as is required for 
> some devices, such as Ramtron FRAM devices) is not implemented.  Is that 
> true?

It is, see above (libbsp/powerpc/gen83xx/spi)

> 
> Usage.  Okay, here's my inexperience really shining clear!  How do I 
> actually use this in an application?  Do you have, or can you point me 
> towards, an example?

You won't use it directly. Look into the libi2c documentation to get a 
glimpse. And then there is at least on driver in 
rtems/c/src/libchip/i2c/spi-flash-m25p40.c, which implements an EEPROM 
driver on top of libi2c on top of spidrv.

The BSP then needs to initialize the SPI driver (e.g. calling 
bsp_register_spi() in gen83xx/spi/spi_init.c) and the (EEPROM) drivers 
based on it.

The EEPROM driver has more or less a standard rtems driver API.

wkr,
Thomas.


> 
> Thanks, and take care,
> -Bob
> 
> 
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users


-- 
--------------------------------------------
Embedded Brains GmbH
Thomas Doerfler           Obere Lagerstr. 30
D-82178 Puchheim          Germany
email: Thomas.Doerfler at embedded-brains.de
Phone: +49-89-18908079-2
Fax:   +49-89-18908079-9



More information about the users mailing list