0036-ar71xx-add-support-for-TP-Link-Archer-C25-v1.patch 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. From: Ludwig Thomeczek <ledesrc@wxorx.net>
  2. Date: Sat, 22 Apr 2017 18:21:47 +0200
  3. Subject: ar71xx: add support for TP-Link Archer C25 v1
  4. The TP-Link Archer C25 is a low-cost dual-band router.
  5. Specification:
  6. - CPU: Atheros QCA9561 775 MHz
  7. - RAM: 64 MB
  8. - Flash: 8 MB
  9. - Wifi: 3x3 2.4 GHz (integrated), 1x1 5 GHz QCA9887
  10. - NET: 5x 10/100 Mbps Ethernet
  11. Some LEDs are controlled by an additional 74HC595 chip.
  12. Signed-off-by: Ludwig Thomeczek <ledesrc@wxorx.net>
  13. [minor code style fixes, boards alphabetical order fixes,
  14. reworked commit message]
  15. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
  16. diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
  17. index 833522f27b61ac2208c2862bc0f29f34dea5e701..e1efb561b33da4dcfcb82ee953cd888170476dfb 100755
  18. --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
  19. +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
  20. @@ -53,6 +53,15 @@ ap121f)
  21. ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
  22. ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
  23. ;;
  24. +archer-c25-v1)
  25. + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
  26. + ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
  27. + ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
  28. + ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10"
  29. + ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
  30. + ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04"
  31. + ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
  32. + ;;
  33. arduino-yun)
  34. ucidef_set_led_wlan "wlan" "WLAN" "arduino:blue:wlan" "phy0tpt"
  35. ucidef_set_led_usbdev "usb" "USB" "arduino:white:usb" "1-1.1"
  36. diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network
  37. index 6d8a5c3d0a86a627663dee6e2905e03d5dec99fb..cefb7413eac6ffc50e67f1eaf63def749314428b 100755
  38. --- a/target/linux/ar71xx/base-files/etc/board.d/02_network
  39. +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
  40. @@ -122,6 +122,7 @@ ar71xx_setup_interfaces()
  41. a60|\
  42. alfa-ap96|\
  43. alfa-nx|\
  44. + archer-c25-v1|\
  45. dr344|\
  46. gl-ar150|\
  47. gl-ar300m|\
  48. diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
  49. index bc2fc2f774c4f2f0bbfa6e43d9b9a55e9b63153d..38cc5d7853c79f2a7800a387310a95abb3b4de1b 100644
  50. --- a/target/linux/ar71xx/base-files/etc/diag.sh
  51. +++ b/target/linux/ar71xx/base-files/etc/diag.sh
  52. @@ -50,6 +50,7 @@ get_status_led() {
  53. ap135-020)
  54. status_led="ap135:green:status"
  55. ;;
  56. + archer-c25-v1|\
  57. mr12|\
  58. mr16|\
  59. nbg6616|\
  60. diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  61. index b3e23c9a8f8c56870ef36fb55ae52e6b5ea61134..68f90de802ddd18e09a1da39c0d56292eea9489c 100644
  62. --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  63. +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  64. @@ -92,6 +92,7 @@ case "$FIRMWARE" in
  65. ath10kcal_extract "art" 20480 2116
  66. ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
  67. ;;
  68. + archer-c25-v1|\
  69. tl-wdr6500-v2)
  70. ath10kcal_extract "art" 20480 2116
  71. ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
  72. diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  73. index bf365988acbd332d5eb4b2f6fb9e7744f8c1b817..46711af2b26159ebb105fa97cd8a85bb9c00911a 100755
  74. --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
  75. +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
  76. @@ -460,6 +460,9 @@ ar71xx_board_detect() {
  77. *AP90Q)
  78. name="ap90q"
  79. ;;
  80. + *"Archer C25 v1")
  81. + name="archer-c25-v1"
  82. + ;;
  83. *"Archer C5")
  84. name="archer-c5"
  85. ;;
  86. diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  87. index 21ad2a617db2fe4ff5801aba3a7fae5ba103570a..e65f6e2f7594ba373fbc9a26620859b9005c8532 100755
  88. --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  89. +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
  90. @@ -206,6 +206,7 @@ platform_check_image() {
  91. ap121f|\
  92. ap132|\
  93. ap90q|\
  94. + archer-c25-v1|\
  95. bullet-m|\
  96. c-55|\
  97. carambola2|\
  98. diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
  99. index a8622454b421c1c74a8a71134b53c50399114aa5..e10401d42ae06506f82f2f5538fbc7df79fd4c65 100644
  100. --- a/target/linux/ar71xx/config-4.4
  101. +++ b/target/linux/ar71xx/config-4.4
  102. @@ -51,6 +51,7 @@ CONFIG_ATH79_MACH_AP152=y
  103. # CONFIG_ATH79_MACH_AP81 is not set
  104. CONFIG_ATH79_MACH_AP90Q=y
  105. CONFIG_ATH79_MACH_AP96=y
  106. +CONFIG_ATH79_MACH_ARCHER_C25_V1=y
  107. CONFIG_ATH79_MACH_ARCHER_C7=y
  108. CONFIG_ATH79_MACH_ARDUINO_YUN=y
  109. CONFIG_ATH79_MACH_AW_NR580=y
  110. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
  111. index 58d7e435362e0bac105e8183206e593329e4ae96..fb2afb965c4641df7cdcaf0920f2d56b3717fa9b 100644
  112. --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
  113. +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
  114. @@ -1234,6 +1234,16 @@ config ATH79_MACH_BSB
  115. select ATH79_DEV_USB
  116. select ATH79_DEV_WMAC
  117. +config ATH79_MACH_ARCHER_C25_V1
  118. + bool "TP-LINK Archer C25 v1 support"
  119. + select SOC_QCA956X
  120. + select ATH79_DEV_AP9X_PCI if PCI
  121. + select ATH79_DEV_ETH
  122. + select ATH79_DEV_GPIO_BUTTONS
  123. + select ATH79_DEV_LEDS_GPIO
  124. + select ATH79_DEV_M25P80
  125. + select ATH79_DEV_WMAC
  126. +
  127. config ATH79_MACH_ARCHER_C7
  128. bool "TP-LINK Archer C5/C7/TL-WDR4900 v2 board support"
  129. select SOC_QCA955X
  130. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
  131. index 7aee76019552e14ebdbf7bea357859dedb1a5bbb..3365a43ce16fc77b3212b39b92081efe678e8803 100644
  132. --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile
  133. +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
  134. @@ -56,6 +56,7 @@ obj-$(CONFIG_ATH79_MACH_AP147) += mach-ap147.o
  135. obj-$(CONFIG_ATH79_MACH_AP152) += mach-ap152.o
  136. obj-$(CONFIG_ATH79_MACH_AP90Q) += mach-ap90q.o
  137. obj-$(CONFIG_ATH79_MACH_AP96) += mach-ap96.o
  138. +obj-$(CONFIG_ATH79_MACH_ARCHER_C25_V1) += mach-archer-c25-v1.o
  139. obj-$(CONFIG_ATH79_MACH_ARCHER_C7) += mach-archer-c7.o
  140. obj-$(CONFIG_ATH79_MACH_ARDUINO_YUN) += mach-arduino-yun.o
  141. obj-$(CONFIG_ATH79_MACH_AW_NR580) += mach-aw-nr580.o
  142. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c
  143. new file mode 100644
  144. index 0000000000000000000000000000000000000000..a0f001cb49af5aa501c6825c40f3a98ab99503b2
  145. --- /dev/null
  146. +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c
  147. @@ -0,0 +1,227 @@
  148. +/*
  149. + * TP-Link Archer C25 v1 board support
  150. + *
  151. + * Copyright (C) 2017 Ludwig Thomeczek <ledesrc@wxorx.net>
  152. + * based on mach-archer-c60/C59-v1.c
  153. + * Copyright (C) 2016 Henryk Heisig <hyniu@o2.pl>
  154. + *
  155. + * This program is free software; you can redistribute it and/or modify it
  156. + * under the terms of the GNU General Public License version 2 as published
  157. + * by the Free Software Foundation.
  158. + */
  159. +#include <linux/platform_device.h>
  160. +#include <linux/ath9k_platform.h>
  161. +#include <linux/ar8216_platform.h>
  162. +#include <asm/mach-ath79/ar71xx_regs.h>
  163. +#include <linux/gpio.h>
  164. +
  165. +#include "common.h"
  166. +#include "dev-m25p80.h"
  167. +#include "machtypes.h"
  168. +#include "pci.h"
  169. +#include "dev-ap9x-pci.h"
  170. +#include "dev-eth.h"
  171. +#include "dev-gpio-buttons.h"
  172. +#include "dev-leds-gpio.h"
  173. +#include "dev-spi.h"
  174. +#include "dev-usb.h"
  175. +#include "dev-wmac.h"
  176. +#include <linux/spi/spi_gpio.h>
  177. +#include <linux/spi/74x164.h>
  178. +
  179. +#define ARCHER_C25_GPIO_SHIFT_OE 21 /* OE, Output Enable */
  180. +#define ARCHER_C25_GPIO_SHIFT_SER 14 /* DS, Data Serial Input */
  181. +#define ARCHER_C25_GPIO_SHIFT_SRCLK 15 /* SHCP, Shift Reg Clock Input */
  182. +#define ARCHER_C25_GPIO_SHIFT_SRCLR 19 /* MR, Master Reset */
  183. +#define ARCHER_C25_GPIO_SHIFT_RCLK 16 /* STCP, Storage Reg Clock Input */
  184. +
  185. +#define ARCHER_C25_74HC_GPIO_BASE QCA956X_GPIO_COUNT
  186. +#define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER 27
  187. +#define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN 28
  188. +#define ARCHER_C25_74HC_GPIO_LED_WLAN2 29
  189. +#define ARCHER_C25_74HC_GPIO_LED_WLAN5 30
  190. +#define ARCHER_C25_74HC_GPIO_LED_LAN1 23
  191. +#define ARCHER_C25_74HC_GPIO_LED_LAN2 24
  192. +#define ARCHER_C25_74HC_GPIO_LED_LAN3 25
  193. +#define ARCHER_C25_74HC_GPIO_LED_LAN4 26
  194. +
  195. +#define ARCHER_C25_V1_SSR_BIT_0 0
  196. +#define ARCHER_C25_V1_SSR_BIT_1 1
  197. +#define ARCHER_C25_V1_SSR_BIT_2 2
  198. +#define ARCHER_C25_V1_SSR_BIT_3 3
  199. +#define ARCHER_C25_V1_SSR_BIT_4 4
  200. +#define ARCHER_C25_V1_SSR_BIT_5 5
  201. +#define ARCHER_C25_V1_SSR_BIT_6 6
  202. +#define ARCHER_C25_V1_SSR_BIT_7 7
  203. +
  204. +
  205. +#define ARCHER_C25_V1_KEYS_POLL_INTERVAL 20
  206. +#define ARCHER_C25_V1_KEYS_DEBOUNCE_INTERVAL \
  207. + (3 * ARCHER_C25_V1_KEYS_POLL_INTERVAL)
  208. +
  209. +#define ARCHER_C25_V1_GPIO_BTN_RESET 1
  210. +#define ARCHER_C25_V1_GPIO_BTN_RFKILL 22
  211. +
  212. +#define ARCHER_C25_V1_GPIO_LED_POWER 17
  213. +#define ARCHER_C25_V1_GPIO_LED_WPS 2
  214. +
  215. +#define ARCHER_C25_V1_WMAC_CALDATA_OFFSET 0x1000
  216. +
  217. +static struct spi_gpio_platform_data archer_c25_v1_spi_data = {
  218. + .sck = ARCHER_C25_GPIO_SHIFT_SRCLK,
  219. + .miso = SPI_GPIO_NO_MISO,
  220. + .mosi = ARCHER_C25_GPIO_SHIFT_SER,
  221. + .num_chipselect = 1,
  222. +};
  223. +
  224. +static u8 archer_c25_v1_ssr_initdata[] __initdata = {
  225. + BIT(ARCHER_C25_V1_SSR_BIT_7) |
  226. + BIT(ARCHER_C25_V1_SSR_BIT_6) |
  227. + BIT(ARCHER_C25_V1_SSR_BIT_5) |
  228. + BIT(ARCHER_C25_V1_SSR_BIT_4) |
  229. + BIT(ARCHER_C25_V1_SSR_BIT_3) |
  230. + BIT(ARCHER_C25_V1_SSR_BIT_2) |
  231. + BIT(ARCHER_C25_V1_SSR_BIT_1)
  232. +};
  233. +
  234. +static struct gen_74x164_chip_platform_data archer_c25_v1_ssr_data = {
  235. + .base = ARCHER_C25_74HC_GPIO_BASE,
  236. + .num_registers = ARRAY_SIZE(archer_c25_v1_ssr_initdata),
  237. + .init_data = archer_c25_v1_ssr_initdata,
  238. +};
  239. +
  240. +static struct platform_device archer_c25_v1_spi_device = {
  241. + .name = "spi_gpio",
  242. + .id = 1,
  243. + .dev = {
  244. + .platform_data = &archer_c25_v1_spi_data,
  245. + },
  246. +};
  247. +
  248. +static struct spi_board_info archer_c25_v1_spi_info[] = {
  249. + {
  250. + .bus_num = 1,
  251. + .chip_select = 0,
  252. + .max_speed_hz = 10000000,
  253. + .modalias = "74x164",
  254. + .platform_data = &archer_c25_v1_ssr_data,
  255. + .controller_data = (void *) ARCHER_C25_GPIO_SHIFT_RCLK,
  256. + },
  257. +};
  258. +
  259. +static struct gpio_led archer_c25_v1_leds_gpio[] __initdata = {
  260. + {
  261. + .name = "archer-c25-v1:green:power",
  262. + .gpio = ARCHER_C25_V1_GPIO_LED_POWER,
  263. + .active_low = 1,
  264. + }, {
  265. + .name = "archer-c25-v1:green:wps",
  266. + .gpio = ARCHER_C25_V1_GPIO_LED_WPS,
  267. + .active_low = 1,
  268. + }, {
  269. + .name = "archer-c25-v1:green:wlan2g",
  270. + .gpio = ARCHER_C25_74HC_GPIO_LED_WLAN2,
  271. + .active_low = 1,
  272. + }, {
  273. + .name = "archer-c25-v1:green:wlan5g",
  274. + .gpio = ARCHER_C25_74HC_GPIO_LED_WLAN5,
  275. + .active_low = 1,
  276. + }, {
  277. + .name = "archer-c25-v1:green:lan1",
  278. + .gpio = ARCHER_C25_74HC_GPIO_LED_LAN1,
  279. + .active_low = 1,
  280. + }, {
  281. + .name = "archer-c25-v1:green:lan2",
  282. + .gpio = ARCHER_C25_74HC_GPIO_LED_LAN2,
  283. + .active_low = 1,
  284. + }, {
  285. + .name = "archer-c25-v1:green:lan3",
  286. + .gpio = ARCHER_C25_74HC_GPIO_LED_LAN3,
  287. + .active_low = 1,
  288. + }, {
  289. + .name = "archer-c25-v1:green:lan4",
  290. + .gpio = ARCHER_C25_74HC_GPIO_LED_LAN4,
  291. + .active_low = 1,
  292. + }, {
  293. + .name = "archer-c25-v1:green:wan",
  294. + .gpio = ARCHER_C25_74HC_GPIO_LED_WAN_GREEN,
  295. + .active_low = 1,
  296. + }, {
  297. + .name = "archer-c25-v1:amber:wan",
  298. + .gpio = ARCHER_C25_74HC_GPIO_LED_WAN_AMBER,
  299. + .active_low = 1,
  300. + },
  301. +};
  302. +
  303. +static struct gpio_keys_button archer_c25_v1_gpio_keys[] __initdata = {
  304. + {
  305. + .desc = "Reset button",
  306. + .type = EV_KEY,
  307. + .code = KEY_RESTART,
  308. + .debounce_interval = ARCHER_C25_V1_KEYS_DEBOUNCE_INTERVAL,
  309. + .gpio = ARCHER_C25_V1_GPIO_BTN_RESET,
  310. + .active_low = 1,
  311. + }, {
  312. + .desc = "RFKILL button",
  313. + .type = EV_KEY,
  314. + .code = KEY_RFKILL,
  315. + .debounce_interval = ARCHER_C25_V1_KEYS_DEBOUNCE_INTERVAL,
  316. + .gpio = ARCHER_C25_V1_GPIO_BTN_RFKILL,
  317. + .active_low = 1,
  318. + },
  319. +};
  320. +
  321. +static void __init archer_c25_v1_setup(void)
  322. +{
  323. + u8 *mac = (u8 *) KSEG1ADDR(0x1f7e0008);
  324. + u8 *art = (u8 *) KSEG1ADDR(0x1f7f0000);
  325. +
  326. + ath79_register_m25p80(NULL);
  327. +
  328. + spi_register_board_info(archer_c25_v1_spi_info,
  329. + ARRAY_SIZE(archer_c25_v1_spi_info));
  330. +
  331. + platform_device_register(&archer_c25_v1_spi_device);
  332. +
  333. + gpio_request_one(ARCHER_C25_GPIO_SHIFT_OE,
  334. + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED,
  335. + "LED control");
  336. +
  337. + gpio_request_one(ARCHER_C25_GPIO_SHIFT_SRCLR,
  338. + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
  339. + "LED reset");
  340. +
  341. + ath79_register_leds_gpio(-1, ARRAY_SIZE(archer_c25_v1_leds_gpio),
  342. + archer_c25_v1_leds_gpio);
  343. +
  344. + ath79_register_gpio_keys_polled(-1, ARCHER_C25_V1_KEYS_POLL_INTERVAL,
  345. + ARRAY_SIZE(archer_c25_v1_gpio_keys),
  346. + archer_c25_v1_gpio_keys);
  347. +
  348. + ath79_register_mdio(0, 0x0);
  349. + ath79_register_mdio(1, 0x0);
  350. +
  351. + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
  352. + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
  353. +
  354. + /* WAN port */
  355. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
  356. + ath79_eth0_data.speed = SPEED_100;
  357. + ath79_eth0_data.duplex = DUPLEX_FULL;
  358. + ath79_eth0_data.phy_mask = BIT(4);
  359. + ath79_register_eth(0);
  360. +
  361. + /* LAN ports */
  362. + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
  363. + ath79_eth1_data.speed = SPEED_1000;
  364. + ath79_eth1_data.duplex = DUPLEX_FULL;
  365. + ath79_switch_data.phy_poll_mask |= BIT(4);
  366. + ath79_switch_data.phy4_mii_en = 1;
  367. + ath79_register_eth(1);
  368. +
  369. + ath79_register_wmac(art + ARCHER_C25_V1_WMAC_CALDATA_OFFSET, mac);
  370. + ap91_pci_init(NULL, NULL);
  371. +}
  372. +
  373. +MIPS_MACHINE(ATH79_MACH_ARCHER_C25_V1, "ARCHER-C25-V1", "TP-LINK Archer C25 v1",
  374. + archer_c25_v1_setup);
  375. diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
  376. index a12685cd11a7a6cefe9b69991a5e41db55ccea85..8864e0deda57b926e88dceebd26056a2f8099380 100644
  377. --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
  378. +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
  379. @@ -40,6 +40,7 @@ enum ath79_mach_type {
  380. ATH79_MACH_AP152, /* Atheros AP152 reference board */
  381. ATH79_MACH_AP90Q, /* YunCore AP90Q */
  382. ATH79_MACH_AP96, /* Atheros AP96 */
  383. + ATH79_MACH_ARCHER_C25_V1, /* TP-LINK Archer C25 V1 board */
  384. ATH79_MACH_ARCHER_C5, /* TP-LINK Archer C5 board */
  385. ATH79_MACH_ARCHER_C7, /* TP-LINK Archer C7 board */
  386. ATH79_MACH_ARCHER_C7_V2, /* TP-LINK Archer C7 V2 board */
  387. diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk
  388. index 9cd6c6372ac8f7e509a0a2422616097c1c19edf6..6933654e575a1ef2c92e4c656696a479cba4c594 100644
  389. --- a/target/linux/ar71xx/image/tp-link.mk
  390. +++ b/target/linux/ar71xx/image/tp-link.mk
  391. @@ -103,6 +103,22 @@ $(Device/tplink)
  392. IMAGE_SIZE := 15872k
  393. endef
  394. +define Device/archer-c25-v1
  395. + DEVICE_TITLE := TP-LINK Archer C25 v1
  396. + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887
  397. + BOARDNAME := ARCHER-C25-V1
  398. + TPLINK_BOARD_NAME := ARCHER-C25-V1
  399. + DEVICE_PROFILE := ARCHERC25V1
  400. + IMAGE_SIZE := 7808k
  401. + LOADER_TYPE := elf
  402. + KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma
  403. + IMAGES := sysupgrade.bin factory.bin
  404. + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
  405. + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
  406. + MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware)
  407. +endef
  408. +TARGET_DEVICES += archer-c25-v1
  409. +
  410. define Device/cpe510-520
  411. DEVICE_TITLE := TP-LINK CPE510/520
  412. DEVICE_PACKAGES := rssileds
  413. diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
  414. index f8d255fd87b8c53511b34b42f4117422218219fe..376835a703f91532300d0dd7c8ef66704acc6e05 100644
  415. --- a/target/linux/ar71xx/mikrotik/config-default
  416. +++ b/target/linux/ar71xx/mikrotik/config-default
  417. @@ -16,6 +16,7 @@
  418. # CONFIG_ATH79_MACH_AP152 is not set
  419. # CONFIG_ATH79_MACH_AP90Q is not set
  420. # CONFIG_ATH79_MACH_AP96 is not set
  421. +# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set
  422. # CONFIG_ATH79_MACH_ARCHER_C7 is not set
  423. # CONFIG_ATH79_MACH_ARDUINO_YUN is not set
  424. # CONFIG_ATH79_MACH_AW_NR580 is not set
  425. diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
  426. index c1b5e61c3e9e5f02979584f72621f5e54cde2e36..62be218e33cc6366ea89f363983f36523c419650 100644
  427. --- a/target/linux/ar71xx/nand/config-default
  428. +++ b/target/linux/ar71xx/nand/config-default
  429. @@ -9,6 +9,7 @@
  430. # CONFIG_ATH79_MACH_AP136 is not set
  431. # CONFIG_ATH79_MACH_AP147 is not set
  432. # CONFIG_ATH79_MACH_AP96 is not set
  433. +# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set
  434. # CONFIG_ATH79_MACH_ARCHER_C7 is not set
  435. # CONFIG_ATH79_MACH_AW_NR580 is not set
  436. # CONFIG_ATH79_MACH_CAP324 is not set