ath79: add support for TP-Link TL-WR940N v6
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 5 Aug 2019 15:51:16 +0000 (17:51 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 20 May 2020 18:47:05 +0000 (20:47 +0200)
The TL-WR940N v6 is similar to v3/v4, it just has different
LEDs and MAC address assignment.

Specification:
- 750 MHz CPU
- 32 MB of RAM
- 4 MB of FLASH
- 2.4 GHz WiFi
- 4x 10/100 Mbps Ethernet

The use of LEDs is based on ar71xx, so blue LED is used for WAN
and orange LED for diag (boot/failsafe/etc.).

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
   wr940nv6_tp_recovery.bin
3. Start a tftp server with the image file 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.

Thanks to Manuel Kock for reviewing and testing this patch.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Manuel Kock <github.web@manu.li>
(backported from commit fbd00bb8d406a0ace7ea9c49a79cbad2418689a5)

target/linux/ath79/base-files/etc/board.d/01_leds
target/linux/ath79/base-files/etc/board.d/02_network
target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts [new file with mode: 0644]
target/linux/ath79/image/tiny-tp-link.mk

index 02d891fe2e3ec6c3899e7f24f2f176b3f026cde5..49cb312779755c42b73bbf4b69c2712f87eadc6f 100755 (executable)
@@ -221,6 +221,9 @@ tplink,tl-wr941nd-v6)
        ucidef_set_led_switch "lan3" "LAN3" "tp-link:blue:lan3" "switch0" "0x04"
        ucidef_set_led_switch "lan4" "LAN4" "tp-link:blue:lan4" "switch0" "0x02"
        ;;
+tplink,tl-wr940n-v6)
+       ucidef_set_led_netdev "wan" "WAN" "tp-link:blue:wan" "eth1"
+       ;;
 ubnt,bullet-m|\
 ubnt,bullet-m-xw|\
 ubnt,nanostation-loco-m|\
index 84a316a14ae0879719975f131af4cdf36a7904ce..ddcd2326e502285ffb7216a8c5b0898ddbc0a3ee 100755 (executable)
@@ -92,6 +92,7 @@ ath79_setup_interfaces()
        tplink,tl-wr842n-v3|\
        tplink,tl-wr940n-v3|\
        tplink,tl-wr940n-v4|\
+       tplink,tl-wr940n-v6|\
        tplink,tl-wr941nd-v6|\
        ubnt,airrouter)
                ucidef_set_interface_wan "eth1"
diff --git a/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts b/target/linux/ath79/dts/tp9343_tplink_tl-wr940n-v6.dts
new file mode 100644 (file)
index 0000000..31f0c14
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include "tp9343_tplink_tl-wr94x.dtsi"
+
+/ {
+       compatible = "tplink,tl-wr940n-v6", "qca,tp9343";
+       model = "TP-Link TL-WR940N v6";
+
+       aliases {
+               led-boot = &led_diag_orange;
+               led-failsafe = &led_diag_orange;
+               led-running = &led_diag_orange;
+               led-upgrade = &led_diag_orange;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               wan_blue {
+                       label = "tp-link:blue:wan";
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+               };
+
+               led_diag_orange: diag_orange {
+                       label = "tp-link:orange:diag";
+                       gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+};
+
+&eth1 {
+       mtd-mac-address = <&uboot 0x1fc00>;
+};
index be0ca1a4c94a38bd8b8eb948eb7019dcb2ef17c7..a7c4d060c8903acf52b48701dbc5b2384990ba26 100644 (file)
@@ -262,6 +262,19 @@ define Device/tplink_tl-wr940n-v4
 endef
 TARGET_DEVICES += tplink_tl-wr940n-v4
 
+define Device/tplink_tl-wr940n-v6
+  $(Device/tplink-4mlzma)
+  ATH_SOC := tp9343
+  DEVICE_TITLE := TP-Link TL-WR940N v6
+  TPLINK_HWID := 0x09400006
+  SUPPORTED_DEVICES += tl-wr940n-v6
+  IMAGES += factory-us.bin factory-eu.bin factory-br.bin
+  IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US
+  IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU
+  IMAGE/factory-br.bin := append-rootfs | mktplinkfw factory -C BR
+endef
+TARGET_DEVICES += tplink_tl-wr940n-v6
+
 define Device/tplink_tl-wr941-v2
   $(Device/tplink-4m)
   ATH_SOC := ar9132