As a side effect of the raspberry pi work, I've produced an SD card
driver for the sheevaplug (and presumably other kirkwood platforms).
It's in two sections: the top layer does the card protocol and is
identical between rpi and kw (could go into /sys/src/9/port?), while
the lower layer does the host sdio interface.  The two layers link via
the usual table of functions, so if we encounter a platform with more
than one sd host interface [anybody seen one?] it won't be hard to
cope with.

Would anyone with a sheevaplug or similar, and a collection of SD
cards, like to try it out before I submit a patch?  Source is in
/n/sources/contrib/miller/9/kw, and if you haven't pulled kernel
sources recently you'll need to update /sys/src/9/port/sd.h as well.
The drive appears as '#S/sdM0', and a FAT-formatted SD card can be
mounted simply by doing "diskparts; dosmnt 1 /n/sd".  You can of
course hot-swap cards without rebooting, but don't forget to unmount
first.

Although the driver is called sdmmc.c, it handles only SD cards and
not the older MMC standard.  I think it's only a matter of slightly
different initialisation, but I haven't got an actual MMC card to
test it with.  If anyone cares enough to send me one, I'll see if
I can make that work too.


Reply via email to