Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
Copyright © 2008 Axel Gembe

Contents

  1. Instructions
  2. General Pinout
  3. SD Card Pinout
  4. SW1 Pinout + capacitors on the front
  5. Pull down resistors on the back

Instructions

First you remove the parts which are marked in the pictures. They basically are all the SW1 pull down resistors on the back of the board and the SW1 capacitors on the front of the board. After this you wire all the pins as described under general pinout to the SD card. You have to add a ~10kΩ resistor between SW1.1 and SW1.3 to pull the DO signal high while no card is inserted.

Compile your OpenWRT with this patchset. To apply the patches, execute the following in your OpenWRT root folder:

svn mkdir target/linux/atheros/files/include/asm-mips/mach-atheros/ar5312
svn mkdir target/linux/atheros/files/include/asm-mips/mach-atheros/ar5315
svn mv target/linux/atheros/files/arch/mips/atheros/ar5312/ar5312.h target/linux/atheros/files/include/asm-mips/mach-atheros/ar5312/
svn mv target/linux/atheros/files/arch/mips/atheros/ar5315/ar5315.h target/linux/atheros/files/include/asm-mips/mach-atheros/ar5315/
svn mv target/linux/atheros/files/arch/mips/atheros/ar531x.h target/linux/atheros/files/include/asm-mips/mach-atheros/
wget -q -O - --no-check-certificate 'https://dev.openwrt.org/attachment/ticket/1861/01-atheros-move-headers.patch?format=raw' | patch -p0
wget -q -O - --no-check-certificate 'https://dev.openwrt.org/attachment/ticket/1861/02-atheros-generic-gpio.patch?format=raw' | patch -p0
wget -q -O - --no-check-certificate 'https://dev.openwrt.org/attachment/ticket/1861/03-atheros-gpiodev.patch?format=raw' | patch -p0
wget -q -O - --no-check-certificate 'https://dev.openwrt.org/attachment/ticket/1861/04-gpioctl-for-atheros.patch?format=raw' | patch -p0

Keep in mind that you have to fully recompile your kernel for this to work, so remove the directory build_dir/linux-atheros/linux-<version> before compiling to make sure the kernel sources have the right patches applied.

In OpenWRT you will need to select these options:

After you installed kmod-mmc-over-gpio, edit the file /etc/init.d/mmc_over_gpio like this:

Restart your system and your SD card should work.
Note that the PIN assignment is compatible with the other SD card mods I've seen, so if this doesn't work, try them.

General Pinout

SD Pin
(1-based)
SPI signalGPIO
(0-based)
SW1.x Pin
(0-based)
Description
2DI1SW1.5Wire directly to your SD cards PIN 2
7DO3SW1.1 PU 10kΩWire directly to your SD cards PIN 7 and add a 10kΩ pull up resistor between this signal and SW1.3 (+3.3V)
5CLK4SW1.2Wire directly to your SD cards PIN 5
1CS7SW1.6Wire directly to your SD cards PIN 1
4+3.3V SW1.3Wire directly to your SD cards PIN 4
3GND  Wire together with PIN 6 to the next ground connection
6GND  Wire together with PIN 3 to the next ground connection

SD Card Pinout

PinSymbolName
1CSChip select
2DIData in
3GNDGround
4VDDPower
5CLKClock
6GNDGround
7DOData out
8 Unused
9 Unused

SW1 Pinout + capacitors on the front

Pull down resistors on the back