SD and MMC card readers

From Gentoo-en
Jump to: navigation, search

Basic Setup

Kernel Setup

This is the basic setup for all devices:

Linux Kernel Configuration: At least a 2.6.17 kernel
Device Drivers  --->
    <*> MMC/SD/SDIO card support  --->
        -*- MMC/SD card support
        <*>   MMC block device driver
        [*]     Use bounce buffer for simple hosts

Choose also one of the available drivers:


The sdricoh_cs driver is designed to make function Ricoh Secure Digital and MMC Card Readers that announce themselves as Ricoh Bay1Controller pcmcia device. You need a working PC Card setup for this driver. To install the driver all you need to do is:

emerge -av sdricoh_cs


Linux Kernel Configuration:
Device Drivers  --->
    <*> MMC/SD card support  --->
        <*>   Secure Digital Host Controller Interface support



Linux Kernel Configuration:
Device Drivers  --->
    [*] Misc devices  --->
        <*>   TI Flash Media interface support
        <*>     TI Flash Media PCI74xx/PCI76xx host adapter support
    <*> MMC/SD card support  --->
        <*>   TI Flash Media MMC/SD Interface support

tifm: sdhci method

If your notebook uses a TI card reader, the tifm_7xx1 and tifm_core drivers still don't work (as of kernel version 2.6.22) [My TI 5-in-1 Reader (PCIxx12 SD Host Controller) now works using the tifm_ modules under kernel 2.6.24]. There is an SDHCI mode that can be enabled that works with the sdhci driver; this works OK. To enable it, use lspci to get the address of the controller (it should show up as something like "Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller"), blacklist the tifm_* kernel modules, make sure the mmc_block kernel module gets loaded, and use setpci to put the controller in SDHCI mode:

File: /etc/modprobe.d/blacklist
File: /etc/conf.d/local.start
 setpci -s 02:09.3 4c.b=02 # change the address to match your system

If the driver loads but you get no device try to compile it directly into the kernel. NOT as a module. -- For me it works if I load mmc_core & mmc_block manually in that order.

On some cardreaders, udev reports the device as not removable, thus causing hal to ignore the device. A workaround is to create a new udev-rule and mount the device manually:

File: /etc/udev/rules.d/10-mmc.rules
 # Mount and remove mmc partitions manually
 ACTION=="add" KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/usr/bin/pmount %k"
 ACTION=="remove" KERNEL=="mmcblk[0-9]p[0-9]", RUN+="/usr/bin/pumount %k"


Linux Kernel Configuration:
Device Drivers  --->
    <*> MMC/SD card support  --->
        <*>   Winbond W83L51xD SD/MMC Card Interface support
Fix me:

Check Setup

After rebooting and inserting a SD card you should have a device file like:


And a partition on it:


Software Setup

For mounting devices, see guide.

Multi USB Card Readers

If you have an n-in-1 card reader that can deal with multiple cards, you usually have to make sure that “Probe all LUNs on each SCSI device” (CONFIG_SCSI_MULTI_LUN) is enabled in your kernel. It is under Device Drivers -> SCSI device support -> Probe all LUNs on each SCSI device If this isn't compiled in, you can add this line to your /etc/modules.conf:

options scsi_mod max_scsi_luns=8

Or, for a more temporary solution, run this command:

echo 8 > /sys/module/scsi_mod/parameters/max_luns