From 3d3eb24a97d1781610b3908ba2ab62d54f8d1fd8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 28 Jul 2016 16:33:49 +0200 Subject: [PATCH] ar71xx-generic: backport a few D-Link DIR-505 A1/A2 patches Fixes #658 --- ...n-detection-for-D-Link-DIR-505-A1-A2.patch | 38 +++++++++++++++++++ ...505-status-LED-as-ethernet-indicator.patch | 28 ++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 patches/openwrt/0113-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch create mode 100644 patches/openwrt/0114-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch diff --git a/patches/openwrt/0113-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch b/patches/openwrt/0113-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch new file mode 100644 index 00000000..9689ccfb --- /dev/null +++ b/patches/openwrt/0113-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch @@ -0,0 +1,38 @@ +From: Matthias Schiffer +Date: Thu, 28 Jul 2016 15:43:25 +0200 +Subject: ar71xx: add revision detection for D-Link DIR-505 A1/A2 + +The A1 image also works on the A2, correctly set AR71XX_MODEL in this case. + +Signed-off-by: Matthias Schiffer + +Backport of LEDE 500a67a167a256002f8ab05171f49dfb86b03260 + +diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh +index beca73a..480cf93 100755 +--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh ++++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh +@@ -107,6 +107,15 @@ cybertan_get_hw_magic() { + dd bs=8 count=1 skip=0 if=$part 2>/dev/null | hexdump -v -n 8 -e '1/1 "%02x"' + } + ++dir505_board_detect() { ++ local dev=$(find_mtd_part 'mac') ++ [ -z "$dev" ] && return ++ ++ # The revision is stored at the beginning of the "mac" partition ++ local rev="$(LC_CTYPE=C awk -v 'FS=[^[:print:]]' '{print $1; exit}' $dev)" ++ AR71XX_MODEL="D-Link DIR-505 rev. $rev" ++} ++ + tplink_get_hwid() { + local part + +@@ -453,6 +462,7 @@ ar71xx_board_detect() { + ;; + *"DIR-505 rev. A1") + name="dir-505-a1" ++ dir505_board_detect + ;; + *"DIR-600 rev. A1") + name="dir-600-a1" diff --git a/patches/openwrt/0114-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch b/patches/openwrt/0114-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch new file mode 100644 index 00000000..7f75f41e --- /dev/null +++ b/patches/openwrt/0114-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch @@ -0,0 +1,28 @@ +From: Matthias Schiffer +Date: Thu, 28 Jul 2016 15:59:04 +0200 +Subject: ar71xx: don't use D-Link DIR-505 status LED as ethernet indicator + +The stock firmware uses the single LED as status indicator only. Using the +same LED both for status and as ethernet indicator is uncommon, and has +been confusing users who were using the device as a WLAN mesh node (so the +LED was just off, as no ethernet was connected). + +Signed-off-by: Matthias Schiffer + +Backport of LEDE adbbfb7ff900c489e6be34b2ec2834172dff7943 + +diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +index 9a0d7eb..7c18346 100644 +--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ++++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +@@ -132,10 +132,6 @@ dhp-1565-a1) + ucidef_set_led_switch "wan" "WAN" "d-link:green:planet" "switch0" "0x20" + ;; + +-dir-505-a1) +- ucidef_set_led_netdev "lan" "LAN" "d-link:green:power" "eth1" +- ;; +- + dir-600-a1|\ + dir-615-e1|\ + dir-615-e4)