ath79: add support for TP-Link TL-WDR6500 v2 rft-devices
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 15 Apr 2020 21:12:31 +0000 (23:12 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 25 Jan 2021 17:55:00 +0000 (18:55 +0100)
This ports the TP-Link TL-WDR6500 v2 from ar71xx to ath79.

Specifications:

  SoC: QCA9561
  CPU: 750 MHz
  Flash: 8 MiB (Winbond W25Q64FVSIG)
  RAM: 128 MiB
  WiFi 2.4 GHz: QCA956X 3x3 MIMO 802.11b/g/n
  WiFi 5 GHz: QCA9882-BR4A 2x2 MIMO 802.11a/n/ac
  Ethernet: 4x LAN and 1x WAN (all 100M)
  USB: 1x Header

Flashing instructions:

  As it appears, the device does not support flashing via GUI or
  TFTP, only serial is possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts [new file with mode: 0644]
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/image/generic-tp-link.mk

diff --git a/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts b/target/linux/ath79/dts/qca9561_tplink_tl-wdr6500-v2.dts
new file mode 100644 (file)
index 0000000..797afe6
--- /dev/null
@@ -0,0 +1,144 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca956x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "tplink,tl-wdr6500-v2", "qca,qca9561";
+       model = "TP-Link TL-WDR6500 v2";
+
+       aliases {
+               led-boot = &led_system;
+               led-failsafe = &led_system;
+               led-running = &led_system;
+               led-upgrade = &led_system;
+               label-mac-device = &eth1;
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "Reset button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               lan4 {
+                       label = "green:lan4";
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+               };
+
+               lan3 {
+                       label = "green:lan3";
+                       gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               };
+
+               lan2 {
+                       label = "green:lan2";
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               lan1 {
+                       label = "green:lan1";
+                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+               };
+
+               wan {
+                       label = "green:wan";
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+               };
+
+               led_system: system {
+                       label = "white:system";
+                       gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+};
+
+&spi {
+       status = "okay";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       uboot: partition@0 {
+                               label = "u-boot";
+                               reg = <0x000000 0x010000>;
+                               read-only;
+                       };
+
+                       partition@10000 {
+                               compatible = "tplink,firmware";
+                               label = "firmware";
+                               reg = <0x010000 0x7d0000>;
+                       };
+
+                       partition@7e0000 {
+                               label = "mib0";
+                               reg = <0x7e0000 0x010000>;
+                               read-only;
+                       };
+
+                       art: partition@7f0000 {
+                               label = "art";
+                               reg = <0x7f0000 0x010000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&uart {
+       status = "okay";
+};
+
+&pcie {
+       status = "okay";
+};
+
+&eth0 {
+       status = "okay";
+
+       phy-handle = <&swphy4>;
+
+       mtd-mac-address = <&uboot 0x0fc00>;
+       mtd-mac-address-increment = <1>;
+};
+
+&eth1 {
+       status = "okay";
+
+       mtd-mac-address = <&uboot 0x0fc00>;
+};
+
+&wmac {
+       status = "okay";
+
+       mtd-cal-data = <&art 0x1000>;
+
+       mtd-mac-address = <&uboot 0x0fc00>;
+       mtd-mac-address-increment = <(-1)>;
+};
+
+&usb0 {
+       status = "okay";
+};
+
+&usb_phy0 {
+       status = "okay";
+};
index c6ade98c8faad018c75bd0e349c648645c5a046c..d2ff03a00a7d2af7fd7ffa633789b524b6d82e9d 100755 (executable)
@@ -346,6 +346,13 @@ tplink,tl-wpa8630p-v2.0-eu|\
 tplink,tl-wpa8630p-v2.1-eu)
        ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x3c"
        ;;
+tplink,tl-wdr6500-v2)
+       ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
+       ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x10"
+       ;;
 tplink,tl-wr842n-v2)
        ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
        ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x04"
index 2d76d16f9fba8c5965804b01a1baaf4028fcfe05..d3a7af01f82d0de3b1687e87cceb308ab46fd117 100755 (executable)
@@ -178,7 +178,8 @@ ath79_setup_interfaces()
        ubnt,routerstation)
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
                ;;
-       comfast,cf-e560ac)
+       comfast,cf-e560ac|\
+       tplink,tl-wdr6500-v2)
                ucidef_set_interface_wan "eth1"
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
index 9a199b4deb5bc30efa65779ca742d9d3b71d85d2..d2107ea550714251268491ad6e11b75cc71d67d9 100644 (file)
@@ -149,6 +149,10 @@ case "$FIRMWARE" in
                caldata_extract "art" 0x5000 0x844
                ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
                ;;
+       tplink,tl-wdr6500-v2)
+               caldata_extract "art" 0x5000 0x844
+               ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) -2)
+               ;;
        tplink,tl-wpa8630-v1)
                caldata_extract "art" 0x5000 0x844
                ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) +1)
index 0058d74f773dc218ce50bb0ab49f0ddcb80fe1f5..8d26a90173e8bcaaab7684c869d719fe55d5187e 100644 (file)
@@ -564,6 +564,21 @@ define Device/tplink_tl-wdr4900-v2
 endef
 TARGET_DEVICES += tplink_tl-wdr4900-v2
 
+define Device/tplink_tl-wdr6500-v2
+  $(Device/tplink-8mlzma)
+  SOC := qca9561
+  DEVICE_MODEL := TL-WDR6500
+  DEVICE_VARIANT := v2
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
+  IMAGE_SIZE := 8000k
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma | tplink-v1-header
+  TPLINK_HWID := 0x65000002
+  TPLINK_HEADER_VERSION := 2
+  SUPPORTED_DEVICES += tl-wdr6500-v2
+endef
+TARGET_DEVICES += tplink_tl-wdr6500-v2
+
 define Device/tplink_tl-wdr7500-v3
   $(Device/tplink-8mlzma)
   SOC := qca9558