ar71xx: add support for the TP-LINK TL-WR941ND v5
authorJohn Crispin <john@openwrt.org>
Wed, 4 Feb 2015 06:10:20 +0000 (06:10 +0000)
committerJohn Crispin <john@openwrt.org>
Wed, 4 Feb 2015 06:10:20 +0000 (06:10 +0000)
This device is very similar to the TL-WR841N v8, only two LED GPIOs are
different.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
SVN-Revision: 44255

target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
target/linux/ar71xx/base-files/etc/uci-defaults/02_network
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c
target/linux/ar71xx/image/Makefile
target/linux/ar71xx/patches-3.14/610-MIPS-ath79-openwrt-machines.patch
target/linux/ar71xx/patches-3.14/720-MIPS-ath79-add-Tube2H-support.patch

index af6107b4895fa5e7b8cb9b086fb12010e40e9b63..03ca8640e73c1f9221332f1c01a30801eb56aefc 100755 (executable)
@@ -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 | \
index 4dfe652743c1dbe865b96ea21709e9e4f2247ec2..61d0314ee990e58e2a318fb7013a20a7aaa9276c 100755 (executable)
@@ -370,7 +370,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"
index a223ae8fe52d3b5930e02b1b2a261c905d7068a3..e5228cf0426dd7a0ed0dc6c552be564879c294e0 100755 (executable)
@@ -220,6 +220,7 @@ smart-300 |\
 tl-mr3420-v2 |\
 tl-wr841n-v8 |\
 tl-wr842n-v2 |\
+tl-wr941nd-v5 |\
 wnr2000-v3 |\
 wnr2000-v4 |\
 wnr2200 |\
index 02872de1457d8a14bcf762c55f523b692dcb9256..b5224ae6facfa7a348750295af98da66abe2f314 100755 (executable)
@@ -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"
                ;;
index bc6866da1997cbf820b3fcdd79d0cb42b74c962a..576ce56da3350d9b6a7667427e4b165b29e20988 100755 (executable)
@@ -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 | \
index 0099b15b3abee4022869832950fb0f38bd107bad..73cfdd9cc6f569c2cc063a7caa260af24b6b93c1 100644 (file)
 #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);
index f7b8381aa422e65b9076a4df390118bed9dd1a56..84dd22dbad932c0dab90ac447fd1a6c154431725 100644 (file)
@@ -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))
index b01c5de1ff58d72e7ed422a314945db56a91dde3..0fd64ff6a7b1a89f240af599a754cc9b943a11b4 100644 (file)
@@ -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,
 +      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 */
index 2c948426b793bb38c0ed17dccfa55ff0ecf34733..7a3754ba80b7b30ae7dce15a317feafc09502d10 100644 (file)
@@ -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