aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorPeter Lundkvist <peter.lundkvist@gmail.com>2018-06-29 05:44:58 +0200
committerJohn Crispin <john@phrozen.org>2018-07-02 07:05:33 +0200
commit781ad46206ddaee74e40d7dbc68840fae1c0cc7c (patch)
treeca8ec054dcd0fac6531bdb74dda5316267ecce96 /target/linux
parentf4ac88b5097685950c6f6ba0077840f85446389f (diff)
downloadupstream-781ad46206ddaee74e40d7dbc68840fae1c0cc7c.tar.gz
upstream-781ad46206ddaee74e40d7dbc68840fae1c0cc7c.tar.bz2
upstream-781ad46206ddaee74e40d7dbc68840fae1c0cc7c.zip
ath79: add support for TP-Link RE450 v2
TP-Link RE450 v2 is a dual band router/range-extender based on Qualcomm/Atheros QCA9563 + QCA9880. Specification: - 775 MHz CPU - 64 MB of RAM (DDR2) - 8 MB of FLASH (SPI NOR) - 3T3R 2.4 GHz - 3T3R 5 GHz - 1x 10/100/1000 Mbps Ethernet (AR8033 PHY) - 7x LED, 4x button - UART header on PCB (needs unmounted R64 & R69 0201 resistors/jumpers) Flash instruction: Apply factory image in OEM firmware web-gui. U-Boot does not seem to have any recovery functions, so debricking requires connection via UART. Signed-off-by: Peter Lundkvist <peter.lundkvist@gmail.com>
Diffstat (limited to 'target/linux')
-rwxr-xr-xtarget/linux/ath79/base-files/etc/board.d/01_leds4
-rwxr-xr-xtarget/linux/ath79/base-files/etc/board.d/02_network1
-rw-r--r--target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata4
-rw-r--r--target/linux/ath79/dts/qca9563_tl-re450-v2.dts195
-rw-r--r--target/linux/ath79/image/common-tp-link.mk2
-rw-r--r--target/linux/ath79/image/generic-tp-link.mk18
6 files changed, 223 insertions, 1 deletions
diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds
index 3edffaff74..d8312a9b89 100755
--- a/target/linux/ath79/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/base-files/etc/board.d/01_leds
@@ -28,6 +28,10 @@ case "$board" in
ucidef_set_led_switch "lan1" "LAN1" "netgear:green:lan1" "switch0" "0x02" "0x0f"
ucidef_set_led_switch "lan2" "LAN2" "netgear:green:lan2" "switch0" "0x04" "0x0f"
;;
+"tplink,re450-v2")
+ ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
+ ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
+ ;;
"tplink,tl-mr3020-v1")
ucidef_set_led_switch "lan" "LAN" "tp-link:green:lan" "switch0" "0x02"
;;
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network
index 26b3752824..10a1bbd9ec 100755
--- a/target/linux/ath79/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ ath79_setup_interfaces()
ucidef_set_interface_lan "eth0" "dhcp"
;;
"avm,fritz300e"|\
+ "tplink,re450-v2"|\
"tplink,tl-mr10u"|\
"tplink,tl-wr703n"|\
"ubnt,unifiac-lite"|\
diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index c27b4111de..28cfa25f4d 100644
--- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -91,6 +91,10 @@ case "$FIRMWARE" in
ath10kcal_extract "ART" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
;;
+ "tplink,re450-v2")
+ ath10kcal_extract "art" 20480 2116
+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
+ ;;
"tplink,tl-archer-c7-v2")
ath10kcal_extract "art" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
diff --git a/target/linux/ath79/dts/qca9563_tl-re450-v2.dts b/target/linux/ath79/dts/qca9563_tl-re450-v2.dts
new file mode 100644
index 0000000000..646cdf2975
--- /dev/null
+++ b/target/linux/ath79/dts/qca9563_tl-re450-v2.dts
@@ -0,0 +1,195 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca956x.dtsi"
+
+/ {
+ compatible = "tplink,re450-v2", "qca,qca9563";
+ model = "TP-Link RE450 v2";
+
+ chosen {
+ bootargs = "console=ttyS0,115200n8";
+ };
+
+ aliases {
+ led-status = &system;
+ mdio-gpio0 = &mdio2;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ system: power {
+ label = "tp-link:blue:power";
+ gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+ };
+
+ wlan2g {
+ label = "tp-link:blue:wlan2g";
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ linux,default-trigger = "phy1tpt";
+ };
+
+ wlan5g {
+ label = "tp-link:blue:wlan5g";
+ gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ linux,default-trigger = "phy0tpt";
+ };
+
+ lan_link {
+ label = "tp-link:green:lan_link";
+ gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ lan_data {
+ label = "tp-link:green:lan_data";
+ gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ wps_blue {
+ label = "tp-link:blue:wps";
+ gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+
+ wps_red {
+ label = "tp-link:red:wps";
+ gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
+ default-state = "off";
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ reset {
+ label = "Reset button";
+ linux,code = <KEY_RESTART>;
+ gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ };
+
+ power {
+ label = "Power button";
+ linux,code = <KEY_POWER>;
+ gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ };
+
+ leds {
+ label = "LED control button";
+ linux,code = <BTN_0>;
+ gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ };
+
+ wps {
+ label = "WPS button";
+ linux,code = <KEY_WPS_BUTTON>;
+ gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+ debounce-interval = <60>;
+ };
+ };
+
+ mdio2: mdio {
+ compatible = "virtual,mdio-gpio";
+
+ gpios = <&gpio 3 GPIO_ACTIVE_HIGH>, /* MDC */
+ <&gpio 4 GPIO_ACTIVE_HIGH>; /* MDIO */
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ phy0: ethernet-phy@4 {
+ reg = <4>;
+ device_type = "ethernet-phy";
+ reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+&uart {
+ status = "okay";
+};
+
+&gpio {
+ status = "okay";
+};
+
+&spi {
+ status = "okay";
+ num-cs = <1>;
+
+ flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <25000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x000000 0x020000>;
+ read-only;
+ };
+
+ partition@20000 {
+ label = "firmware";
+ reg = <0x020000 0x5e0000>;
+ };
+
+ partition@600000 {
+ label = "partition-table";
+ reg = <0x600000 0x010000>;
+ read-only;
+ };
+
+ info: partition@610000 {
+ label = "product-info";
+ reg = <0x610000 0x020000>;
+ read-only;
+ };
+
+ partition@630000 {
+ label = "config";
+ reg = <0x630000 0x020000>;
+ read-only;
+ };
+
+ art: partition@7f0000 {
+ label = "art";
+ reg = <0x7f0000 0x010000>;
+ read-only;
+ };
+ };
+ };
+};
+
+&eth0 {
+ status = "okay";
+ mtd-mac-address = <&info 0x8>;
+ phy-handle = <&phy0>;
+};
+
+&wmac {
+ status = "okay";
+ mtd-cal-data = <&art 0x1000>;
+ mtd-mac-address = <&info 0x8>;
+};
diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk
index f816308a9d..7490aeb1f3 100644
--- a/target/linux/ath79/image/common-tp-link.mk
+++ b/target/linux/ath79/image/common-tp-link.mk
@@ -1,4 +1,4 @@
-DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_BOARD_NAME
+DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_BOARD_NAME TPLINK_BOARD_ID
define rootfs_align
$(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index 28fac6a631..537dafa152 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -13,6 +13,24 @@ define Device/tl-archer-c7-v2
endef
TARGET_DEVICES += tl-archer-c7-v2
+define Device/tl-re450-v2
+ $(Device/tplink)
+ ATH_SOC := qca9563
+ IMAGE_SIZE := 6016k
+ DEVICE_TITLE := TP-LINK RE450 v2
+ DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x
+ TPLINK_HWID := 0x0
+ TPLINK_HWREV := 0
+ TPLINK_BOARD_ID := RE450-V2
+ LOADER_TYPE := elf
+ KERNEL := kernel-bin | append-dtb | lzma | tplink-v1-header -O
+ IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
+ append-metadata | check-size $$$$(IMAGE_SIZE)
+ IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+ SUPPORTED_DEVICES := tplink,re450-v2
+endef
+TARGET_DEVICES += tl-re450-v2
+
define Device/tl-wdr3600
$(Device/tplink-8mlzma)
ATH_SOC := ar9344