aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2015-04-07 20:04:14 +0000
committerGabor Juhos <juhosg@openwrt.org>2015-04-07 20:04:14 +0000
commit271d4d3ff8a70bf2541d6fe6f6e173c6181fb34e (patch)
treee72ba26e250b2e68f16cc60afa96d92e936cbc30
parenta84098ee4975f0e01af5339efe22d78b7d9d3937 (diff)
downloadupstream-271d4d3ff8a70bf2541d6fe6f6e173c6181fb34e.tar.gz
upstream-271d4d3ff8a70bf2541d6fe6f6e173c6181fb34e.tar.bz2
upstream-271d4d3ff8a70bf2541d6fe6f6e173c6181fb34e.zip
ar71xx: add user-space support for RB911G-5HPacD
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45300 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ar71xx/base-files/etc/diag.sh1
-rw-r--r--target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata45
-rw-r--r--target/linux/ar71xx/base-files/etc/uci-defaults/02_network1
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh3
4 files changed, 50 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 59acc714a1..14ff625d61 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -161,6 +161,7 @@ get_status_led() {
status_led="rb750:green:act"
;;
rb-911g-2hpnd|\
+ rb-911g-5hpacd|\
rb-911g-5hpnd|\
rb-912uag-2hpnd|\
rb-912uag-5hpnd)
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..164d3abd39
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+ath10kcal_die() {
+ echo "ath10cal: " "$*"
+ exit 1
+}
+
+ath10kcal_from_file() {
+ local source=$1
+ local offset=$2
+ local target=$3
+
+ dd if=$source of=$target bs=1 skip=$offset count=2116 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $source"
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ar71xx.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+ath10kcal_mac=""
+ath10kcal_tmp="/tmp/ath10k-caldata.bin"
+
+board=$(ar71xx_board_name)
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ rb-911g-5hpacd)
+ ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 $ath10kcal_tmp
+ ;;
+ esac
+ ;;
+
+*)
+ exit 1
+ ;;
+esac
+
+[ -f $ath10kcal_tmp ] && {
+ cp $ath10kcal_tmp /lib/firmware/$FIRMWARE
+ rm -f $ath10kcal_tmp
+}
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 20f34d50da..9789834dcf 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -312,6 +312,7 @@ mr900 |\
mr900v2 |\
rb-411 |\
rb-911g-2hpnd |\
+rb-911g-5hpacd |\
rb-911g-5hpnd |\
rb-912uag-2hpnd |\
rb-912uag-5hpnd |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 802524c545..b3dbcf5891 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -582,6 +582,9 @@ ar71xx_board_detect() {
*"RouterBOARD 911G-5HPnD")
name="rb-911g-5hpnd"
;;
+ *"RouterBOARD 911G-5HPacD")
+ name="rb-911g-5hpacd"
+ ;;
*"RouterBOARD 912UAG-2HPnD")
name="rb-912uag-2hpnd"
;;