How to get the internal SD card working

From ThinkWiki
Revision as of 08:35, 5 December 2006 by Ro (Talk | contribs) (How to get the card reader working on Ubuntu)
Jump to: navigation, search

1. First of it all you need a working kernel 2.6 source.

2. Get the patches at http://mmc.drzeus.cx/wiki/Linux/Drivers/sdhci all the *.bin. Note that with kernel versions >= 2.6.17-rc1, the driver is included in the kernel, and patching is unnecessary.

3. Patch your kernel

 cd /usr/src/linux
 patch -p1 < sdhci-0001.bin
 patch -p1 < pci-sdhc-0001.bin
 patch -p1 < mmc-respopcode-0001.bin

4. reconfigure your kernel with menuconfig

 make menuconfig

5. activate "Device Drivers" -> "MMC/SD Card support"

 <*> MMC support
 <*>   MMC block device driver
 <M>   Secure Digital Host Controller Interface support  (EXPERIMENTAL)

6. recompile your kernel & reboot

 make clean && make && make modules_install.. dont forget to copy your new kernel. ;)

7. Modprobe your new kernel module:

 modprobe sdhci

8. Mount your SD card

 mount /dev/mmcblk0p1 /mnt

9. RocknRoll


Ubuntu 6.10 'edgy eft':

To get the card reader working on edgy:

Add the module 'tifm_sd' to /etc/modules and restart. Now this module gets loaded on sys bootup and a card is detected when inserted. The card reader is found as /dev/mmcblk0 and mounted automatically on card insert.

Step-by-step:

1. Make a backup of your 'modules' in case something goes wrong:

 sudo cp /etc/modules /etc/modules.backup

2. Open the file with gedit:

 sudo gedit /etc/modules

3. Add the following entry to the end of the file:

 tifm_sd

4. Save and close the file. On the next boot, the sd-card reader works.

As mentioned below, this is already reported as a bug: BUG #53268


Update for FC5 running the newest 2.6.17 kernel:

1. modprobe mmc_block

2. modprobe sdhci

3. mount /dev/mmcblk0p1 /mnt

4. RocknRoll

Tested on my X41 with 04:00.1 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 13)

Automated module loading

I'm using ASPLinux release 11 (Seliger) based on FC4 and kernel 2.6.17-1.2142asp.

  • 1. Created the script /etc/sysconfig/modules/sd.modules to load modules on boot. Don't foget to chmod it 775.
#!/bin/sh

start () {
        for i in mmc_core mmc_block sdhci; do
                modprobe $i >/dev/null 2>&1
        done
}

stop () {
        for i in sdhci mmc_block mmc_core; do
                rmmod $i >/dev/null 2>&1
        done
}

restart() {
        stop
        start
}

case $1 in
        start)
                start
        ;;
        stop)
                stop
        ;;
        restart)
                echo -n "Reloading SD modules"
                restart
                echo ".. DONE"
        ;;
        *)
        start
esac
  • 2. This script will run after reboot. When you insert card the automount system in the KDE or Gnome will catch the medium on the fly. But I found that the medium should be inserted at boot time because of latter BUG :-(. That's why my script is longer then it has to be...

BUG Currently the bug exists in the automounting SD card. SD card is mounted properly when the card is inserted at boot time (or at time when modules is loaded). Otherwise it is not get mounted (BUG #53268). The temporary workaround is to remove && insert again modules while the medium is in the reader (/etc/sysconfig/modules/sd.modules restart). Note that you have to be root to perform this.

Tested on my Z60t with 14:00.2 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 17)