aredn/patches/001-add_support_for_TP-Link...

147 lines
5.4 KiB
Diff

From e865b19d8d6a642f6f8e0f283afbd9a826aa5c2f Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Sat, 11 Aug 2018 17:12:01 +0200
Subject: [PATCH 1/2] firmware-utils: tplink-safeloader: Add CPE210 v3
Add TP-Link CPE210 v3 to the support list.
Its identical to the v2.
Signed-off-by: Robert Marko <robimarko@gmail.com>
---
tools/firmware-utils/src/tplink-safeloader.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Index: openwrt/tools/firmware-utils/src/tplink-safeloader.c
===================================================================
--- openwrt.orig/tools/firmware-utils/src/tplink-safeloader.c
+++ openwrt/tools/firmware-utils/src/tplink-safeloader.c
@@ -155,7 +155,7 @@ static struct device_info boards[] = {
.last_sysupgrade_partition = "support-list",
},
- /** Firmware layout for the CPE210 V2 */
+ /** Firmware layout for the CPE210 V2 and V3 */
{
.id = "CPE210V2",
.vendor = "CPE210(TP-LINK|UN|N300-2|00000000):2.0\r\n",
@@ -170,7 +170,11 @@ static struct device_info boards[] = {
"CPE210(TP-LINK|US|N300-2|55530000):2.0\r\n"
"CPE210(TP-LINK|UN|N300-2):2.0\r\n"
"CPE210(TP-LINK|EU|N300-2):2.0\r\n"
- "CPE210(TP-LINK|US|N300-2):2.0\r\n",
+ "CPE210(TP-LINK|US|N300-2):2.0\r\n"
+ "CPE210(TP-LINK|EU|N300-2|45550000):3.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2|00000000):3.0\r\n"
+ "CPE210(TP-LINK|UN|N300-2):3.0\r\n"
+ "CPE210(TP-LINK|EU|N300-2):3.0\r\n",
.support_trail = '\xff',
.soft_ver = NULL,
Index: openwrt/target/linux/ar71xx/base-files/etc/board.d/01_leds
===================================================================
--- openwrt.orig/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ openwrt/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -249,6 +249,7 @@ cf-e530n)
;;
cpe210|\
cpe210-v2|\
+cpe210-v3|\
cpe510|\
wbs210|\
wbs510)
@@ -259,7 +260,8 @@ wbs510)
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
case "$board" in
- cpe210-v2)
+ cpe210-v2|\
+ cpe210-v3)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan0" "eth0"
;;
*)
Index: openwrt/target/linux/ar71xx/base-files/etc/board.d/02_network
===================================================================
--- openwrt.orig/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ openwrt/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -75,6 +75,7 @@ ar71xx_setup_interfaces()
cf-e380ac-v1|\
cf-e380ac-v2|\
cpe210-v2|\
+ cpe210-v3|\
dr342|\
eap120|\
eap300v2|\
Index: openwrt/target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- openwrt.orig/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ openwrt/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -583,6 +583,10 @@ ar71xx_board_detect() {
name="cpe210-v2"
tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
;;
+ *"CPE210 v3")
+ name="cpe210-v3"
+ tplink_pharos_board_detect "$(tplink_pharos_v2_get_model_string)"
+ ;;
*"CPE505N")
name="cpe505n"
;;
Index: openwrt/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
===================================================================
--- openwrt.orig/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ openwrt/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -587,7 +587,8 @@ platform_check_image() {
tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0
return 1
;;
- cpe210-v2)
+ cpe210-v2|\
+ cpe210-v3)
tplink_pharos_check_image "$1" "01000000" "$(tplink_pharos_v2_get_model_string)" '\0\xff\r' && return 0
return 1
;;
Index: openwrt/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
===================================================================
--- openwrt.orig/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
+++ openwrt/target/linux/ar71xx/files/arch/mips/ath79/mach-cpe510.c
@@ -236,6 +236,9 @@ MIPS_MACHINE(ATH79_MACH_CPE210, "CPE210"
MIPS_MACHINE(ATH79_MACH_CPE210_V2, "CPE210V2", "TP-LINK CPE210 v2",
cpe210_v2_setup);
+MIPS_MACHINE(ATH79_MACH_CPE210_V3, "CPE210V3", "TP-LINK CPE210 v3",
+ cpe210_v2_setup);
+
MIPS_MACHINE(ATH79_MACH_CPE510, "CPE510", "TP-LINK CPE510/520",
cpe510_setup);
Index: openwrt/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
===================================================================
--- openwrt.orig/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ openwrt/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -75,6 +75,7 @@ enum ath79_mach_type {
ATH79_MACH_CF_E530N, /* COMFAST CF-E530N */
ATH79_MACH_CPE210, /* TP-LINK CPE210 v1 */
ATH79_MACH_CPE210_V2, /* TP-LINK CPE210 v2 */
+ ATH79_MACH_CPE210_V3, /* TP-LINK CPE210 v3 */
ATH79_MACH_CPE505N, /* P&W CPE505N */
ATH79_MACH_CPE510, /* TP-LINK CPE510 */
ATH79_MACH_CPE830, /* YunCore CPE830 */
Index: openwrt/target/linux/ar71xx/image/generic-tp-link.mk
===================================================================
--- openwrt.orig/target/linux/ar71xx/image/generic-tp-link.mk
+++ openwrt/target/linux/ar71xx/image/generic-tp-link.mk
@@ -195,6 +195,13 @@ define Device/cpe210-v2
endef
TARGET_DEVICES += cpe210-v2
+define Device/cpe210-v3
+ $(Device/cpe210-v2)
+ DEVICE_TITLE := TP-LINK CPE210 v3
+ BOARDNAME := CPE210V3
+endef
+TARGET_DEVICES += cpe210-v3
+
define Device/wbs210-v1
$(Device/cpe510-520-v1)
DEVICE_TITLE := TP-LINK WBS210 v1