[OpenWrt-Devel] [PATCH] ar71xx: add support for the TP-LINK TL-WR941ND v5
Matthias Schiffer
mschiffer at universe-factory.net
Tue Feb 3 11:27:19 EST 2015
This device is very similar to the TL-WR841N v8, only two LED GPIOs are
different.
Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
target/linux/ar71xx/base-files/etc/diag.sh | 3 +-
.../ar71xx/base-files/etc/uci-defaults/01_leds | 3 +-
.../ar71xx/base-files/etc/uci-defaults/02_network | 1 +
target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 ++
.../ar71xx/base-files/lib/upgrade/platform.sh | 1 +
.../files/arch/mips/ath79/mach-tl-wr841n-v8.c | 61 ++++++++++++++++++++++
target/linux/ar71xx/image/Makefile | 3 +-
.../610-MIPS-ath79-openwrt-machines.patch | 3 +-
.../720-MIPS-ath79-add-Tube2H-support.patch | 6 +--
9 files changed, 77 insertions(+), 7 deletions(-)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index af6107b..03ca864 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -226,7 +226,8 @@ get_status_led() {
tl-wr841n-v8 | \
tl-wa830re-v2 | \
tl-wr842n-v2 | \
- tl-wr941nd)
+ tl-wr941nd | \
+ tl-wr941nd-v5)
status_led="tp-link:green:system"
;;
archer-c5 | \
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 d1da572..1d1f2be 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -369,7 +369,8 @@ tl-wr741nd-v4)
ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
;;
-tl-wr841n-v8)
+tl-wr841n-v8 | \
+tl-wr941nd-v5)
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth0"
ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x04"
ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08"
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 a223ae8..e5228cf 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -220,6 +220,7 @@ smart-300 |\
tl-mr3420-v2 |\
tl-wr841n-v8 |\
tl-wr842n-v2 |\
+tl-wr941nd-v5 |\
wnr2000-v3 |\
wnr2000-v4 |\
wnr2200 |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 02872de..b5224ae 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -702,6 +702,9 @@ ar71xx_board_detect() {
*TL-WR941ND)
name="tl-wr941nd"
;;
+ *"TL-WR941N/ND v5")
+ name="tl-wr941nd-v5"
+ ;;
*"TL-WR703N v1")
name="tl-wr703n"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index bc6866d..576ce56 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -333,6 +333,7 @@ platform_check_image() {
tl-wr841n-v9 | \
tl-wr842n-v2 | \
tl-wr941nd | \
+ tl-wr941nd-v5 | \
tl-wr1041n-v2 | \
tl-wr1043nd | \
tl-wr1043nd-v2 | \
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
index 0099b15..73cfdd9 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
@@ -38,6 +38,15 @@
#define TL_MR3420V2_GPIO_LED_3G 11
#define TL_MR3420V2_GPIO_USB_POWER 4
+#define TL_WR941NDV5_GPIO_LED_WLAN 13
+#define TL_WR941NDV5_GPIO_LED_QSS 15
+#define TL_WR941NDV5_GPIO_LED_WAN 18
+#define TL_WR941NDV5_GPIO_LED_LAN1 19
+#define TL_WR941NDV5_GPIO_LED_LAN2 20
+#define TL_WR941NDV5_GPIO_LED_LAN3 2
+#define TL_WR941NDV5_GPIO_LED_LAN4 3
+#define TL_WR941NDV5_GPIO_LED_SYSTEM 14
+
#define TL_WR841NV8_KEYS_POLL_INTERVAL 20 /* msecs */
#define TL_WR841NV8_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR841NV8_KEYS_POLL_INTERVAL)
@@ -127,6 +136,42 @@ static struct gpio_keys_button tl_mr3420v2_gpio_keys[] __initdata = {
}
};
+static struct gpio_led tl_wr941nd_v5_leds_gpio[] __initdata = {
+ {
+ .name = "tp-link:green:lan1",
+ .gpio = TL_WR941NDV5_GPIO_LED_LAN1,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:lan2",
+ .gpio = TL_WR941NDV5_GPIO_LED_LAN2,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:lan3",
+ .gpio = TL_WR941NDV5_GPIO_LED_LAN3,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:lan4",
+ .gpio = TL_WR941NDV5_GPIO_LED_LAN4,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:qss",
+ .gpio = TL_WR941NDV5_GPIO_LED_QSS,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:system",
+ .gpio = TL_WR941NDV5_GPIO_LED_SYSTEM,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:wan",
+ .gpio = TL_WR941NDV5_GPIO_LED_WAN,
+ .active_low = 1,
+ }, {
+ .name = "tp-link:green:wlan",
+ .gpio = TL_WR941NDV5_GPIO_LED_WLAN,
+ .active_low = 1,
+ },
+};
+
static void __init tl_ap123_setup(void)
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
@@ -223,3 +268,19 @@ static void __init tl_mr3420v2_setup(void)
MIPS_MACHINE(ATH79_MACH_TL_MR3420_V2, "TL-MR3420-v2", "TP-LINK TL-MR3420 v2",
tl_mr3420v2_setup);
+
+
+static void __init tl_wr941nd_v5_setup(void)
+{
+ tl_ap123_setup();
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr941nd_v5_leds_gpio),
+ tl_wr941nd_v5_leds_gpio);
+
+ ath79_register_gpio_keys_polled(1, TL_WR841NV8_KEYS_POLL_INTERVAL,
+ ARRAY_SIZE(tl_wr841n_v8_gpio_keys),
+ tl_wr841n_v8_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V5, "TL-WR941ND-v5", "TP-LINK TL-WR941N/ND v5",
+ tl_wr941nd_v5_setup);
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index f7b8381..84dd22d 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -1409,6 +1409,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA801NV2,tl-wa801nd-v2,TL-WA801
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA850,tl-wa850re-v1,TL-WA850RE,ttyS0,115200,0x08500001,1,4Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA860,tl-wa860re-v1,TL-WA860RE,ttyS0,115200,0x08600001,1,4Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA901NV3,tl-wa901nd-v3,TL-WA901ND-v3,ttyS0,115200,0x09010003,1,4Mlzma))
+$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR941NV5,tl-wr941nd-v5,TL-WR941ND-v5,ttyS0,115200,0x09410005,1,4Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR941NV6,tl-wr941nd-v6,TL-WDR3500,ttyS0,115200,0x09410006,1,4Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1041,tl-wr1041n-v2,TL-WR1041N-v2,ttyS0,115200,0x10410002,1,4Mlzma))
$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
@@ -1490,7 +1491,7 @@ $(eval $(call MultiProfile,TLWR743,TLWR743NV1 TLWR743NV2))
$(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7 TLWR841NV8 TLWR841NV9 TLWR847NV8))
$(eval $(call MultiProfile,TLWR842,TLWR842V1 TLWR842V2))
$(eval $(call MultiProfile,TLWR843,TLWR843NV1))
-$(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV6))
+$(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4 TLWR941NV5 TLWR941NV6))
$(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2))
$(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
$(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
diff --git a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
index b01c5de..0fd64ff 100644
--- a/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
+++ b/target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -16,22 +16,146 @@
+@@ -16,22 +16,147 @@
enum ath79_mach_type {
ATH79_MACH_GENERIC = 0,
@@ -108,6 +108,7 @@
+ ATH79_MACH_TL_WR841N_V8, /* TP-LINK TL-WR841N/ND v8 */
+ ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */
+ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
++ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
+ ATH79_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
diff --git a/target/linux/ar71xx/patches-3.14/720-MIPS-ath79-add-Tube2H-support.patch b/target/linux/ar71xx/patches-3.14/720-MIPS-ath79-add-Tube2H-support.patch
index 2c94842..7a3754b 100644
--- a/target/linux/ar71xx/patches-3.14/720-MIPS-ath79-add-Tube2H-support.patch
+++ b/target/linux/ar71xx/patches-3.14/720-MIPS-ath79-add-Tube2H-support.patch
@@ -1,9 +1,9 @@
--- a/arch/mips/ath79/machtypes.h
+++ b/arch/mips/ath79/machtypes.h
-@@ -142,6 +142,7 @@ enum ath79_mach_type {
- ATH79_MACH_TL_WR841N_V9, /* TP-LINK TL-WR841N/ND v9 */
+@@ -143,6 +143,7 @@ enum ath79_mach_type {
ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */
ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
+ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */
+ ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */
ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
@@ -28,7 +28,7 @@
select SOC_AR724X
--- a/arch/mips/ath79/Makefile
+++ b/arch/mips/ath79/Makefile
-@@ -117,6 +117,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)
+@@ -117,6 +117,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR1043ND_V2)
obj-$(CONFIG_ATH79_MACH_TL_WR2543N) += mach-tl-wr2543n.o
obj-$(CONFIG_ATH79_MACH_TL_WR703N) += mach-tl-wr703n.o
obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3) += mach-tl-wr720n-v3.o
--
2.2.2
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list