Point to sample SPI for MMC card driver?

Gene Smith gds at chartertn.net
Wed Oct 15 19:49:05 UTC 2008

Robert S. Grimes wrote:
> Gene Smith wrote:
>> I noticed that Robert S. Grimes seems to have finished his SPI
>> driver and he started with something in vertex BSP. The threads he
>> started have a lot of good information in them. Also, the
>> README_libi2c is probably the best and most thorough I have seen in
> Yes, README_libi2c is very thorough; there were several times that,
> upon re-reading it, I understood things even better...
>> I am looking for some code to use as a starting point for writing
>> my SPI driver, which does not correspond to any existing BSP. I see
>> that often the SPI driver is divided between libcpu and libbsp.
> Yes - the reasons being explained in earlier posting by Thomas
> Doerfler and, of course, the README_libi2c.
>> However, I probably would want to put all the low level stuff in
>> just my libbsp if possible. I found something under
>> libbsp/m68k/gen68360/spi that appears to be the complete driver(s)
>> (files m360_spi.c and mc68360_spidrv.c). Would these be OK to use
>> as a template? Or should I look somewhere else for a better
>> example?
> Sorry, can't help you here, but you do want to be fairly current.
> The libi2c SPI support has matured somewhat since I started (around
> 4.8), and if you want to use the spi-sd-card driver, you'll need to
> make sure you're based on at least 4.9 libi2c.  In particular, you'll
> want to support the idle_char field of the transfer parameters
> structure rtems_libi2c_tfr_mode_t.  See my latest posts regarding
> "Card Specific Data".
> FWIW - I started with the powerpc/mpc5566evb SPI driver, as Sebastian
>  suggested - I think you know the thread...

Yes sd-card-init.c (in libbsp) and dspi.c (in libcpu) go together, right?

However, I don't see where mpc55xx_sd_card_init() is called. Would this 
be called from the "predriver_hook" referred to in the readme?

Thanks for the offer to answer my questions. (You will regret it :))  -gene

> Take care, -Bob
> P.S. Feel free to ask questions - it's still pretty fresh in my
> mind...
>> Thanks, -gene

More information about the users mailing list