Harish Srinivas bio photo

Harish Srinivas

“Autodidact with an insatiable thirst for learning something new everyday. Wearer of many hats. DevOp Engineer/Release Engineer, Security Engineer, Linux fanatic, Amateur photographer, Maker & Novice App developer.”

Email

I recently switched from fedora core 6 to Ubuntu and over the past few weeks have had no problems with the installation except with the SD slot. I found a link on the Ubuntu forum that has a small script that would enable the SD slot.

Here is how to enable the SD slot on any laptop that has an SD slot based on the Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 chip-sets.

1. Create a file name sdhci.sh on your desktop with the following code

#!/bin/sh# from:#http://ubuntuforums.org/showthread.php?p=1614392#post1614392## Get lsb functions

. /lib/lsb/init-functions

LSPCI_ADDRESS=`lspci | grep "FlashMedia" | cut -d " " -f 1`

case "$1" in

start)

log_begin_msg "Configuring card reader"

modprobe fakephp || return 1

setpci -s ${LSPCI_ADDRESS} 86.b=90

setpci -s ${LSPCI_ADDRESS} 4c.b=02 # FlashMedia SD disable

setpci -s ${LSPCI_ADDRESS} 04.b=06 # SDHCI Mem+ BusMaster+

setpci -s ${LSPCI_ADDRESS} 88.b=01 # SDHCI DMA enable

modprobe sdhci || return 1

log_end_msg $?

;;

stop)

log_begin_msg "Shutting down card reader"

modprobe -r sdhci

lsmod | grep -q sdhci && return 1

setpci -s ${LSPCI_ADDRESS} 88.b=00 # SDHCI DMA disable

setpci -s ${LSPCI_ADDRESS} 04.b=07 # SDHCI Mem- BusMaster-

setpci -s ${LSPCI_ADDRESS} 4c.b=00 # FlashMedia SD enable

setpci -s ${LSPCI_ADDRESS} 86.b=d0

modprobe -r fakephp

log_end_msg $?

;;

*)

log_success_msg "Usage: /etc/init.d/sdhci start|stop"

exit 1

;;

esac

exit 0

2. make the file executable using the following command

chmod +x sdhci

3. Execute the file in a terminal using the following command

sudo ./sdhci.sh start

If every thing works fine and you will see a message " * Configuring card reader [ OK ]"

4. To start this script automatically move the script into /etc/init.d use the following command to accomplish this

sudo mv sdhci.sh /etc/init.d

5. finally add the script to be executed during boot sequence by executing the following command

sudo update-rc.d sdhci.sh defaults

you should see the following message on screen

Adding system startup for /etc/init.d/sdhci.sh ...
/etc/rc0.d/K20sdhci.sh -> ../init.d/sdhci.sh
/etc/rc1.d/K20sdhci.sh -> ../init.d/sdhci.sh
/etc/rc6.d/K20sdhci.sh -> ../init.d/sdhci.sh
/etc/rc2.d/S20sdhci.sh -> ../init.d/sdhci.sh
/etc/rc3.d/S20sdhci.sh -> ../init.d/sdhci.sh
/etc/rc4.d/S20sdhci.sh -> ../init.d/sdhci.sh
/etc/rc5.d/S20sdhci.sh -> ../init.d/sdhci.sh

That's it you are done :) , you can now start fooling around with the card reader.