summaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-07-28 15:43:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-07-28 15:44:52 +0200
commit500a67a167a256002f8ab05171f49dfb86b03260 (patch)
tree5347f7c1c1b5c38f98759bb7ff5ac6ea4e2189b6 /target/linux/ar71xx
parentc58ed54d8ce3d628288f9d860e84aad65870d7e1 (diff)
downloadmaster-31e0f0ae-500a67a167a256002f8ab05171f49dfb86b03260.tar.gz
master-31e0f0ae-500a67a167a256002f8ab05171f49dfb86b03260.tar.bz2
master-31e0f0ae-500a67a167a256002f8ab05171f49dfb86b03260.zip
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 <mschiffer@universe-factory.net>
Diffstat (limited to 'target/linux/ar71xx')
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 56b59474b1..5d38555b9f 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -73,6 +73,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
@@ -471,6 +480,7 @@ ar71xx_board_detect() {
;;
*"DIR-505 rev. A1")
name="dir-505-a1"
+ dir505_board_detect
;;
*"DIR-600 rev. A1")
name="dir-600-a1"