OpenWrt Forum Archive

Topic: SD card support in Backfire on AR7 architecture [DLink DSL-G624T]

The content of this topic has been archived on 6 Jun 2015. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I installed BackFire on a DLink DSL-G624T and I am trying to get a SD card reader to work on it.
So my first question is did anybody get the SD/MMC driver to work with the final release of backfire on AR7 architecture? if not, what is the best OpenWrt version to get it working? Some optimised drivers seem to only work with kernel 2.4.

Concerning my attempt, so far, I did the following:
-enabled the MMC driver in menuconfig
-configured the GPIO lines I am using
-compiled OpenWrt
-installed the image on my router
-installed the required packages (why is there a spi_gpio_old?)
-tested the GPIO lines with a LED
-struggled a bit but finally find out I had to change the "enabled=0" line to "enabled=1" in /etc/config/mmc_over_gpio
-I disabled the following drivers just in case they would interfere with the GPIO I had chosen : atm br2684 pppoatm pppox pppoe acx tiatm
-I disabled the hearbeat on the led I am using for one of the SD card GPIO lines (is it enough? do I need to unload a driver or to recompile the kernel?) with this command:

echo none > /sys/devices/platform/leds-gpio/leds/status/trigger

I used the following command to start the service:

/etc/init.d/mmc_over_gpio start

I got the following error messages

gpio-mmc: Failed to request mmc_spi module.
spi-gpio: probe of spi-gpio.0 failed with error -16
gpio-mmc: MMC-Card "default" attached to GPIO pins di=8, do=12, clk=13, cs=6

should I see something in the log if I insert a SD card ?
do I need to enable a certain log level for this ?
what should trigger the creation of the block devices ?

I tried to create the block devices manually and mount them :

mknod /dev/mmcblk0 b 179 0
mknod /dev/mmcblk0p1 b 179 1
root@OpenWrt:~# mount /dev/mmcblk0p1 /mnt/mmc/
mount: mounting /dev/mmcblk0p1 on /mnt/mmc/ failed: No such device or address

The following modules are loaded

root@OpenWrt:~# lsmod |grep mmc
gpiommc                 3920  0 
spi_gpio_old            4800  1 gpiommc
mmc_spi                 7456  0 
mmc_block               7216  0 
mmc_core               40000  2 mmc_spi,mmc_block
crc7                     720  1 mmc_spi
crc_itu_t                992  1 mmc_spi
root@OpenWrt:~# lsmod |grep gpio
gpiommc                 3920  0 
spi_gpio_old            4800  1 gpiommc
spi_gpio                4992  0 
spi_bitbang             3088  2 spi_gpio_old,spi_gpio

and when I do a cat /proc/devices :

Character devices:
  1 mem
  4 ttyS
  5 /dev/tty
  5 /dev/console
  5 /dev/ptmx
 10 misc
 89 i2c
 90 mtd
108 ppp
128 ptm
136 pts
254 ar7_gpio

Block devices:
259 blkext
 31 mtdblock
179 mmc

so I am in a lot of doubts:
-Did I solder things correctly ? (as I am more a butcher than a surgeon...)
-Can it be done with my router ( a DLink DSL-G624T)
-Does it currently work with the OpenWrt release I am using (Backfire 10.3)
-am I doing the right things ? (there are many ways to go wrong)

I think adding a SD card slot to its router must be one of the most popular hacks since it can turn an old dusty unused router in some actually useful appliance (like a wifi file server)

Could some troubleshooting instructions be added to the wiki pages so that when people got errors, they know why.
I'd like to help but since I'm stuck and can't get the MMC driver to work, I'm not the best candidate.
For example what kind of error messages or symptoms do you have when the soldering is bad (or if a capacitor needs to be removed)?
What can of error message do you have when the SD/MMC card is not compatible with the driver? etc.

Otherwise, just a word to say the web interface is really good looking and functional, you did a great job on it! It is better than most of the default ones.

As I didn't have any replies, I feel quite pessimistic about the AR7 MMC/SD support.
Probably it is just a small problem on my config, but without any support or any proof it does work on my router, I won't try any harder.
I think I'll get a cheap eth-to-ATA adapter to get more storage or get a wifi router with a USB port.
I'll try the SD card hack again only if I have plenty of time.

So far, I've checked those links
http://wiki.openwrt.org/oldwiki/openwrtdocs/customizing/hardware/mmc SD/MMC card works well with 2.4 kernels
http://open-wrt.ru/forum/viewtopic.php?id=20903 : 8.09 / 2.6 bcm doesn't seem to have SD card support ?
http://downloads.openwrt.org/whiterussian/0.9/default/ doesn't show any ar7 package, so is it possible to run whiterussian on a AR7 architecture ? probably not
svn://svn.openwrt.org/openwrt/branches/8.09 can only compile a 2.6 kernel when AR7 architeture is used
https://forum.openwrt.org/viewtopic.php?id=23753 example of error messages caused by hardware problems
https://forum.openwrt.org/viewtopic.php?id=22267 example of error messages with the improved mmc module
https://forum.openwrt.org/viewtopic.php?id=9653&p=7 thread about the optimized mmc driver, for 2.4
https://forum.openwrt.org/viewtopic.php?pid=91200 incompatibilities with MMC driver and b43 module. In 2.6 it is slower and/or less compatible
https://forum.openwrt.org/viewtopic.php?id=24127&p=1 SD/MMC works in backfire release on broadcom,

have the same troubles with at71xx, dlink 615c1/c2
how you compile spi_bitbang ?

Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-mmc-over-gpio:
*      kmod-spi-bitbang *
* opkg_install_cmd: Cannot install package luci-app-mmc-over-gpio.

(Last edited by lexxai on 10 Jul 2010, 22:35)

I don't remember if I downloaded or compiled spi_bitbang, but I loaded it as a module
But I didn't compile Luci

j-greg wrote:

I don't remember if I downloaded or compiled spi_bitbang, but I loaded it as a module
But I didn't compile Luci

you have other platform ... sad you can have this module, at ar71xx this module not present...

The discussion might have continued from here.