aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-12 14:43:15 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-03-18 13:49:06 +0100
commit646d95c374072598fab9e949ef4425177c5c7960 (patch)
treebdb73967eab4e76ae6b5819738d7e61227788b03 /target/linux
parent8cacb84041e92e4e4d14057e708b6f232d106a50 (diff)
downloadupstream-646d95c374072598fab9e949ef4425177c5c7960.tar.gz
upstream-646d95c374072598fab9e949ef4425177c5c7960.tar.bz2
upstream-646d95c374072598fab9e949ef4425177c5c7960.zip
ath79: add support for TP-Link Archer C60 v3
TP-Link Archer C60 v3 is a dual-band AC1350 router, based on Qualcomm/Atheros QCA9561 + QCA9886. It seems to be identical to the v2 revision, except that it lacks a WPS LED and has different GPIO for amber WAN LED. Specification: - 775/650/258 MHz (CPU/DDR/AHB) - 64 MB of RAM (DDR2) - 8 MB of FLASH (SPI NOR) - 3T3R 2.4 GHz - 2T2R 5 GHz - 5x 10/100 Mbps Ethernet - 6x LED, 2x button - UART header on PCB Flash instruction (WebUI): Download *-factory.bin image and upload it via the firmwary upgrade function of the stock firmware WebUI. Flash instruction (TFTP): 1. Set PC to fixed IP address 192.168.0.66 2. Download *-factory.bin image and rename it to tp_recovery.bin 3. Start a tftp server with the file tp_recovery.bin in its root directory 4. Turn off the router 5. Press and hold reset button 6. Turn on router with the reset button pressed and wait ~15 seconds 7. Release the reset button and after a short time the firmware should be transferred from the tftp server 8. Wait ~30 second to complete recovery While TFTP works for OpenWrt images, my device didn't accept the only available official firmware "Archer C60(EU)_V3.0_190115.bin". In contrast to earlier revisions (v2), the v3 contains the (same) MAC address twice, once in 0x1fa08 and again in 0x1fb08. While the partition-table on the device refers to the latter, the firmware image contains a different partition-table for that region: name device firmware factory-boot 0x00000-0x1fb00 0x00000-0x1fa00 default-mac 0x1fb00-0x1fd00 0x1fa00-0x1fc00 pin 0x1fd00-0x1fe00 0x1fc00-0x1fd00 product-info 0x1fe00-0x1ff00 0x1fd00-0x1ff00 device-id 0x1ff00-0x20000 0x1ff00-0x20000 While the MAC address is present twice, other data like the PIN isn't, so with the partitioning from the firmware image the PIN on the device would actually be outside of its partition. Consequently, the patch uses the MAC location from the device (which is the same as for the v2). Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts12
-rw-r--r--target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts12
-rw-r--r--target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts69
-rw-r--r--target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi12
-rwxr-xr-xtarget/linux/ath79/generic/base-files/etc/board.d/01_leds3
-rwxr-xr-xtarget/linux/ath79/generic/base-files/etc/board.d/02_network1
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata1
-rw-r--r--target/linux/ath79/image/generic-tp-link.mk11
8 files changed, 109 insertions, 12 deletions
diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts
index 85e456bb44..a83b5881d4 100644
--- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts
+++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v1.dts
@@ -8,6 +8,18 @@
model = "TP-Link Archer C60 v1";
};
+&leds {
+ wan_amber {
+ label = "tp-link:amber:wan";
+ gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+ };
+
+ wps {
+ label = "tp-link:green:wps";
+ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ };
+};
+
&spi {
status = "okay";
num-cs = <1>;
diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts
index 29f916734e..c19e4e973d 100644
--- a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts
+++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v2.dts
@@ -8,6 +8,18 @@
model = "TP-Link Archer C60 v2";
};
+&leds {
+ wan_amber {
+ label = "tp-link:amber:wan";
+ gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+ };
+
+ wps {
+ label = "tp-link:green:wps";
+ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ };
+};
+
&spi {
status = "okay";
num-cs = <1>;
diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts
new file mode 100644
index 0000000000..444d54b000
--- /dev/null
+++ b/target/linux/ath79/dts/qca9561_tplink_archer-c60-v3.dts
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "qca9561_tplink_archer-c6x.dtsi"
+
+/ {
+ compatible = "tplink,archer-c60-v3", "qca,qca9561";
+ model = "TP-Link Archer C60 v3";
+};
+
+&leds {
+ wan_amber {
+ label = "tp-link:amber:wan";
+ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ };
+};
+&spi {
+ status = "okay";
+
+ num-cs = <1>;
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <25000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "factory-boot";
+ reg = <0x000000 0x01fb00>;
+ read-only;
+ };
+
+ mac: partition@1fb00 {
+ label = "mac";
+ reg = <0x01fb00 0x000500>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "u-boot";
+ reg = <0x020000 0x010000>;
+ read-only;
+ };
+
+ partition@30000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x030000 0x7a0000>;
+ };
+
+ partition@7d0000 {
+ label = "tplink";
+ reg = <0x7d0000 0x020000>;
+ read-only;
+ };
+
+ art: partition@7f0000 {
+ label = "art";
+ reg = <0x7f0000 0x010000>;
+ read-only;
+ };
+ };
+ };
+};
diff --git a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi
index abbccea08f..b1b166d89a 100644
--- a/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi
+++ b/target/linux/ath79/dts/qca9561_tplink_archer-c6x.dtsi
@@ -34,7 +34,7 @@
};
};
- leds {
+ leds: leds {
compatible = "gpio-leds";
led_power: power {
@@ -60,20 +60,10 @@
gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
};
- wan_amber {
- label = "tp-link:amber:wan";
- gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
- };
-
lan {
label = "tp-link:green:lan";
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
};
-
- wps {
- label = "tp-link:green:wps";
- gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
- };
};
};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index cf9dfd2b0d..3864423e58 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -177,7 +177,8 @@ tplink,archer-c58-v1|\
tplink,archer-c59-v1|\
tplink,archer-c59-v2|\
tplink,archer-c60-v1|\
-tplink,archer-c60-v2)
+tplink,archer-c60-v2|\
+tplink,archer-c60-v3)
ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x1E"
ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
;;
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 79313e9170..33a4b0e884 100755
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -81,6 +81,7 @@ ath79_setup_interfaces()
tplink,archer-c25-v1|\
tplink,archer-c60-v1|\
tplink,archer-c60-v2|\
+ tplink,archer-c60-v3|\
tplink,tl-wdr3500-v1|\
tplink,tl-wr842n-v1|\
tplink,tl-wr842n-v3|\
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index ce8531d5ce..43c2f9ced5 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -167,6 +167,7 @@ case "$FIRMWARE" in
tplink,archer-c59-v2|\
tplink,archer-c60-v1|\
tplink,archer-c60-v2|\
+ tplink,archer-c60-v3|\
tplink,archer-c6-v2|\
tplink,archer-c6-v2-us)
caldata_extract "art" 0x5000 0x2f20
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index 33a8ee3f44..ffa445697c 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -135,6 +135,17 @@ define Device/tplink_archer-c60-v2
endef
TARGET_DEVICES += tplink_archer-c60-v2
+define Device/tplink_archer-c60-v3
+ $(Device/tplink-safeloader-uimage)
+ SOC := qca9561
+ IMAGE_SIZE := 7808k
+ DEVICE_MODEL := Archer C60
+ DEVICE_VARIANT := v3
+ TPLINK_BOARD_ID := ARCHER-C60-V3
+ DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9888-ct
+endef
+TARGET_DEVICES += tplink_archer-c60-v3
+
define Device/tplink_archer-c7-v1
$(Device/tplink-8mlzma)
SOC := qca9558