ar71xx: add support for TP-LINK TL-WA860RE v1
authorJohn Crispin <john@openwrt.org>
Sun, 13 Jul 2014 10:03:41 +0000 (10:03 +0000)
committerJohn Crispin <john@openwrt.org>
Sun, 13 Jul 2014 10:03:41 +0000 (10:03 +0000)
New router/repeater from TP-LINK

- CPU: Atheros AR9341-DL3A (AP123)
- Flash: 4MB
- Ram: 32MB

Similar to TL-WA850RE.

Changes: rename file after r41596

Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
SVN-Revision: 41598

target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
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-wax50re.c
target/linux/ar71xx/generic/profiles/tp-link.mk
target/linux/ar71xx/image/Makefile
target/linux/ar71xx/patches-3.10/715-MIPS-ath79-add-TL-WA860RE-support.patch [new file with mode: 0644]

index d2e4937..f6c113e 100755 (executable)
@@ -167,6 +167,9 @@ get_status_led() {
        tl-wa850re)
                status_led="tp-link:blue:re"
                ;;
+       tl-wa860re)
+               status_led="tp-link:green:power"
+               ;;
        tl-mr3220 | \
        tl-mr3220-v2 | \
        tl-mr3420 | \
index ebc8942..21f049f 100755 (executable)
@@ -234,6 +234,11 @@ tl-wa850re)
        ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:blue:signal5" "wlan0" "80" "100" "-79" "13"
        ;;
 
+tl-wa860re)
+       ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
+       ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
+       ;;
+
 tl-wa901nd)
        ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
        ;;
index 88a1c86..dd36962 100755 (executable)
@@ -145,6 +145,9 @@ tplink_board_detect() {
        "085000"*)
                model="TP-Link TL-WA850RE"
                ;;
+       "086000"*)
+               model="TP-Link TL-WA860RE"
+               ;;
        "090100"*)
                model="TP-Link TL-WA901N/ND"
                ;;
index 8f3b563..f7c3b9a 100755 (executable)
@@ -240,6 +240,7 @@ platform_check_image() {
        tl-wa7510n | \
        tl-wa750re | \
        tl-wa850re | \
+       tl-wa860re | \
        tl-wa801nd-v2 | \
        tl-wa901nd | \
        tl-wa901nd-v2 | \
index cdb1f5a..965b1cd 100644 (file)
 #define TL_WAX50RE_GPIO_LED_SIGNAL4    3
 #define TL_WAX50RE_GPIO_LED_SIGNAL5    4
 
+#define TL_WA860RE_GPIO_LED_WLAN_ORANGE        0
+#define TL_WA860RE_GPIO_LED_WLAN_GREEN 2
+#define TL_WA860RE_GPIO_LED_POWER_ORANGE       12
+#define TL_WA860RE_GPIO_LED_POWER_GREEN        14
+#define TL_WA860RE_GPIO_LED_LAN                20
+
 #define TL_WA801ND_V2_GPIO_LED_LAN     18
 #define TL_WA801ND_V2_GPIO_LED_SYSTEM  14
 
 #define TL_WAX50RE_GPIO_BTN_RESET      17
 #define TL_WAX50RE_GPIO_BTN_WPS                16
 
+#define TL_WA860RE_GPIO_BTN_RESET      17
+#define TL_WA860RE_GPIO_BTN_WPS                16
+#define TL_WA860RE_GPIO_BTN_ONOFF      11
+
 #define TL_WAX50RE_KEYS_POLL_INTERVAL  20      /* msecs */
 #define TL_WAX50RE_KEYS_DEBOUNCE_INTERVAL (3 * TL_WAX50RE_KEYS_POLL_INTERVAL)
 
@@ -123,6 +133,30 @@ static struct gpio_led tl_wa850re_leds_gpio[] __initdata = {
        },
 };
 
+static struct gpio_led tl_wa860re_leds_gpio[] __initdata = {
+       {
+               .name           = "tp-link:green:lan",
+               .gpio           = TL_WA860RE_GPIO_LED_LAN,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:green:power",
+               .gpio           = TL_WA860RE_GPIO_LED_POWER_GREEN,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:orange:power",
+               .gpio           = TL_WA860RE_GPIO_LED_POWER_ORANGE,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:green:wlan",
+               .gpio           = TL_WA860RE_GPIO_LED_WLAN_GREEN,
+               .active_low     = 1,
+       }, {
+               .name           = "tp-link:orange:wlan",
+               .gpio           = TL_WA860RE_GPIO_LED_WLAN_ORANGE,
+               .active_low     = 1,
+       },
+};
+
 
 static struct gpio_keys_button tl_wax50re_gpio_keys[] __initdata = {
        {
@@ -142,6 +176,31 @@ static struct gpio_keys_button tl_wax50re_gpio_keys[] __initdata = {
        },
 };
 
+static struct gpio_keys_button tl_wa860re_gpio_keys[] __initdata = {
+       {
+               .desc              = "Reset button",
+               .type              = EV_KEY,
+               .code              = KEY_RESTART,
+               .debounce_interval = TL_WAX50RE_KEYS_DEBOUNCE_INTERVAL,
+               .gpio              = TL_WA860RE_GPIO_BTN_RESET,
+               .active_low        = 1,
+       }, {
+               .desc              = "WPS",
+               .type              = EV_KEY,
+               .code              = KEY_WPS_BUTTON,
+               .debounce_interval = TL_WAX50RE_KEYS_DEBOUNCE_INTERVAL,
+               .gpio              = TL_WA860RE_GPIO_BTN_WPS,
+               .active_low        = 1,
+       }, {
+               .desc              = "ONOFF",
+               .type              = EV_KEY,
+               .code              = BTN_1,
+               .debounce_interval = TL_WAX50RE_KEYS_DEBOUNCE_INTERVAL,
+               .gpio              = TL_WA860RE_GPIO_BTN_ONOFF,
+               .active_low        = 1,
+       },
+};
+
 static struct gpio_led tl_wa801nd_v2_leds_gpio[] __initdata = {
        {
                .name           = "tp-link:green:lan",
@@ -225,6 +284,20 @@ static void  __init tl_wa850re_setup(void)
 MIPS_MACHINE(ATH79_MACH_TL_WA850RE, "TL-WA850RE", "TP-LINK TL-WA850RE",
             tl_wa850re_setup);
 
+static void  __init tl_wa860re_setup(void)
+{
+       tl_ap123_setup();
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa860re_leds_gpio),
+                                tl_wa860re_leds_gpio);
+
+       ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL,
+                                       ARRAY_SIZE(tl_wa860re_gpio_keys),
+                                       tl_wa860re_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WA860RE, "TL-WA860RE", "TP-LINK TL-WA860RE",
+            tl_wa860re_setup);
+
 static void __init tl_wa901nd_v3_setup(void)
 {
        tl_ap123_setup();
index 5bd2cf6..d6516fe 100644 (file)
@@ -202,6 +202,17 @@ endef
 $(eval $(call Profile,TLWA850))
 
 
+define Profile/TLWA860
+       NAME:=TP-LINK TL-WA860RE
+       PACKAGES:=
+endef
+
+define Profile/TLWA860/Description
+       Package set optimized for the TP-LINK TL-WA860RE.
+endef
+$(eval $(call Profile,TLWA860))
+
+
 define Profile/TLWA901
        NAME:=TP-LINK TL-WA901N/ND
        PACKAGES:=
index 4b5f502..a103639 100644 (file)
@@ -1154,6 +1154,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR841NV9,tl-wr841n-v9,TL-WR841N
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR842V2,tl-wr842n-v2,TL-WR842N-v2,ttyS0,115200,0x8420002,1,8Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWA801NV2,tl-wa801nd-v2,TL-WA801ND-v2,ttyS0,115200,0x08010002,1,4Mlzma))
 $(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,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))
diff --git a/target/linux/ar71xx/patches-3.10/715-MIPS-ath79-add-TL-WA860RE-support.patch b/target/linux/ar71xx/patches-3.10/715-MIPS-ath79-add-TL-WA860RE-support.patch
new file mode 100644 (file)
index 0000000..2fdb8fe
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/arch/mips/ath79/machtypes.h      2014-07-13 10:00:11.952353943 +0200
++++ b/arch/mips/ath79/machtypes.h      2014-07-13 10:00:25.312354497 +0200
+@@ -113,6 +113,7 @@
+       ATH79_MACH_TL_WA750RE,          /* TP-LINK TL-WA750RE */
+       ATH79_MACH_TL_WA7510N_V1,       /* TP-LINK TL-WA7510N v1*/
+       ATH79_MACH_TL_WA850RE,          /* TP-LINK TL-WA850RE */
++      ATH79_MACH_TL_WA860RE,          /* TP-LINK TL-WA860RE */
+       ATH79_MACH_TL_WA801ND_V2,       /* TP-LINK TL-WA801ND v2 */
+       ATH79_MACH_TL_WA830RE_V2,       /* TP-LINK TL-WA830RE v2 */
+       ATH79_MACH_TL_WA901ND,          /* TP-LINK TL-WA901ND */