aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq806x/base-files/etc
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ipq806x/base-files/etc')
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/board.d/01_leds26
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/board.d/02_network13
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/diag.sh34
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata82
-rw-r--r--target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac23
-rwxr-xr-xtarget/linux/ipq806x/base-files/etc/init.d/linksys_recovery20
6 files changed, 190 insertions, 8 deletions
diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds
index b32c1cc21d..17f1a28abc 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/01_leds
+++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds
@@ -11,14 +11,26 @@ board_config_update
board=$(ipq806x_board_name)
case "$board" in
+c2600)
+ ucidef_set_led_usbdev "usb1" "USB 1" "usb_2:blue" "2-1"
+ ucidef_set_led_usbdev "usb2" "USB 2" "usb_4:blue" "4-1"
+ ucidef_set_led_netdev "wan" "WAN" "wan:blue" "eth0"
+ ucidef_set_led_netdev "lan" "LAN" "lan:blue" "br-lan"
+ ucidef_set_led_default "general" "general" "ledgnr:blue" "1"
+ ;;
d7800 |\
-r7500)
- ucidef_set_led_usbdev "usb1" "USB 1" "r7500:white:usb1" "1-1"
- ucidef_set_led_usbdev "usb2" "USB 2" "r7500:white:usb3" "3-1"
- ucidef_set_led_netdev "wan" "WAN" "r7500:white:wan" "eth0"
- ucidef_set_led_ide "esata" "eSATA" "r7500:amber:esata"
- ucidef_set_led_default "wps" "WPS" "r7500:white:wps" "0"
- ucidef_set_led_default "rfkill" "rfkill" "r7500:white:rfkill" "0"
+r7500 |\
+r7800)
+ ucidef_set_led_usbdev "usb1" "USB 1" "${board}:white:usb1" "1-1"
+ ucidef_set_led_usbdev "usb2" "USB 2" "${board}:white:usb3" "3-1"
+ ucidef_set_led_netdev "wan" "WAN" "${board}:white:wan" "eth0"
+ ucidef_set_led_ide "esata" "eSATA" "${board}:amber:esata"
+ ucidef_set_led_default "wps" "WPS" "${board}:white:wps" "0"
+ ucidef_set_led_default "rfkill" "rfkill" "${board}:white:rfkill" "0"
+ ;;
+ea8500)
+ ucidef_set_led_wlan "wifi" "WIFI" "ea8500:green:wifi" "phy0radio"
+ ucidef_set_led_default "wps" "WPS" "ea8500:green:wps" "0"
;;
*)
;;
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 6e18297e99..16cc13cfc0 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -6,6 +6,7 @@
. /lib/functions/uci-defaults.sh
. /lib/ipq806x.sh
+. /lib/functions/system.sh
board_config_update
@@ -13,8 +14,10 @@ board=$(ipq806x_board_name)
case "$board" in
ap148 |\
+c2600 |\
d7800 |\
-r7500)
+r7500 |\
+r7800)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
;;
@@ -23,6 +26,14 @@ db149)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
;;
+ea8500)
+
+ hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ ucidef_add_switch "switch0" \
+ "1:lan" "2:lan" "3:lan" "4:lan" "0t@eth0" "5:wan" "0t@eth0"
+ ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
+ ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
+ ;;
*)
echo "Unsupported hardware. Network interfaces not intialized"
;;
diff --git a/target/linux/ipq806x/base-files/etc/diag.sh b/target/linux/ipq806x/base-files/etc/diag.sh
new file mode 100755
index 0000000000..6b3622dc58
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/diag.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+. /lib/functions/leds.sh
+. /lib/ipq806x.sh
+
+get_status_led() {
+ case $(ipq806x_board_name) in
+ c2600)
+ status_led="status:blue"
+ ;;
+ ea8500)
+ status_led="ea8500:white:power"
+ ;;
+ esac
+}
+
+set_state() {
+ get_status_led
+
+ case "$1" in
+ preinit)
+ status_led_blink_preinit
+ ;;
+ failsafe)
+ status_led_blink_failsafe
+ ;;
+ preinit_regular)
+ status_led_blink_preinit_regular
+ ;;
+ done)
+ status_led_on
+ ;;
+ esac
+}
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
new file mode 100644
index 0000000000..a23dd80a00
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+ath10kcal_die() {
+ echo "ath10cal: " "$*"
+ exit 1
+}
+
+ath10kcal_from_file() {
+ local source=$1
+ local offset=$2
+ local count=$3
+
+ dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $source"
+}
+
+ath10kcal_extract() {
+ local part=$1
+ local offset=$2
+ local count=$3
+ local mtd
+
+ mtd=$(find_mtd_chardev $part)
+ [ -n "$mtd" ] || \
+ ath10kcal_die "no mtd device found for partition $part"
+
+ dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+ ath10kcal_die "failed to extract calibration data from $mtd"
+}
+
+ath10kcal_patch_mac() {
+ local mac=$1
+
+ [ -z "$mac" ] && return
+
+ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6
+}
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ipq806x.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+
+case "$FIRMWARE" in
+"ath10k/cal-pci-0000:01:00.0.bin")
+ case $board in
+ c2600)
+ ath10kcal_extract "radio" 4096 12064
+# ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1)
+ ;;
+ ea8500)
+ hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ ath10kcal_extract "art" 4096 12064
+ ;;
+ r7800)
+ ath10kcal_extract "art" 4096 12064
+ ;;
+ esac
+ ;;
+"ath10k/cal-pci-0001:01:00.0.bin")
+ case $board in
+ c2600)
+ ath10kcal_extract "radio" 20480 12064
+# ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -2)
+ ;;
+ ea8500)
+ hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+ ath10kcal_extract "art" 20480 12064
+ ;;
+ r7800)
+ ath10kcal_extract "art" 20480 12064
+ ;;
+ esac
+ ;;
+*)
+ exit 1
+ ;;
+esac
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
new file mode 100644
index 0000000000..1ae4352686
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -0,0 +1,23 @@
+#!/bin/ash
+
+[ "$ACTION" == "add" ] || exit 0
+
+PHYNBR=${DEVPATH##*/phy}
+
+[ -n $PHYNBR ] || exit 0
+
+. /lib/ipq806x.sh
+. /lib/functions/system.sh
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+ c2600)
+ echo $(macaddr_add $(mtd_get_mac_binary default-mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
+ ;;
+ ea8500)
+ echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
+ ;;
+ *)
+ ;;
+esac
diff --git a/target/linux/ipq806x/base-files/etc/init.d/linksys_recovery b/target/linux/ipq806x/base-files/etc/init.d/linksys_recovery
new file mode 100755
index 0000000000..b9ea004207
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/init.d/linksys_recovery
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=97
+boot() {
+. /lib/functions.sh
+. /lib/ipq806x.sh
+
+case $(ipq806x_board_name) in
+ ea8500)
+ # make sure auto_recovery in uboot is always on
+ AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
+ if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
+ fw_setenv auto_recovery yes
+ fi
+ # reset the boot counter
+ mtd resetbc s_env
+ ;;
+esac
+}