LaFonera Hardware SD-Card
From DD-WRT Wiki
 LaFonera SD Card Hack
JFFS is enabled in 0403 and later builds.
It would be nice to be able to attach a SD Card to the LaFonera for storage.
 MMC driver for the LaFonera
 MMC BETA driver for the LaFonera
A beta MMC Driver for kernel 2.6 is avaible. It uses gpio bitbanging, the code is currently being reworked a bit to make it look nicer.
- Known issues: (version 0.1 for fonera)
* seg fault on rmmod -- fixed * seg fault when atomic * dev nodes do not get allocated automatically yet * no detailed howto yet
These issues will be fixed within the next days. the driver runs stable, as long as you do not insert or remove the card while the driver is loaded.
Package and sourcecode of MMC Beta Driver can be downloaded here: http://phrozen.org/fonera.html
 SDIO Pinout
Detailed Pinout of the LaFonera according to http://kwzs.be/~kevin/ar531x/gpio pinout.txt
GPIO Pin on LaFonera 0 TP3 1 pin 5 of SW1 2 WLAN LED 3 pin 1 of SW1 4 pin 2 of SW1 5 RESET (!) 6 RESET button 7 pin 6 of SW1
 Fonera sd-card hack
I read on several websites, that some people managed to wire a SD Card (or a MMC) to a Fonera access point. After a little googling, I discover this can be done easily, so I decided to test.. but I run into one issue so I decided to describe the process here.
Here the finished result:
Let's give it a try:
 Solder the sd-card
The first step, is to locate the SW pins (near the antenna).. simply solder some wires like this:
SD Card ----- Fonera DO (pin 7) SW1 CLK (pin 5) SW2 DI (pin 2) SW5 CS (pin 1) SW6 Gnd (pin 3) Gnd Vcc (pin 4) Vcc
Here you can see the SD Card pinouts at http://pinouts.ru/Memory/sdcard_pinout.shtml
You can solder the VCC, and Gnd on the serial pins.
 Unsolder the caps
In my first tests, I discovered the SD card is detected, so I checked the signals. And discover the clk isn't really clear.. So I decided to remove the capacitor on the SPI bus. (C142, C143, C144, C145)
 Install software and test
Next we need to install the kernel module on OpenWRT. You can find it on the phrozen website (http://phrozen.org/fonera.html) . Simply ipkg install the file and it should be ok. Now, let's try: insert a SD Card, and reboot, you should see something like this in your log.
Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : MMC Driver for Fonera Version 2.5 (050507) -- '2B|!2B' (firstname.lastname@example.org) Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : Card Found Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : card in op mode Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : SIZE : 241, nMUL : 6, COUNT : 1932, NAME : 256MB Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : Card Initialised Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : The inserted card has a capacity of 253231104 Bytes Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : adding disk Jan 1 00:00:49 OpenWrt user.info kernel: mmc1 Jan 1 00:00:49 OpenWrt user.warn kernel: mmc : Card was Found
So now you can mount it:
mount /dev/mmc0 /mnt
This stuff, is working really well, I managed to have around 150Ko/s (reading) which is far enough for my needs. The only issue right now, is that you need to carefully umount the card before removing it, otherwise the fonera will crash.
 The original idea
came from http://www.larsen-b.com/Article/262.html
 Mounting the Reader in the Bottom of the Fonera
See LaFonera_Hardware_SD-Card/Reader_Position for more pictures and instructions.
 Cheap SD Card "reader" (floppy cable, microSD card adapter)
http://uanr.com/sdfloppy/ describes how to build a SD card reader from an old 5.25 floppy drive connector. The description is for WRT but maybe this could be used with LaFonera too.
Bastard Sons of Dial-Up Episode 8 (http://BSoDtv.org/episodes.php) explains how to make an SD Card PCB.
There is a video on making a Floppy Drive SD Card Connector for embedded devices here: http://bsodtv.wiihost.net/Simple SD Card Connector.avi
Least expensive way is to connect micro SD card. Those can be bought with SD card adapter (http://en.wikipedia.org/wiki/MicroSD). Solder wires directly to SD card adapter, just be sure that the microSD card is removed at that point. Biggest problem is that you'll get an official micro SD slot for plug-in cards...
 Existing SD Card hacks for other devices
- Maybe this helps: http://forum.openwrt.org/viewtopic.php?id=8543
- And this: http://wiki.openwrt.org/OpenWrtDocs/Customizing/Hardware/MMC
- And this: http://wiki.openwrt.org/PackagesOnExternalMediaHowTo
- Also, there is a SDIO stack from Atheros http://source.mvista.com/~dsingleton/sdio … SDIO-linux which besdes SD cards also intends to support "SDIO USB" which sounds even more interesting :-)
 ucGentoo on fonera.2100
an other kernel driver for kernel 2.6.24 to be used with a MMC/SD of 2Gb as rootfs
 OpenWRT Kamikaze 8.09
# opk install luci-app-mmc_over_gpio # vi /etc/init.d/mmc_over_gpio
edit the line
add_device "default" 5 4 3 7 0
add_device "default" 1 3 4 14 0 sleep 1 remove_device "default" sleep 1 add_device "default" 1 3 4 7 0
save it with esc+ZZ
# /etc/init.d/mmc_over_gpio start
then you can see sthg:
configfs on /config type configfs (rw) gpio-mmc: Failed to request mmc_spi module. mmc_spi spi32761.0: SD/MMC host mmc0, no DMA, no WP, no poweroff gpio-mmc: MMC-Card "default" attached to GPIO pins di=1, do=3, clk=4, cs=7 mmc_spi spi32761.0: can't change chip-select polarity root@OpenWrt:~# mmc0: new SD card on SPI mmcblk0: mmc0:0000 SD01G 1006080KiB mmcblk0: p1
# mkdir /mnt/mmc # mount /dev/mmcblk0p1 /mnt/mmc