ar71xx: add support for TP-Link RE355
authorHenryk Heisig <hyniu@o2.pl>
Tue, 6 Feb 2018 21:08:28 +0000 (22:08 +0100)
committerJohn Crispin <john@phrozen.org>
Tue, 13 Feb 2018 08:21:20 +0000 (09:21 +0100)
This device is identical as TP-Link RE450
RE355 is a dual-band AC1200 router, based on Qualcomm/Atheros
QCA9558+QCA9880.

Specification:

720/600/200 MHz (CPU/DDR/AHB)
64/128 MB of RAM (DDR2)
8 MB of FLASH (SPI NOR)
3T3R 2.4 GHz
3T3R 5 GHz
1x 10/100/1000 Mbps Ethernet
7x LED, 3x button
UART header on PCB

Flash instruction:
Web:
Download lede-ar71xx-generic-archer-c60-v2-squashfs-factory.bin
and use OEM System Tools - Firmware Upgrade site.

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
15 files changed:
target/linux/ar71xx/base-files/etc/board.d/01_leds
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
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/config-4.9
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-re450.c
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
target/linux/ar71xx/generic/config-default
target/linux/ar71xx/image/generic-tp-link.mk
tools/firmware-utils/src/tplink-safeloader.c

index a3154db7ed192e4941ca95f56e20321d2a018fc7..c45376f9e4584ab757514f3903e3a281bcac0ea3 100755 (executable)
@@ -616,6 +616,7 @@ rb-wap-2nd)
        ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
        ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
        ;;
        ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000"
        ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt"
        ;;
+re355|\
 re450)
        ucidef_set_led_netdev "lan_data" "LAN Data" "$board:green:lan_data" "eth0" "tx rx"
        ucidef_set_led_netdev "lan_link" "LAN Link" "$board:green:lan_link" "eth0" "link"
 re450)
        ucidef_set_led_netdev "lan_data" "LAN Data" "$board:green:lan_data" "eth0" "tx rx"
        ucidef_set_led_netdev "lan_link" "LAN Link" "$board:green:lan_link" "eth0" "link"
index 435d413c63e54197bd96bb3a193f913bd604730c..b208f38b5ea99c427dacf719d264cfb1a94ba2db 100755 (executable)
@@ -107,6 +107,7 @@ ar71xx_setup_interfaces()
        rb-sxt5n|\
        rb-wap-2nd|\
        rb-wapg-5hact2hnd|\
        rb-sxt5n|\
        rb-wap-2nd|\
        rb-wapg-5hact2hnd|\
+       re355|\
        re450|\
        rocket-m-xw|\
        sc300m |\
        re450|\
        rocket-m-xw|\
        sc300m |\
index 2e9fd1d637263c3b605c871d0bf6a2d25c55f8d6..3b5fc32298420bc15b38fd39309b6e2645279c7a 100644 (file)
@@ -359,6 +359,7 @@ get_status_led() {
        rb-sxt5n)
                status_led="rb:green:power"
                ;;
        rb-sxt5n)
                status_led="rb:green:power"
                ;;
+       re355|\
        re450|\
        sc300m)
                status_led="$board:blue:power"
        re450|\
        sc300m)
                status_led="$board:blue:power"
index ca90563d25274440ef2b05b499c342157223c6c5..8284550e929f099ce90fbc04274313ba46daf094 100644 (file)
@@ -106,6 +106,7 @@ case "$FIRMWARE" in
        rb-wapg-5hact2hnd)
                ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116
                ;;
        rb-wapg-5hact2hnd)
                ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116
                ;;
+       re355|\
        re450|\
        tl-wr902ac-v1)
                ath10kcal_extract "art" 20480 2116
        re450|\
        tl-wr902ac-v1)
                ath10kcal_extract "art" 20480 2116
index 267c575545765211263d0fabd75e695c41269034..7c7a0e267406207a55a3ccdc4cdb63b48814b88b 100755 (executable)
@@ -871,6 +871,9 @@ ar71xx_board_detect() {
        *"Rambutan"*)
                name="rambutan"
                ;;
        *"Rambutan"*)
                name="rambutan"
                ;;
+       *"RE355")
+               name="re355"
+               ;;
        *"RE450")
                name="re450"
                ;;
        *"RE450")
                name="re450"
                ;;
index 21e387389d4ce2cf1200d35c9759d6bf1c8a2a4b..946a8860712a0ff408ab1ba9674f750db6cc3c4f 100755 (executable)
@@ -390,6 +390,7 @@ platform_check_image() {
        omy-x1|\
        onion-omega|\
        oolite|\
        omy-x1|\
        onion-omega|\
        oolite|\
+       re355|\
        re450|\
        rut900|\
        smart-300|\
        re450|\
        rut900|\
        smart-300|\
index a952476f1803e02044cb689c7e9fa24d39de5037..447ab01dae27035b5cd6b09e62b87f1312ac0c37 100644 (file)
@@ -168,6 +168,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_RB95X is not set
 # CONFIG_ATH79_MACH_RBSPI is not set
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
 # CONFIG_ATH79_MACH_RB95X is not set
 # CONFIG_ATH79_MACH_RBSPI is not set
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
+# CONFIG_ATH79_MACH_RE355 is not set
 # CONFIG_ATH79_MACH_RE450 is not set
 # CONFIG_ATH79_MACH_RUT9XX is not set
 # CONFIG_ATH79_MACH_RW2458N is not set
 # CONFIG_ATH79_MACH_RE450 is not set
 # CONFIG_ATH79_MACH_RUT9XX is not set
 # CONFIG_ATH79_MACH_RW2458N is not set
index d0cfa462bff45449c1f6fa8d5130bad60f2bfb98..e5fce99b19818fb2015bcfb34d9759097d535827 100644 (file)
@@ -166,6 +166,7 @@ CONFIG_ATH79=y
 # CONFIG_ATH79_MACH_RB95X is not set
 # CONFIG_ATH79_MACH_RBSPI is not set
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
 # CONFIG_ATH79_MACH_RB95X is not set
 # CONFIG_ATH79_MACH_RBSPI is not set
 # CONFIG_ATH79_MACH_RBSXTLITE is not set
+# CONFIG_ATH79_MACH_RE355 is not set
 # CONFIG_ATH79_MACH_RE450 is not set
 # CONFIG_ATH79_MACH_RUT9XX is not set
 # CONFIG_ATH79_MACH_RW2458N is not set
 # CONFIG_ATH79_MACH_RE450 is not set
 # CONFIG_ATH79_MACH_RUT9XX is not set
 # CONFIG_ATH79_MACH_RW2458N is not set
index 20eb21010528d41ae9bc3ecfd916bc74f3be0544..eda1e4002b83870c84abeb40feb36551b87e7912 100644 (file)
@@ -1305,6 +1305,16 @@ config ATH79_MACH_MZK_W300NH
        select ATH79_DEV_M25P80
        select ATH79_DEV_WMAC
 
        select ATH79_DEV_M25P80
        select ATH79_DEV_WMAC
 
+config ATH79_MACH_RE355
+       bool "TP-LINK RE355 board support"
+       select SOC_QCA955X
+       select ATH79_DEV_AP9X_PCI if PCI
+       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_RE450
        bool "TP-LINK RE450 board support"
        select SOC_QCA955X
 config ATH79_MACH_RE450
        bool "TP-LINK RE450 board support"
        select SOC_QCA955X
index 9be721ac208fa9dbda9ef31cbcc750ddbab2b7ee..27ef57d1675312163b915295c063b0309e153f9e 100644 (file)
@@ -177,6 +177,7 @@ obj-$(CONFIG_ATH79_MACH_RB941)                      += mach-rb941.o
 obj-$(CONFIG_ATH79_MACH_RB95X)                 += mach-rb95x.o
 obj-$(CONFIG_ATH79_MACH_RBSPI)                 += mach-rbspi.o
 obj-$(CONFIG_ATH79_MACH_RBSXTLITE)             += mach-rbsxtlite.o
 obj-$(CONFIG_ATH79_MACH_RB95X)                 += mach-rb95x.o
 obj-$(CONFIG_ATH79_MACH_RBSPI)                 += mach-rbspi.o
 obj-$(CONFIG_ATH79_MACH_RBSXTLITE)             += mach-rbsxtlite.o
+obj-$(CONFIG_ATH79_MACH_RE355)                 += mach-re450.o
 obj-$(CONFIG_ATH79_MACH_RE450)                 += mach-re450.o
 obj-$(CONFIG_ATH79_MACH_RUT9XX)                        += mach-rut9xx.o
 obj-$(CONFIG_ATH79_MACH_RW2458N)               += mach-rw2458n.o
 obj-$(CONFIG_ATH79_MACH_RE450)                 += mach-re450.o
 obj-$(CONFIG_ATH79_MACH_RUT9XX)                        += mach-rut9xx.o
 obj-$(CONFIG_ATH79_MACH_RW2458N)               += mach-rw2458n.o
index 25de6e729fe61d42b40d8ed8bdc0f5952c51ce21..991aa1c9a92ca4876190df8532a37f072b4ac846 100644 (file)
@@ -1,9 +1,10 @@
 /*
 /*
- * TP-LINK Archer RE450 board support
+ * TP-LINK RE355/RE450 board support
  *
  * Copyright (c) 2013 Gabor Juhos <juhosg@openwrt.org>
  * Copyright (c) 2016 Tal Keren <kooolk@gmail.com>
  *
  * Copyright (c) 2013 Gabor Juhos <juhosg@openwrt.org>
  * Copyright (c) 2016 Tal Keren <kooolk@gmail.com>
- *
+ * Copyright (c) 2018 Henryk Heisig <hyniu@o2.pl>
+ * 
  * Based on the Qualcomm Atheros AP135/AP136 reference board support code
  *   Copyright (c) 2012 Qualcomm Atheros
  *
  * Based on the Qualcomm Atheros AP135/AP136 reference board support code
  *   Copyright (c) 2012 Qualcomm Atheros
  *
@@ -72,6 +73,42 @@ static struct flash_platform_data tl_re450_flash_data = {
        .part_probes    = tl_re450_part_probes,
 };
 
        .part_probes    = tl_re450_part_probes,
 };
 
+static struct gpio_led re355_leds_gpio[] __initdata = {
+       {
+               .name           = "re355:blue:power",
+               .gpio           = RE450_GPIO_LED_SYSTEM,
+               .active_low     = 1,
+       },
+       {
+               .name           = "re355:blue:wlan2g",
+               .gpio           = RE450_GPIO_LED_WLAN2G,
+               .active_low     = 1,
+       },
+       {
+               .name           = "re355:blue:wlan5g",
+               .gpio           = RE450_GPIO_LED_WLAN5G,
+               .active_low     = 1,
+       },
+       {
+               .name           = "re355:blue:wps",
+               .gpio           = RE450_GPIO_LED_JUMPSTART,
+       },
+       {
+               .name           = "re355:red:wps",
+               .gpio           = RE450_GPIO_LED_JUMPSTART_RED,
+       },
+       {
+               .name           = "re355:green:lan_data",
+               .gpio           = RE450_GPIO_LED_LAN_DATA,
+               .active_low     = 1,
+       },
+       {
+               .name           = "re355:green:lan_link",
+               .gpio           = RE450_GPIO_LED_LAN_LINK,
+               .active_low     = 1,
+       },
+};
+
 static struct gpio_led re450_leds_gpio[] __initdata = {
        {
                .name           = "re450:blue:power",
 static struct gpio_led re450_leds_gpio[] __initdata = {
        {
                .name           = "re450:blue:power",
@@ -149,15 +186,13 @@ static struct platform_device re450_phy_device = {
        },
 };
 
        },
 };
 
-static void __init re450_setup(void)
+static void __init rex5x_setup(void)
 {
        u8 *mac = (u8 *) KSEG1ADDR(0x1f610008);
        u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
        u8 tmpmac[ETH_ALEN];
 
        ath79_register_m25p80(&tl_re450_flash_data);
 {
        u8 *mac = (u8 *) KSEG1ADDR(0x1f610008);
        u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
        u8 tmpmac[ETH_ALEN];
 
        ath79_register_m25p80(&tl_re450_flash_data);
-       ath79_register_leds_gpio(-1, ARRAY_SIZE(re450_leds_gpio),
-                                re450_leds_gpio);
        ath79_register_gpio_keys_polled(-1, RE450_KEYS_POLL_INTERVAL,
                                        ARRAY_SIZE(re450_gpio_keys),
                                        re450_gpio_keys);
        ath79_register_gpio_keys_polled(-1, RE450_KEYS_POLL_INTERVAL,
                                        ARRAY_SIZE(re450_gpio_keys),
                                        re450_gpio_keys);
@@ -183,5 +218,22 @@ static void __init re450_setup(void)
        ath79_register_eth(0);
 }
 
        ath79_register_eth(0);
 }
 
+static void __init re355_setup(void)
+{
+       rex5x_setup();
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(re355_leds_gpio),
+                                re355_leds_gpio);
+}
+
+MIPS_MACHINE(ATH79_MACH_RE355, "RE355", "TP-LINK RE355",
+            re355_setup)
+
+static void __init re450_setup(void)
+{
+       rex5x_setup();
+       ath79_register_leds_gpio(-1, ARRAY_SIZE(re450_leds_gpio),
+                                re450_leds_gpio);
+}
+
 MIPS_MACHINE(ATH79_MACH_RE450, "RE450", "TP-LINK RE450",
             re450_setup)
 MIPS_MACHINE(ATH79_MACH_RE450, "RE450", "TP-LINK RE450",
             re450_setup)
index 7434f340af3e71bcb95d4186a670afaece7cdcd6..27269e54d6ed42120b37e419eb77ba9db67f54e6 100644 (file)
@@ -207,6 +207,7 @@ enum ath79_mach_type {
        ATH79_MACH_RB_WAPAC,                    /* Mikrotik RouterBOARD wAPG-5HacT2HnD */
        ATH79_MACH_RB_SXTLITE2ND,               /* Mikrotik RouterBOARD SXT Lite 2nD */
        ATH79_MACH_RB_SXTLITE5ND,               /* Mikrotik RouterBOARD SXT Lite 5nD */
        ATH79_MACH_RB_WAPAC,                    /* Mikrotik RouterBOARD wAPG-5HacT2HnD */
        ATH79_MACH_RB_SXTLITE2ND,               /* Mikrotik RouterBOARD SXT Lite 2nD */
        ATH79_MACH_RB_SXTLITE5ND,               /* Mikrotik RouterBOARD SXT Lite 5nD */
+       ATH79_MACH_RE355,                       /* TP-LINK RE355 */
        ATH79_MACH_RE450,                       /* TP-LINK RE450 */
        ATH79_MACH_RUT9XX,                      /* Teltonika RUT900 series */
        ATH79_MACH_RW2458N,                     /* Redwave RW2458N */
        ATH79_MACH_RE450,                       /* TP-LINK RE450 */
        ATH79_MACH_RUT9XX,                      /* Teltonika RUT900 series */
        ATH79_MACH_RW2458N,                     /* Redwave RW2458N */
index 42df64d7809ceeb0e68b52ca2f3adbddfba14629..892d33dc8ce43dfad60d652517545c38918e37f4 100644 (file)
@@ -125,6 +125,7 @@ CONFIG_ATH79_MACH_PQI_AIR_PEN=y
 CONFIG_ATH79_MACH_QIHOO_C301=y
 CONFIG_ATH79_MACH_R36A=y
 CONFIG_ATH79_MACH_R602N=y
 CONFIG_ATH79_MACH_QIHOO_C301=y
 CONFIG_ATH79_MACH_R36A=y
 CONFIG_ATH79_MACH_R602N=y
+CONFIG_ATH79_MACH_RE355=y
 CONFIG_ATH79_MACH_RE450=y
 CONFIG_ATH79_MACH_RUT9XX=y
 CONFIG_ATH79_MACH_RW2458N=y
 CONFIG_ATH79_MACH_RE450=y
 CONFIG_ATH79_MACH_RUT9XX=y
 CONFIG_ATH79_MACH_RW2458N=y
index b0d99e2599a5d02f8949bb97814af72898f78f8d..48eed6b15ba072a7ce49079e8e54be925463ceff 100644 (file)
@@ -184,6 +184,25 @@ define Device/eap120-v1
 endef
 TARGET_DEVICES += eap120-v1
 
 endef
 TARGET_DEVICES += eap120-v1
 
+define Device/re355-v1
+  DEVICE_TITLE := TP-LINK RE355 v1
+  DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
+  MTDPARTS := spi0.0:128k(u-boot)ro,6016k(firmware),64k(partition-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro
+  IMAGE_SIZE := 7936k
+  BOARDNAME := RE355
+  TPLINK_BOARD_ID := RE355
+  DEVICE_PROFILE := RE355
+  LOADER_TYPE := elf
+  TPLINK_HWID := 0x0
+  TPLINK_HWREV := 0
+  TPLINK_HEADER_VERSION := 1
+  KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef
+TARGET_DEVICES += re355-v1
+
 define Device/re450-v1
   DEVICE_TITLE := TP-LINK RE450 v1
   DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
 define Device/re450-v1
   DEVICE_TITLE := TP-LINK RE450 v1
   DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
index 88e2e88bdf3072f4e3c7a9c6b058fe8579d5a802..c96edb4609c4e36e987bb1eb29e1240568038dc7 100644 (file)
@@ -871,6 +871,49 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system"
        },
 
                .last_sysupgrade_partition = "file-system"
        },
 
+       /** Firmware layout for the RE355 */
+       {
+               .id = "RE355",
+               .vendor = "",
+               .support_list =
+                       "SupportList:\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:00000000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:55530000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:45550000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:4A500000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:43410000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:41550000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:4B520000}\r\n"
+                       "{product_name:RE355,product_ver:1.0.0,special_id:55534100}\r\n",
+               .support_trail = '\x00',
+               .soft_ver = NULL,
+
+               /**
+                  The flash partition table for RE355;
+                  it is almost the same as the one used by the stock images,
+                  576KB were moved from file-system to os-image.
+               */
+               .partitions = {
+                       {"fs-uboot", 0x00000, 0x20000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0x460000},
+                       {"partition-table", 0x600000, 0x02000},
+                       {"default-mac", 0x610000, 0x00020},
+                       {"pin", 0x610100, 0x00020},
+                       {"product-info", 0x611100, 0x01000},
+                       {"soft-version", 0x620000, 0x01000},
+                       {"support-list", 0x621000, 0x01000},
+                       {"profile", 0x622000, 0x08000},
+                       {"user-config", 0x630000, 0x10000},
+                       {"default-config", 0x640000, 0x10000},
+                       {"radio", 0x7f0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system"
+       },
+
        /** Firmware layout for the RE450 */
        {
                .id = "RE450",
        /** Firmware layout for the RE450 */
        {
                .id = "RE450",