SPI low level driver for Virtex

Robert S. Grimes rsg at alum.mit.edu
Fri Feb 22 16:27:57 UTC 2008


Hi Thomas,

How was the skiing?!

So, I'm working on the SPI driver, but I have some questions about 
building it.  My approach is presented below.

 From earlier, Thomas Doerfler wrote:
> Hi Robert,
>
>   
> 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.
>
>   
Okay, I'm starting by grabbing the updated libi2c, which probably is 
straightforward enough.

Then, I copied the "read" driver from libcpu/mpc83xx/spi and 
libbsp/powerpc/gen83xx into libbsp/powerpc/virtex/spi.  Next I will 
adapt these files for the Virtex 4 chip. This shouldn't be too hard, 
what with an RTEMS driver example and the Xilinx programming example to 
work from.

I'm almost certainly going to need help with the automake stuff.  Should 
I just diff before and after your SPI additions, and try to recreate?

And I'm not sure what I will need to do to build the thing.  Will I just 
type make, or do I need to run configure first?  (I have previously 
specified --enable-maintainer-mode, if that helps).  If I do have to 
configure, can (and how can) I run it just on the libbsp/powerpc/virtex 
tree?
> 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.
>   
I'm going to adapt the same approach here - copy, rename, and edit.  I'm 
not sure (again) how I get it built - another reconfig?

Thanks,
-Bob



More information about the users mailing list