From 7bda7f94da2ba8ded6326c48b5feb1a0bd50aa47 Mon Sep 17 00:00:00 2001 From: Andrew Cameron Date: Sun, 17 Nov 2019 19:40:42 -0600 Subject: [PATCH] ar71xx: add Support for the TP-LINK WBS510 V2.0 Device This adds support for a popular low-cost 5GHz N based AP Specifications: - SoC: Atheros AR9344 - RAM: 64MB - Storage: 8 MB SPI NOR - Wireless: 5GHz 300 Mbps, 2x RP-SMA connector, 27 dBm TX power - Ethernet: 1x 10/100 Mbps with 24V POE IN, 1x 10/100 Mbps Installation: Flash factory image through stock firmware WEB UI or through TFTP To get to TFTP recovery just hold reset button while powering on for around 4-5 seconds and release. Rename factory image to recovery.bin Stock TFTP server IP:192.168.0.100 Stock device TFTP adress:192.168.0.254 Signed-off-by: Andrew Cameron --- target/linux/ar71xx/base-files/etc/board.d/01_leds | 3 +- .../linux/ar71xx/base-files/etc/board.d/02_network | 3 +- .../ar71xx/base-files/etc/board.d/03_gpio_switches | 3 +- target/linux/ar71xx/base-files/lib/ar71xx.sh | 4 +++ .../ar71xx/base-files/lib/upgrade/platform.sh | 3 +- .../ar71xx/files/arch/mips/ath79/mach-cpe510.c | 3 ++ .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/generic-tp-link.mk | 8 ++++++ tools/firmware-utils/src/tplink-safeloader.c | 33 ++++++++++++++++++++++ 9 files changed, 57 insertions(+), 4 deletions(-) --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -260,7 +260,8 @@ cpe510|\ cpe510-v2|\ cpe510-v3|\ wbs210|\ -wbs510) +wbs510|\ +wbs510-v2) ucidef_set_rssimon "wlan0" "200000" "1" ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13" ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13" --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -294,7 +294,8 @@ ar71xx_setup_interfaces() cpe220-v3|\ cpe510|\ wbs210|\ - wbs510) + wbs510|\ + wbs510-v2) ucidef_add_switch "switch0" \ "0@eth0" "5:lan" "4:wan" ;; --- a/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ar71xx/base-files/etc/board.d/03_gpio_switches @@ -14,7 +14,8 @@ cpe210|\ cpe220-v3|\ cpe510|\ wbs210|\ -wbs510) +wbs510|\ +wbs510-v2) ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "20" ;; nanostation-m) --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -1472,6 +1472,10 @@ ar71xx_board_detect() { name="wbs510" tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')" ;; + *"WBS510 v2") + name="wbs510-v2" + tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)" + ;; "WeIO"*) name="weio" ;; --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -602,7 +602,8 @@ platform_check_image() { cpe220-v2|\ cpe610|\ cpe510-v2|\ - cpe510-v3) + cpe510-v3|\ + wbs510-v2) tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0 return 1 ;; --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c @@ -357,3 +357,6 @@ MIPS_MACHINE(ATH79_MACH_WBS210, "WBS210" MIPS_MACHINE(ATH79_MACH_WBS510, "WBS510", "TP-LINK WBS510", wbs_setup); + +MIPS_MACHINE(ATH79_MACH_WBS510_V2, "WBS510V2", "TP-LINK WBS510 v2", + wbs_setup); --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -348,6 +348,7 @@ enum ath79_mach_type { ATH79_MACH_WAM250, /* Samsung WAM250 */ ATH79_MACH_WBS210, /* TP-LINK WBS210 */ ATH79_MACH_WBS510, /* TP-LINK WBS510 */ + ATH79_MACH_WBS510_V2, /* TP-LINK WBS510 v2*/ ATH79_MACH_WEIO, /* WeIO board */ ATH79_MACH_WHR_G301N, /* Buffalo WHR-G301N */ ATH79_MACH_WHR_HP_G300N, /* Buffalo WHR-HP-G300N */ --- a/target/linux/ar71xx/image/generic-tp-link.mk +++ b/target/linux/ar71xx/image/generic-tp-link.mk @@ -271,6 +271,14 @@ define Device/wbs510-v1 endef TARGET_DEVICES += wbs510-v1 +define Device/wbs510-v2 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK WBS510 v2 + BOARDNAME := WBS510V2 + TPLINK_BOARD_ID := WBS510V2 +endef +TARGET_DEVICES += wbs510-v2 + define Device/eap120-v1 DEVICE_TITLE := TP-LINK EAP120 v1 MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware) --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -484,6 +484,39 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "support-list", }, + { + .id = "WBS510V2", + .vendor = "CPE510(TP-LINK|UN|N300-5):1.0\r\n", + .support_list = + "SupportList:\r\n" + "WBS510(TP-LINK|UN|N300-5|00000000):2.0\r\n" + "WBS510(TP-LINK|US|N300-5|55530000):2.0\r\n" + "WBS510(TP-LINK|EU|N300-5|45550000):2.0\r\n" + "WBS510(TP-LINK|CA|N300-5|43410000):2.0\r\n", + .support_trail = '\xff', + .soft_ver = NULL, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"signature", 0x32000, 0x00400}, + {"os-image", 0x40000, 0x1c0000}, + {"file-system", 0x200000, 0x5b0000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x00400}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + /** Firmware layout for the C2600 */ { .id = "C2600",