PATCHv3 changelog:
* I hate whitespace. v2 is broken, sorry for the noise.
PATCHv2 changelog:
* got ethernet almost right: eth1 = wan, eth0 = lan ports, reversed
* added board to sysupgrade support
WDR3500 is similar to WDR3600 except it doesn't have gigabit ethernet,
and has only 1 USB port.
So, this patch (over r35162) adds a new board type, based on
mach-tl-wdr4300.c but replacing ethernet config with one franken-based
on mach-tl-wr841n-v8.c
a huge thanks goes out to Paul Fertser for hours of tireless advice!
Pending issues:
* Leds are not working at all (except power and wlan_5g)
* LAN switch ethernet ports are reversed with respect to case label.
[Label] - soft device
[LAN1] - eth0.4
[LAN2] - eth0.3
[LAN3] - eth0.2
[LAN4] - eth0.1
Anyone with experience fixing those details that cares to help, will
be much appreciated!
Thanks-to: Paul Fertser fercer...@gmail.com
Signed-off-by: Gui Iribarren g...@altermundi.net
---
target/linux/ar71xx/base-files/lib/ar71xx.sh |6 +
.../ar71xx/base-files/lib/upgrade/platform.sh |1 +
target/linux/ar71xx/config-3.7 |1 +
.../ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c | 153
target/linux/ar71xx/generic/profiles/tp-link.mk|4 +-
target/linux/ar71xx/image/Makefile |3 +-
.../610-MIPS-ath79-openwrt-machines.patch | 27 +++-
7 files changed, 185 insertions(+), 10 deletions(-)
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 31b6dde..a11c1c3 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -123,6 +123,9 @@ tplink_board_detect() {
342000*)
model=TP-Link TL-MR3420
;;
+ 35*)
+ model=TP-Link TL-WDR3500
+ ;;
36*)
model=TP-Link TL-WDR3600
;;
@@ -366,6 +369,9 @@ ar71xx_board_detect() {
*TL-WA901ND v2)
name=tl-wa901nd-v2
;;
+ *TL-WDR3500)
+ name=tl-wdr3500
+ ;;
*TL-WDR3600/4300/4310)
name=tl-wdr4300
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 3d5efdb..a952a9b 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -158,6 +158,7 @@ platform_check_image() {
tl-wa7510n | \
tl-wa901nd | \
tl-wa901nd-v2 | \
+ tl-wdr3500 | \
tl-wdr4300 | \
tl-wr703n | \
tl-wr741nd | \
diff --git a/target/linux/ar71xx/config-3.7 b/target/linux/ar71xx/config-3.7
index a13cf98..80e0e81 100644
--- a/target/linux/ar71xx/config-3.7
+++ b/target/linux/ar71xx/config-3.7
@@ -63,6 +63,7 @@ CONFIG_ATH79_MACH_TL_MR3020=y
CONFIG_ATH79_MACH_TL_MR3X20=y
CONFIG_ATH79_MACH_TL_WA901ND=y
CONFIG_ATH79_MACH_TL_WA901ND_V2=y
+CONFIG_ATH79_MACH_TL_WDR3500=y
CONFIG_ATH79_MACH_TL_WDR4300=y
CONFIG_ATH79_MACH_TL_WR1041N_V2=y
CONFIG_ATH79_MACH_TL_WR1043ND=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
new file mode 100644
index 000..05fe83d
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3500.c
@@ -0,0 +1,153 @@
+/*
+ * TP-LINK TL-WDR3500 board support
+ *
+ * Copyright (C) 2012 Gabor Juhos juh...@openwrt.org
+ * Copyright (C) 2013 Gui Iribarren g...@altermundi.net
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include linux/pci.h
+#include linux/phy.h
+#include linux/gpio.h
+#include linux/platform_device.h
+#include linux/ath9k_platform.h
+#include linux/ar8216_platform.h
+
+#include asm/mach-ath79/ar71xx_regs.h
+
+#include common.h
+#include dev-ap9x-pci.h
+#include dev-eth.h
+#include dev-gpio-buttons.h
+#include dev-leds-gpio.h
+#include dev-m25p80.h
+#include dev-spi.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+
+#define WDR3500_GPIO_LED_USB1 11
+#define WDR3500_GPIO_LED_WLAN2G13
+#define WDR3500_GPIO_LED_SYSTEM14
+#define WDR3500_GPIO_LED_QSS 15
+
+#define WDR3500_GPIO_BTN_WPS 16
+#define WDR3500_GPIO_BTN_RFKILL17
+
+#define WDR3500_GPIO_USB1_POWER22
+
+#define WDR3500_KEYS_POLL_INTERVAL 20 /* msecs */
+#define WDR3500_KEYS_DEBOUNCE_INTERVAL (3 * WDR3500_KEYS_POLL_INTERVAL)
+
+#define WDR3500_MAC0_OFFSET0
+#define WDR3500_MAC1_OFFSET6
+#define WDR3500_WMAC_CALDATA_OFFSET0x1000
+#define WDR3500_PCIE_CALDATA_OFFSET0x5000
+
+static const char *wdr3500_part_probes[] = {
+ tp-link,
+ NULL,