ar71xx: add support for TP-Link TL-WA855RE v1
authorFederico Cappon <dududede371@gmail.com>
Fri, 9 Jun 2017 15:11:39 +0000 (15:11 +0000)
committerPiotr Dymacz <pepe2k@gmail.com>
Thu, 29 Jun 2017 08:37:36 +0000 (10:37 +0200)
TP-Link TL-WA855RE v1 is a wall-plug N300 Wi-Fi range extender,
based on Qualcomm/Atheros QCA9533 v2.

Short specification:

- 550/397/198 MHz (CPU/DDR/AHB)
- 1x 10/100 Mbps Ethernet
- 32 MB of RAM (DDR1)
- 4 MB of FLASH
- 2T2R 2.4 GHz
- 2x external antennas
- 2x LED (green and orange in the same package), 2x button
- UART: TP5(TX) and TP4(RX) test points on PCB

Flash instruction: use "factory" image directly in vendor GUI.

Warning: this device does not include any kind of recovery mechanism
in the bootloader and disassembling process is not trivial.

You can access vendor firmware over serial line using:
- login: root
- password: sohoadmin

Image was tested only in EU version of the device, but should work
also with the same device version sold in other countries.

Signed-off-by: Federico Cappon <dududede371@gmail.com>
13 files changed:
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/config-4.4
target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
target/linux/ar71xx/files/arch/mips/ath79/Makefile
target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wax50re.c
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
target/linux/ar71xx/image/tp-link.mk
target/linux/ar71xx/mikrotik/config-default
target/linux/ar71xx/nand/config-default
tools/firmware-utils/src/tplink-safeloader.c

index 709030ceb3547514252c96d1f94fe3c88949aa2d..a7a9921fafd26a8e628c9260b40acbec76604931 100755 (executable)
@@ -117,6 +117,7 @@ ar71xx_setup_interfaces()
        tl-wa830re-v2|\
        tl-wa850re|\
        tl-wa850re-v2|\
+       tl-wa855re-v1)|\
        tl-wa901nd|\
        tl-wa901nd-v2|\
        tl-wa901nd-v3|\
index 936a1148d00596cb97148e7e141f15c6a32e99ee..0bb338a5737934c74c3cbb9d920bb47f5bcc0715 100644 (file)
@@ -369,6 +369,7 @@ get_status_led() {
        tl-wa850re-v2)
                status_led="tp-link:blue:re"
                ;;
+       tl-wa855re-v1|\
        tl-wa860re)
                status_led="tp-link:green:power"
                ;;
index ecc8dab36c4cfcbcb294ed18d1c50d0296df485f..3f781a8e5c154c3c187e04d6eeb5c9de6c5f5e7c 100755 (executable)
@@ -234,6 +234,9 @@ tplink_board_detect() {
        "085000"*)
                model="TP-Link TL-WA850RE"
                ;;
+       "085500"*)
+               model="TP-Link TL-WA855RE"
+               ;;
        "086000"*)
                model="TP-Link TL-WA860RE"
                ;;
@@ -1058,6 +1061,9 @@ ar71xx_board_detect() {
        *"TL-WA850RE v2")
                name="tl-wa850re-v2"
                ;;
+       *"TL-WA855RE v1")
+               name="tl-wa855re-v1"
+               ;;
        *"TL-WA860RE")
                name="tl-wa860re"
                ;;
index 60e41c862e2dfdf4e9779564843ccd9b90669be7..454af2c3e6b808230b3300945a593b62d856aa15 100755 (executable)
@@ -411,6 +411,7 @@ platform_check_image() {
        tl-wa830re-v2|\
        tl-wa850re|\
        tl-wa850re-v2|\
+       tl-wa855re-v1|\
        tl-wa860re|\
        tl-wa901nd-v2|\
        tl-wa901nd-v3|\
index 6ff9700cdc33d5a3b2af42f9ad02a088006710e9..8be13e16cdbca51c4fc12c0c2e4bc94e715d53d1 100644 (file)
@@ -183,6 +183,7 @@ CONFIG_ATH79_MACH_TL_WA7210N_V2=y
 CONFIG_ATH79_MACH_TL_WA801ND_V3=y
 CONFIG_ATH79_MACH_TL_WA830RE_V2=y
 CONFIG_ATH79_MACH_TL_WA850RE_V2=y
+CONFIG_ATH79_MACH_TL_WA855RE_V1=y
 CONFIG_ATH79_MACH_TL_WA901ND=y
 CONFIG_ATH79_MACH_TL_WA901ND_V2=y
 CONFIG_ATH79_MACH_TL_WA901ND_V4=y
index 0df5a88dc340dd467eb79ed6e05ef4ea84a46b01..0ae9a11ff654780f0d2033003e5a926ae0a0af8c 100644 (file)
@@ -1503,6 +1503,15 @@ config ATH79_MACH_TL_WA850RE_V2
        select ATH79_DEV_M25P80
        select ATH79_DEV_WMAC
 
+config ATH79_MACH_TL_WA855RE_V1
+       bool "TP-LINK TL-WA855RE V1 support"
+       select SOC_QCA953X
+       select ATH79_DEV_ETH
+       select ATH79_DEV_GPIO_BUTTONS
+       select ATH79_DEV_LEDS_GPIO
+       select ATH79_DEV_M25P80
+       select ATH79_DEV_WMAC
+
 config ATH79_MACH_TL_WA901ND
        bool "TP-LINK TL-WA901ND/TL-WA7510N support"
        select SOC_AR724X
index 5a848d03994876d54b1e6694fc419b0f2b84e796..869920ca30858eba59deef0a64233a89a2588b59 100644 (file)
@@ -188,6 +188,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WA7210N_V2)              += mach-tl-wa7210n-v2.o
 obj-$(CONFIG_ATH79_MACH_TL_WA801ND_V3)         += mach-tl-wa801nd-v3.o
 obj-$(CONFIG_ATH79_MACH_TL_WA830RE_V2)         += mach-tl-wa830re-v2.o
 obj-$(CONFIG_ATH79_MACH_TL_WA850RE_V2)         += mach-tl-wax50re.o
+obj-$(CONFIG_ATH79_MACH_TL_WA855RE_V1)         += mach-tl-wax50re.o
 obj-$(CONFIG_ATH79_MACH_TL_WA901ND)            += mach-tl-wa901nd.o
 obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V2)         += mach-tl-wa901nd-v2.o
 obj-$(CONFIG_ATH79_MACH_TL_WA901ND_V4)         += mach-tl-wa901nd-v4.o
index d7a1af4e2c178a8a8e3c7e062579938afe0e22a6..955628fecb0aa8d09e493e416e30a01d4e495467 100644 (file)
@@ -3,11 +3,14 @@
  *  - TL-WA750RE v1
  *  - TL-WA801ND v2
  *  - TL-WA850RE v1/v2
+ *  - TL-WA855RE v1
  *  - TL-WA901ND v3
  *
  *  Copyright (C) 2013 Martijn Zilverschoon <thefriedzombie@gmail.com>
  *  Copyright (C) 2013 Jiri Pirko <jiri@resnulli.us>
  *  Copyright (C) 2017 Piotr Dymacz <pepe2k@gmail.com>
+ *  Copyright (C) 2017 Federico Cappon <dududede371@gmail.com>
+ *  Copyright (C) 2017 Nicolò Veronese <nicveronese@gmail.com>
  *
  *  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
@@ -48,6 +51,9 @@
 
 #define TL_WA850RE_V2_GPIO_ENABLE_LEDS 15
 
+#define TL_WA855REV1_GPIO_LED_RED      11
+#define TL_WA855REV1_GPIO_LED_GREEN    12
+
 #define TL_WA860RE_GPIO_LED_WLAN_ORANGE        0
 #define TL_WA860RE_GPIO_LED_WLAN_GREEN 2
 #define TL_WA860RE_GPIO_LED_POWER_ORANGE       12
@@ -184,6 +190,18 @@ static struct gpio_led tl_wa850re_v2_leds_gpio[] __initdata = {
        },
 };
 
+static struct gpio_led tl_wa855re_v1_leds_gpio[] __initdata = {
+        {
+               .name           = "tp-link:green:power",
+               .gpio           = TL_WA855REV1_GPIO_LED_GREEN,
+               .active_low     = 0,
+       }, {
+               .name           = "tp-link:red:power",
+               .gpio           = TL_WA855REV1_GPIO_LED_RED,
+               .active_low     = 0,
+       },
+};
+
 static struct gpio_led tl_wa860re_leds_gpio[] __initdata = {
        {
                .name           = "tp-link:green:lan",
@@ -383,6 +401,21 @@ static void  __init tl_wa850re_v2_setup(void)
 MIPS_MACHINE(ATH79_MACH_TL_WA850RE_V2, "TL-WA850RE-V2",
             "TP-LINK TL-WA850RE v2", tl_wa850re_v2_setup);
 
+static void __init tl_wa855re_v1_setup(void)
+{
+       tl_ap143_setup();
+
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wa855re_v1_leds_gpio),
+                                tl_wa855re_v1_leds_gpio);
+
+       ath79_register_gpio_keys_polled(-1, TL_WAX50RE_KEYS_POLL_INTERVAL,
+                                       ARRAY_SIZE(tl_wax50re_gpio_keys),
+                                       tl_wax50re_gpio_keys);
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_WA855RE_V1, "TL-WA855RE-v1", "TP-LINK TL-WA855RE v1",
+            tl_wa855re_v1_setup);
+
 static void  __init tl_wa860re_setup(void)
 {
        tl_ap123_setup();
index 8d0dfd662b9e2ac9b9611dc9a71b9e15cd1f4400..618abfb1dce8144ceba3f592306cbe79eb3ad079 100644 (file)
@@ -226,6 +226,7 @@ enum ath79_mach_type {
        ATH79_MACH_TL_WA830RE_V2,               /* TP-LINK TL-WA830RE v2 */
        ATH79_MACH_TL_WA850RE,                  /* TP-LINK TL-WA850RE */
        ATH79_MACH_TL_WA850RE_V2,               /* TP-LINK TL-WA850RE v2 */
+       ATH79_MACH_TL_WA855RE_V1,               /* TP-LINK TL-WA855RE v1 */
        ATH79_MACH_TL_WA860RE,                  /* TP-LINK TL-WA860RE */
        ATH79_MACH_TL_WA901ND,                  /* TP-LINK TL-WA901ND */
        ATH79_MACH_TL_WA901ND_V2,               /* TP-LINK TL-WA901ND v2 */
index a9c3cdd9610799c2e7057d17a8a1e669e173a05b..243c15a858d09c21d20a5995d955da92ae737f9c 100644 (file)
@@ -496,18 +496,31 @@ define Device/tl-wa850re-v1
   TPLINK_HWID := 0x08500001
 endef
 
-define Device/tl-wa850re-v2
+define Device/tl-wa85xre
   $(Device/tplink)
+  KERNEL := kernel-bin | patch-cmdline | lzma | mktplinkfw-kernel
+  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+  MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware)
+endef
+
+define Device/tl-wa850re-v2
+  $(Device/tl-wa85xre)
   DEVICE_TITLE := TP-LINK TL-WA850RE v2
   DEVICE_PACKAGES := rssileds
   BOARDNAME := TL-WA850RE-V2
   DEVICE_PROFILE := TLWA850
   TPLINK_BOARD_NAME := TLWA850REV2
   TPLINK_HWID := 0x08500002
-  KERNEL := kernel-bin | patch-cmdline | lzma | mktplinkfw-kernel
-  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
-  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
-  MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware)
+endef
+
+define Device/tl-wa855re-v1
+  $(Device/tl-wa85xre)
+  DEVICE_TITLE := TP-LINK TL-WA855RE v1
+  BOARDNAME := TL-WA855RE-v1
+  DEVICE_PROFILE := TLWA855RE
+  TPLINK_HWID := 0x08550001
+  TPLINK_BOARD_NAME := TLWA855REV1
 endef
 
 define Device/tl-wa860re-v1
@@ -517,7 +530,7 @@ define Device/tl-wa860re-v1
   DEVICE_PROFILE := TLWA860
   TPLINK_HWID := 0x08600001
 endef
-TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa801nd-v3 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa850re-v2 tl-wa860re-v1
+TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa801nd-v3 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa850re-v2 tl-wa855re-v1 tl-wa860re-v1
 
 define Device/tl-wa901nd-v1
   $(Device/tplink-4m)
index d0c8e49189c982f593905f8bbcc5003d76ae6fd0..6b87871b9aa636b5332eba393b2eabdc0a9c8b09 100644 (file)
@@ -146,6 +146,7 @@ CONFIG_ATH79_MACH_RBSXTLITE=y
 # CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set
 # CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set
 # CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set
 # CONFIG_ATH79_MACH_TL_WA901ND is not set
 # CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set
 # CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set
index 8420e15fb40459d3ed7a2b3b1f7185a69c431d86..0e1827663a176aebd9f96db1f9448e2658a1c93f 100644 (file)
@@ -135,6 +135,7 @@ CONFIG_ATH79_MACH_RAMBUTAN=y
 # CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set
 # CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set
 # CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set
+# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set
 # CONFIG_ATH79_MACH_TL_WA901ND is not set
 # CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set
 # CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set
index d2a1cb69ed317ec32754ce7eacfb56269c96098f..b1c95d2b7e99beb759a31d099fdffeecae330bec 100644 (file)
@@ -558,6 +558,45 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system"
        },
 
+       /** Firmware layout for the TL-WA855RE v1 */
+       {
+               .id     = "TLWA855REV1",
+               .vendor = "",
+               .support_list =
+                       "SupportList:\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:00000000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:55530000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:45550000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:4B520000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:42520000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:4A500000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:43410000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:41550000}\n"
+                       "{product_name:TL-WA855RE,product_ver:1.0.0,special_id:52550000}\n",
+               .support_trail = '\x00',
+               .soft_ver = NULL,
+
+               .partitions = {
+                       {"fs-uboot", 0x00000, 0x20000},
+                       {"os-image", 0x20000, 0x150000},
+                       {"file-system", 0x170000, 0x240000},
+                       {"partition-table", 0x3b0000, 0x02000},
+                       {"default-mac", 0x3c0000, 0x00020},
+                       {"pin", 0x3c0100, 0x00020},
+                       {"product-info", 0x3c1000, 0x01000},
+                       {"soft-version", 0x3c2000, 0x00100},
+                       {"support-list", 0x3c3000, 0x01000},
+                       {"profile", 0x3c4000, 0x08000},
+                       {"user-config", 0x3d0000, 0x10000},
+                       {"default-config", 0x3e0000, 0x10000},
+                       {"radio", 0x3f0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system"
+       },
+
        /** Firmware layout for the TL-WR1043 v4 */
        {
                .id     = "TLWR1043NDV4",