Advertisement
Guest User

Untitled

a guest
Jun 7th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.22 KB | None | 0 0
  1. diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts
  2. new file mode 100644
  3. index 0000000000..003f29ea68
  4. --- /dev/null
  5. +++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts
  6. @@ -0,0 +1,173 @@
  7. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  8. +/dts-v1/;
  9. +
  10. +#include <dt-bindings/gpio/gpio.h>
  11. +#include <dt-bindings/input/input.h>
  12. +
  13. +#include "qca956x.dtsi"
  14. +
  15. +/ {
  16. +   compatible = "tplink,eap245-v3", "qca,qca9563";
  17. +   model = "TP-Link EAP245 v3";
  18. +
  19. +   chosen {
  20. +       bootargs = "console=ttyS0,115200n8";
  21. +   };
  22. +
  23. +   aliases {
  24. +       led-boot = &led_green;
  25. +       led-failsafe = &led_yellow;
  26. +       led-running = &led_green;
  27. +       led-upgrade = &led_yellow;
  28. +       mdio-gpio0 = &mdio2;
  29. +   };
  30. +
  31. +   leds {
  32. +       compatible = "gpio-leds";
  33. +
  34. +       led_green: led_green {
  35. +           label = "tp-link:green:power";
  36. +           gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
  37. +       };
  38. +
  39. +       led_yellow: led_yellow {
  40. +           label = "tp-link:yellow:failsafe";
  41. +           gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
  42. +       };
  43. +
  44. +   };
  45. +
  46. +   keys {
  47. +       compatible = "gpio-keys";
  48. +
  49. +       reset {
  50. +           label = "Reset button";
  51. +           linux,code = <KEY_RESTART>;
  52. +           gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
  53. +           debounce-interval = <60>;
  54. +       };
  55. +   };
  56. +
  57. +   mdio2: mdio {
  58. +       compatible = "virtual,mdio-gpio";
  59. +
  60. +       gpios = <&gpio 8 GPIO_ACTIVE_HIGH>, /* MDC */
  61. +           <&gpio 10 GPIO_ACTIVE_HIGH>; /* MDIO */
  62. +       #address-cells = <1>;
  63. +       #size-cells = <0>;
  64. +
  65. +       phy0: ethernet-phy@0 {
  66. +           reg = <0>;
  67. +           device_type = "ethernet-phy";
  68. +           reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
  69. +       };
  70. +   };
  71. +};
  72. +
  73. +&pcie {
  74. +   status = "okay";
  75. +};
  76. +
  77. +&uart {
  78. +   status = "okay";
  79. +};
  80. +
  81. +&gpio {
  82. +   status = "okay";
  83. +};
  84. +
  85. +&spi {
  86. +   status = "okay";
  87. +   num-cs = <1>;
  88. +
  89. +   flash@0 {
  90. +       compatible = "jedec,spi-nor";
  91. +       reg = <0>;
  92. +       spi-max-frequency = <25000000>;
  93. +
  94. +       partitions {
  95. +           compatible = "fixed-partitions";
  96. +           #address-cells = <1>;
  97. +           #size-cells = <1>;
  98. +
  99. +           partition@0 {
  100. +               label = "factory-boot";
  101. +               reg = <0x000000 0x040000>;
  102. +               read-only;
  103. +           };
  104. +
  105. +           partition@40000 {
  106. +               label = "u-boot";
  107. +               reg = <0x040000 0x040000>;
  108. +               read-only;
  109. +           };
  110. +
  111. +           partition@80000 {
  112. +               label = "partition-table";
  113. +               reg = <0x080000 0x010000>;
  114. +               read-only;
  115. +           };
  116. +
  117. +           info: partition@90000 {
  118. +               label = "info";
  119. +               reg = <0x090000 0x010000>;
  120. +               read-only;
  121. +           };
  122. +
  123. +           art: partition@a0000 {
  124. +               label = "art";
  125. +               reg = <0x0a0000 0x010000>;
  126. +               read-only;
  127. +           };
  128. +
  129. +           partition@b0000 {
  130. +               label = "extra-para";
  131. +               reg = <0x0b0000 0x010000>;
  132. +               read-only;
  133. +           };
  134. +
  135. +           partition@c0000 {
  136. +               compatible = "openwrt,okli"
  137. +               label = "firmware";
  138. +               reg = <0x0c0000 0xe40000>;
  139. +               read-only;
  140. +           };
  141. +
  142. +           partition@f00000 {
  143. +               label = "config";
  144. +               reg = <0xf00000 0x030000>;
  145. +               read-only;
  146. +           };
  147. +
  148. +           partition@f30000 {
  149. +               label = "mutil-log";
  150. +               reg = <0xf30000 0x080000>;
  151. +               read-only;
  152. +           };
  153. +
  154. +           partition@fb0000 {
  155. +               label = "oops";
  156. +               reg = <0xfb0000 0x040000>;
  157. +               read-only;
  158. +           };
  159. +
  160. +       };
  161. +   };
  162. +};
  163. +
  164. +&eth0 {
  165. +   status = "okay";
  166. +
  167. +   phy-handle = <&phy0>;
  168. +
  169. +   mtd-mac-address = <&info 0x8>;
  170. +};
  171. +
  172. +&wmac {
  173. +   status = "okay";
  174. +
  175. +   mtd-cal-data = <&art 0x1000>;
  176. +   mtd-mac-address = <&info 0x8>;
  177. +   mtd-mac-address-increment = <1>;
  178. +};
  179. +
  180. diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
  181. index 191d902dc5..9ab0bf5a69 100755
  182. --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
  183. +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
  184. @@ -252,6 +252,10 @@ ath79_setup_interfaces()
  185.         ucidef_add_switch "switch0" \
  186.             "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan"
  187.         ;;
  188. +    tplink,eap245-v3)
  189. +        ucidef_add_switch "switch0" \
  190. +            "0@eth0" "1:lan:1" "2:lan:4"
  191. +        ;;
  192.     tplink,tl-mr6400-v1)
  193.         ucidef_set_interfaces_lan_wan "eth0.1 eth1" "usb0"
  194.         ucidef_add_switch "switch0" \
  195. diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  196. index b3c4d60ed8..c5460803c4 100644
  197. --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  198. +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
  199. @@ -175,6 +175,12 @@ case "$FIRMWARE" in
  200.         ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
  201.             /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
  202.         ;;
  203. +    tplink,eap245-v3)
  204. +       caldata_extract "art" 0x5000 0x2f20
  205. +       ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) +1)
  206. +       ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
  207. +           /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
  208. +       ;;
  209.     yuncore,a782|\
  210.     yuncore,xd4200)
  211.         caldata_extract "art" 0x5000 0x2f20
  212. diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
  213. index 5b8d91c3e6..a6b40745b4 100644
  214. --- a/target/linux/ath79/image/generic-tp-link.mk
  215. +++ b/target/linux/ath79/image/generic-tp-link.mk
  216. @@ -324,6 +324,23 @@ define Device/tplink_eap245-v1
  217.  endef
  218.  TARGET_DEVICES += tplink_eap245-v1
  219.  
  220. +define Device/tplink_eap245-v3
  221. +  ATH_SOC := qca9563
  222. +  SOC := qca9563
  223. +  IMAGE_SIZE := 15360k
  224. +  DEVICE_MODEL := EAP245
  225. +  DEVICE_VARIANT := v3
  226. +  DEVICE_TITLE := TP-Link EAP245 v3
  227. +  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  228. +  TPLINK_BOARD_ID := EAP245-V3
  229. +  BOARDNAME := EAP245-V3
  230. +  SUPPORTED_DEVICES += eap245-v3
  231. +  LOADER_TYPE := elf
  232. +  KERNEL := kernel-bin | append-dtb | lzma | loader-kernel
  233. +  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
  234. +endef
  235. +TARGET_DEVICES += tplink_eap245-v3
  236. +
  237.  define Device/tplink_re350k-v1
  238.    $(Device/tplink-safeloader)
  239.    SOC := qca9558
  240. diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
  241. index a46f990675..c50de863d8 100644
  242. --- a/tools/firmware-utils/src/tplink-safeloader.c
  243. +++ b/tools/firmware-utils/src/tplink-safeloader.c
  244. @@ -1243,6 +1243,37 @@ static struct device_info boards[] = {
  245.         .last_sysupgrade_partition = "file-system"
  246.     },
  247.  
  248. +   /** Firmware layout for the EAP245 v3 */
  249. +   {
  250. +       .id     = "EAP245-V3",
  251. +       .support_list =
  252. +           "SupportList:\r\n"
  253. +           "EAP245(TP-LINK|UN|AC1750-D):3.0\r\n",
  254. +       .support_trail = '\xff',
  255. +       .soft_ver = NULL,
  256. +
  257. +        /** Merged os-image/file-system into dynamic firmware partition */
  258. +       .partitions = {
  259. +               {"factory-boot", 0x00000, 0x40000},
  260. +                {"u-boot", 0x40000, 0x40000},
  261. +               {"partition-table", 0x80000, 0x10000},
  262. +               {"default-mac", 0x90000, 0x01000},
  263. +               {"support-list", 0x91000, 0x00100},
  264. +               {"product-info", 0x91100, 0x00400},
  265. +               {"soft-version", 0x92000, 0x00100},
  266. +               {"radio", 0xa0000, 0x10000},
  267. +               {"extra-para", 0xb0000, 0x10000},
  268. +               {"firmware", 0xc0000, 0xe40000},
  269. +               {"config", 0xf00000, 0x30000},
  270. +               {"mutil-log", 0xf30000, 0x80000},
  271. +               {"oops", 0xfb0000, 0x40000},
  272. +               {NULL, 0, 0}
  273. +       },
  274. +
  275. +       .first_sysupgrade_partition = "os-image",
  276. +       .last_sysupgrade_partition = "file-system"
  277. +   },
  278. +
  279.     /** Firmware layout for the TL-WA850RE v2 */
  280.     {
  281.         .id     = "TLWA850REV2",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement