2nd mmc/SD card via SPI on bone

I’d like to make use of a second SD card attached to my Beagle Bone via SPI. What drivers/kernel modules exist for doing so? where may I start looking for such? I’d really like to be able to read and write the card with any filesystem available to linux.

Eric

The MMC1 interface from the am3359 is available on the P8 connector
(according to the Bone A5 SRM), you can even use all 8 bits in pin-mux
mode #2 using P8-11 through P8-22 (ignoring GPMC_WAIT1 in the middle of
those). You should be able to simply hook up there. It'll probably be
faster than a SPI connected device.

You'll need the power, ground, CMD, CLK, and 4 or 8 data lines from MMC1
(SD only uses up to 4 data lines, MMC can use all 8). Just make sure to
double check the P8 pinout with the schematic and the am335x data sheet
if you're going to produce a cape (to be sure you get it right, there's
sometimes typos in manuals).

Would that work for you?

SD cards also sometimes support a SPI mode, where they communicate via a
SPI bus using the SD card pins differently than usual, but I assume this
isn't what you're asking about...

-Andrew

Actually that’s exactly what I’m asking about. I realize that MMC1 is available and might even be a better way in most cases to attach a MMC/SD card. That however is not the point. I have a board with a mmc card slot onboard that is interfaced via spi. I’d like to use the onboard card slot that’s attached via spi. How?

Eric

Ah, sorry.

You might take a look at the CONFIG_MMC_SPI option in the kernel.
Within the Linux kernel source, drivers/mmc/host/mmc_spi.c is the driver.

Some info on configuring this for a Blackfin can be found [1].
You'll most likely need platform data, similar to the Blackfin setup,
but set for your SPI bus and for OMAP (sorry, I don't have a better
example, yet). I don't believe the stock Bone kernel has these enabled
(but please someone correct me if I'm wrong).

[1]:
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:spi_mmc

-Andrew