Virtex SPI Driver

Robert S. Grimes rsg at alum.mit.edu
Tue May 6 18:19:57 UTC 2008


Hi Thomas, et. al.

Well, I've got an implementation of the low-level SPI driver for Virtex 
working, and am wondering what I should do with it wrt the RTEMS tree.  
I've based it on RTEMS-4.8.0 tarball, with the newer libi2c code from 
trunk several months ago.  Because I am not proficient in the autoXXX 
tools, I could not build it as part of the BSP, so on the advice of 
others, I simply included it in my application library.  So some work 
would be needed to make it part of the Virtex BSP...

However, this brings up another issue that is peculiar to this type of 
BSP; while my hardware is different from the Xilinx ml403 board you 
used, the issue is the same.  These boards consist of a very 
configurable FPGA, combined with specific support components.  While the 
latter characteristic is equivalent to most boards (i.e. the hardware 
present drives what the BSP supports), the reconfigurability of the 
FPGA, along with the expansion headers, allow any specific instance to 
contain a very varied mix of peripherals.  For example, one of my 
processors will use two serial ports and three SPI controllers, while 
the other two only have a single serial port and two SPI controllers 
each.  I don't want to have multiple BSPs hanging around for myself, and 
I certainly would not want to require users of the Virtex BSP to have an 
SPI controller if they don't want it.

In getting around this issue for myself, I've changed the signature that 
you used for registering the SPI bus; here is what I've come up with:

    rtems_status_code spiRegisterBus(
        char* busName,                       // Name for this bus
        virtex_spi_desc_t* busDesc,          // SPI descriptor for this bus
        int numDevices,                      // Number of devices on 
this SPI bus
        virtex_spi_device_desc_t* devices);  // List of devices on this 
SPI bus

Now, this function could well be called by the BSP proper, if a board 
was to always have a specific SPI bus and set of devices.  But this 
function can also be called by the application, which is what I'm doing; 
this allows the BSP (and my common libraries) to support my several 
applications.

What should I do to submit this code?  I can't solve the build system 
work that needs to be done, due to lack of knowledge and time...

Take care,
-Bob





More information about the users mailing list