OpenWrt Forum Archive

Topic: MMC over GPIO and external overlay success story on Dlink DIR-300.

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

After lots of messing around and following howtos, I kept encountering the issue of either double mounting the sd card and not showing the correct free space or showing the correct space but filling up the flash first.

I now have the MMC driver working on preinit and pivot root/overlay works as expected on the Dlink DIR-300

So here is a brief overview of what I have done.  I know it's messy and the script is incredibly dodgy but I figured I'll do a more in-depth howto if enough interest is shown.

Openwrt Attitude Adjustment revision 29641
Build as usual selecting required packages, run make kernel_menuconfig and include drivers in-kernel instead of as modules.
Install openwrt-atheros-root.jffs2-64k instead of squashfs image

edit /etc/preinit and add the below to the end of the script:

pi_failsafe_net_message=false #<---ORIGINAL LINE

#BEGIN#
#Benji#

cat /proc/mounts
benjidir="/config/gpiommc/default"
mkdir -p /config/gpiommc/default
mount configfs -t configfs /config
mkdir -p /config/gpiommc/default
echo "BENJISCRIPT"
cat /proc/mounts
echo 4 > $benjidir/gpio_data_in
echo 7 > $benjidir/gpio_data_out
echo 1 > $benjidir/gpio_clock
echo 3 > $benjidir/gpio_chipselect
echo 0 > $benjidir/spi_mode
echo 1 > $benjidir/register
sleep 10s #to ensure card inits
#Benji#

boot_run_hook preinit_main
#EOF#

After this, follow the rest of the extroot howto and reboot.

I'd still rather just compile the pin assignments directly into the mmc driver and not worry about using the configfs but I am no c programmer (any help on this would be great).

Yes it does go a different way That is the mmc howto for Kamikaze.

The discussion might have continued from here.