1 The patch below was slightly adjusted in order to backport it to 19.07.
3 commit cad4132e003cecc386d791d552ddba42c182c216
4 Author: Andrew Cameron <apcameron@softhome.net>
5 Date: Wed Jun 26 16:40:54 2019 -0500
7 ath79: add support for TP-Link CPE510-v2/v3
9 TP-Link CPE510-v2/v3 is an outdoor wireless CPE for 5 GHz with
10 one Ethernet port based on Atheros AR9344
13 - Based on the same underlying hardware as the TP-Link CPE510
14 - Power, LAN, and 4 green LEDs
15 - 1 10/100Mbps Shielded Ethernet Port (Passive PoE in)
16 - Built-in 13dBi 2x2 dual-polarized directional MIMO antenna
17 - Adjustable transmission power from 0 to 23dBm/200mw
19 Flashing instructions:
20 Flash factory image through stock firmware WEB UI
22 To get to TFTP recovery just hold reset button while powering on for
23 around 4-5 seconds and release.
24 Rename factory image to recovery.bin
25 Stock TFTP server IP:192.168.0.100
26 Stock device TFTP adress:192.168.0.254
28 Signed-off-by: Andrew Cameron <apcameron@softhome.net>
30 Signed-off-by: Petr Štetiar <ynezz@true.cz>
32 diff --git a/openwrt/target/linux/ath79/base-files/etc/board.d/01_leds b/openwrt/target/linux/ath79/base-files/etc/board.d/01_leds
33 index 238dda18f6..0cb03db4be 100755
34 --- a/openwrt/target/linux/ath79/base-files/etc/board.d/01_leds
35 +++ b/openwrt/target/linux/ath79/base-files/etc/board.d/01_leds
36 @@ -155,6 +155,15 @@ tplink,cpe210-v3)
37 ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "60" "100"
38 ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "80" "100"
42 + ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
43 + ucidef_set_rssimon "wlan0" "200000" "1"
44 + ucidef_set_led_rssi "rssilow" "RSSILOW" "tp-link:green:link1" "wlan0" "1" "100" "0" "13"
45 + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "tp-link:green:link2" "wlan0" "26" "100" "-25" "13"
46 + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "tp-link:green:link3" "wlan0" "51" "100" "-50" "13"
47 + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:green:link4" "wlan0" "76" "100" "-75" "13"
50 ucidef_set_led_netdev "lan_data" "LAN Data" "tp-link:green:lan_data" "eth0" "tx rx"
51 ucidef_set_led_netdev "lan_link" "LAN Link" "tp-link:green:lan_link" "eth0" "link"
52 diff --git a/openwrt/target/linux/ath79/base-files/etc/board.d/02_network b/openwrt/target/linux/ath79/base-files/etc/board.d/02_network
53 index 2413b1f4bc..1d4cec025a 100755
54 --- a/openwrt/target/linux/ath79/base-files/etc/board.d/02_network
55 +++ b/openwrt/target/linux/ath79/base-files/etc/board.d/02_network
56 @@ -26,6 +26,8 @@ ath79_setup_interfaces()
65 diff --git a/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts b/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts
67 index 0000000000..758d0c02f0
69 +++ b/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510-v2.dts
71 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
74 +#include "ar9344_tplink_cpe510.dtsi"
77 + compatible = "tplink,cpe510-v2", "qca,ar9344";
78 + model = "TP-Link CPE510 v2";
80 diff --git a/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts b/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts
82 index 0000000000..0909fcfa73
84 +++ b/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510-v3.dts
86 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
89 +#include "ar9344_tplink_cpe510.dtsi"
92 + compatible = "tplink,cpe510-v3", "qca,ar9344";
93 + model = "TP-Link CPE510 v3";
95 diff --git a/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510.dtsi b/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510.dtsi
97 index 0000000000..f19ef01d49
99 +++ b/openwrt/target/linux/ath79/dts/ar9344_tplink_cpe510.dtsi
101 +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
104 +#include <dt-bindings/gpio/gpio.h>
105 +#include <dt-bindings/input/input.h>
107 +#include "ar9344.dtsi"
111 + led-boot = &system;
112 + led-failsafe = &system;
113 + led-running = &system;
114 + led-upgrade = &system;
118 + compatible = "gpio-leds";
121 + label = "tp-link:green:lan";
122 + gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
126 + label = "tp-link:green:link1";
127 + gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
131 + label = "tp-link:green:link2";
132 + gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
136 + label = "tp-link:green:link3";
137 + gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
141 + label = "tp-link:green:link4";
142 + gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
147 + compatible = "gpio-keys";
150 + linux,code = <KEY_RESTART>;
151 + gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
152 + debounce-interval = <60>;
159 + clock-frequency = <40000000>;
172 + compatible = "jedec,spi-nor";
174 + spi-max-frequency = <25000000>;
177 + compatible = "fixed-partitions";
178 + #address-cells = <1>;
181 + uboot: partition@0 {
183 + reg = <0x000000 0x020000>;
188 + label = "partition-table";
189 + reg = <0x020000 0x010000>;
193 + info: partition@30000 {
195 + reg = <0x030000 0x010000>;
200 + label = "firmware";
201 + reg = <0x040000 0x780000>;
203 + compatible = "fixed-partitions";
204 + #address-cells = <1>;
209 + reg = <0x000000 0x160000>;
214 + reg = <0x160000 0x5c0000>;
220 + reg = <0x7c0000 0x030000>;
224 + art: partition@7f0000 {
226 + reg = <0x7f0000 0x010000>;
236 + mtd-cal-data = <&art 0x1000>;
237 + mtd-mac-address = <&info 0x08>;
243 + mtd-mac-address = <&info 0x08>;
246 + phy-handle = <&swphy4>;
251 + compatible = "syscon", "simple-mfd";
253 diff --git a/openwrt/target/linux/ath79/image/generic-tp-link.mk b/openwrt/target/linux/ath79/image/generic-tp-link.mk
254 index f1424d02ee..312ce78f22 100644
255 --- a/openwrt/target/linux/ath79/image/generic-tp-link.mk
256 +++ b/openwrt/target/linux/ath79/image/generic-tp-link.mk
257 @@ -146,6 +146,38 @@ define Device/tplink_cpe210-v3
259 TARGET_DEVICES += tplink_cpe210-v3
261 +define Device/tplink_cpe510-v2
262 + $(Device/tplink-safeloader)
264 + IMAGE_SIZE := 7680k
265 + DEVICE_TITLE := TP-Link CPE510 v2
266 + DEVICE_PACKAGES := rssileds
267 + TPLINK_BOARD_ID := CPE510V2
269 + LOADER_FLASH_OFFS := 0x43000
270 + COMPILE := loader-$(1).elf
271 + COMPILE/loader-$(1).elf := loader-okli-compile
272 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
273 + SUPPORTED_DEVICES += cpe510-v2
275 +TARGET_DEVICES += tplink_cpe510-v2
277 +define Device/tplink_cpe510-v3
278 + $(Device/tplink-safeloader)
280 + IMAGE_SIZE := 7680k
281 + DEVICE_TITLE := TP-Link CPE510 v3
282 + DEVICE_PACKAGES := rssileds
283 + TPLINK_BOARD_ID := CPE510V3
285 + LOADER_FLASH_OFFS := 0x43000
286 + COMPILE := loader-$(1).elf
287 + COMPILE/loader-$(1).elf := loader-okli-compile
288 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
289 + SUPPORTED_DEVICES += cpe510-v3
291 +TARGET_DEVICES += tplink_cpe510-v3
293 define Device/tplink_archer-d50-v1
295 DEVICE_TITLE := TP-Link Archer D50 v1
296 diff --git a/openwrt/tools/firmware-utils/src/tplink-safeloader.c b/openwrt/tools/firmware-utils/src/tplink-safeloader.c
297 index 773e7ed26c..cfd3645950 100644
298 --- a/openwrt/tools/firmware-utils/src/tplink-safeloader.c
299 +++ b/openwrt/tools/firmware-utils/src/tplink-safeloader.c
301 .last_sysupgrade_partition = "support-list",
305 /** Firmware layout for the CPE510 V2 */
309 {"default-mac", 0x30000, 0x00020},
310 {"product-info", 0x31100, 0x00100},
311 {"signature", 0x32000, 0x00400},
312 - {"os-image", 0x40000, 0x1c0000},
313 - {"file-system", 0x200000, 0x5b0000},
314 + {"os-image", 0x40000, 0x160000},
315 + {"file-system", 0x1a0000, 0x5c0000},
316 + {"soft-version", 0x7b0000, 0x00100},
317 + {"support-list", 0x7b1000, 0x00400},
318 + {"user-config", 0x7c0000, 0x10000},
319 + {"default-config", 0x7d0000, 0x10000},
320 + {"log", 0x7e0000, 0x10000},
321 + {"radio", 0x7f0000, 0x10000},
325 + .first_sysupgrade_partition = "os-image",
326 + .last_sysupgrade_partition = "support-list",
329 + /** Firmware layout for the CPE510 V3 */
332 + .vendor = "CPE510(TP-LINK|UN|N300-5):3.0\r\n",
335 + "CPE510(TP-LINK|EU|N300-5|00000000):3.0\r\n"
336 + "CPE510(TP-LINK|EU|N300-5|45550000):3.0\r\n"
337 + "CPE510(TP-LINK|EU|N300-5|55530000):3.0\r\n"
338 + "CPE510(TP-LINK|UN|N300-5|00000000):3.0\r\n"
339 + "CPE510(TP-LINK|UN|N300-5|45550000):3.0\r\n"
340 + "CPE510(TP-LINK|UN|N300-5|55530000):3.0\r\n"
341 + "CPE510(TP-LINK|US|N300-5|00000000):3.0\r\n"
342 + "CPE510(TP-LINK|US|N300-5|45550000):3.0\r\n"
343 + "CPE510(TP-LINK|US|N300-5|55530000):3.0\r\n"
344 + "CPE510(TP-LINK|UN|N300-5):3.0\r\n"
345 + "CPE510(TP-LINK|EU|N300-5):3.0\r\n"
346 + "CPE510(TP-LINK|US|N300-5):3.0\r\n"
347 + "CPE510(TP-LINK|UN|N300-5|00000000):3.20\r\n"
348 + "CPE510(TP-LINK|US|N300-5|55530000):3.20\r\n"
349 + "CPE510(TP-LINK|EU|N300-5|45550000):3.20\r\n",
350 + .support_trail = '\xff',
354 + {"fs-uboot", 0x00000, 0x20000},
355 + {"partition-table", 0x20000, 0x02000},
356 + {"default-mac", 0x30000, 0x00020},
357 + {"product-info", 0x31100, 0x00100},
358 + {"signature", 0x32000, 0x00400},
359 + {"os-image", 0x40000, 0x160000},
360 + {"file-system", 0x1a0000, 0x5c0000},
361 {"soft-version", 0x7b0000, 0x00100},
362 {"support-list", 0x7b1000, 0x00400},
363 {"user-config", 0x7c0000, 0x10000},