aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/lib/preinit
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2012-05-27 16:02:22 +0000
committerJohn Crispin <john@openwrt.org>2012-05-27 16:02:22 +0000
commit81ddc886e172dae27ae9f15721d2ee34fc00d890 (patch)
tree7ee1753a469f15555806fc645e5acb0f3fa657b0 /target/linux/lantiq/base-files/lib/preinit
parent6e8fe844723520c75793a4dbeb160226efba0053 (diff)
downloadupstream-81ddc886e172dae27ae9f15721d2ee34fc00d890.tar.gz
upstream-81ddc886e172dae27ae9f15721d2ee34fc00d890.tar.bz2
upstream-81ddc886e172dae27ae9f15721d2ee34fc00d890.zip
dgn3500 support with eeprom loading from sysfs
WIFI eeprom: As discussed, it is impossible for nand and spi flash platforms to have the eeprom data available from mtd. I suggested to load the eeprom from user-space. I've looked into regular firmware loading but this is only possible when using modules. I've created a sysfs entry that allows reading and writing the eeprom data to the platform data. After loading the eeprom data I rely on pci-hotplug support to disable the bogus pci device and rescan the bus (with fixups and all). Because hotplug is not available, an init script is created that performs the copy from mtd to platform data. I think it is best to eventually move the sysfs functions to dev_wifi_athxk.c file, this would get rid of the external to the ath9k platform data. SPI flash: It seems that the spi-xway driver is not really working. It causes my kernel to crash in all sorts of ways. I added to bitbang SPI to be able to the calibration data mention above. I've kept the original mtd partitioning that Netgear uses. Buttons/LED: Both buttons are working properly. Two leds are not enabled: The red internet led is connected to the pci_gnt1 pin... I can't disable it because then DMA stops working. The green wifi led is connected to an unknown atheros gpio. Signed-off-by: Pieter Voorthuijsen <p.voorthuijsen at gmail.com> SVN-Revision: 31910
Diffstat (limited to 'target/linux/lantiq/base-files/lib/preinit')
-rw-r--r--target/linux/lantiq/base-files/lib/preinit/42_athfix19
1 files changed, 19 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/lib/preinit/42_athfix b/target/linux/lantiq/base-files/lib/preinit/42_athfix
new file mode 100644
index 0000000000..114aaffc8b
--- /dev/null
+++ b/target/linux/lantiq/base-files/lib/preinit/42_athfix
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /lib/lantiq.sh
+
+init_atheeprom() {
+ local board=$(lantiq_board_name)
+ case $board in
+ "Netgear DGN3500B")
+ echo "- loading eeprom -"
+ dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 count=4
+ echo 0 > /sys/bus/pci/slots/0000\:00\:0e.0/power
+ sleep 1
+ echo 1 > /sys/bus/pci/rescan
+ ;;
+ esac
+}
+
+boot_hook_add preinit_essential init_atheeprom
+