Advertisement
Guest User

Patch Comfast CF-E538AC

a guest
Nov 10th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 KB | None | 0 0
  1. diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
  2. index 5c005db0c1..16c012d827 100755
  3. --- a/target/linux/ramips/base-files/etc/board.d/01_leds
  4. +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
  5. @@ -88,6 +88,9 @@ c50)
  6. ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
  7. ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
  8. ;;
  9. +cf-e538ac)
  10. + set_wifi_led "$boardname:white:wifi"
  11. + ;;
  12. cf-wr800n)
  13. ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
  14. set_wifi_led "$boardname:white:wifi"
  15. diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
  16. index 8ca1831afe..cae7d9fa1d 100755
  17. --- a/target/linux/ramips/base-files/etc/board.d/02_network
  18. +++ b/target/linux/ramips/base-files/etc/board.d/02_network
  19. @@ -310,6 +310,11 @@ ramips_setup_interfaces()
  20. ucidef_add_switch "switch0" \
  21. "4:lan" "6t@eth0"
  22. ;;
  23. + cf-e538ac)
  24. + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
  25. + ucidef_add_switch "switch0" \
  26. + "4:wan" "5:lan" "6@eth0"
  27. + ;;
  28. cudy,wr1000)
  29. ucidef_add_switch "switch0" \
  30. "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
  31. @@ -548,6 +553,10 @@ ramips_setup_macs()
  32. lan_mac=$(cat /sys/class/net/eth0/address)
  33. wan_mac=$(mtd_get_mac_binary devdata 7)
  34. ;;
  35. + cf-e538ac)
  36. + lan_mac=$(mtd_get_mac_binary factory 57344)
  37. + wan_mac=$(macaddr_add "$lan_mac" 1)
  38. + ;;
  39. cy-swr1100|\
  40. dir-645)
  41. lan_mac=$(mtd_get_mac_ascii nvram lanmac)
  42. diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
  43. index 093303892c..5e9b8fdb09 100755
  44. --- a/target/linux/ramips/base-files/lib/ramips.sh
  45. +++ b/target/linux/ramips/base-files/lib/ramips.sh
  46. @@ -97,6 +97,9 @@ ramips_board_detect() {
  47. *"CF-WR800N")
  48. name="cf-wr800n"
  49. ;;
  50. + *"CF-E538AC")
  51. + name="cf-e538ac"
  52. + ;;
  53. *"CS-QR10")
  54. name="cs-qr10"
  55. ;;
  56. diff --git a/target/linux/ramips/dts/CF-E538AC.dts b/target/linux/ramips/dts/CF-E538AC.dts
  57. new file mode 100644
  58. index 0000000000..a4502a9ae7
  59. --- /dev/null
  60. +++ b/target/linux/ramips/dts/CF-E538AC.dts
  61. @@ -0,0 +1,163 @@
  62. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  63. +/dts-v1/;
  64. +
  65. +#include "mt7620a.dtsi"
  66. +
  67. +#include <dt-bindings/gpio/gpio.h>
  68. +#include <dt-bindings/input/input.h>
  69. +
  70. +/ {
  71. + compatible = "comfast,cf-e538ac", "ralink,mt7620n-soc";
  72. + model = "Comfast CF-E538AC";
  73. +
  74. + aliases {
  75. + led-boot = &led_wifi;
  76. + led-failsafe = &led_wifi;
  77. + led-running = &led_wifi;
  78. + led-upgrade = &led_wifi;
  79. + };
  80. +
  81. + chosen {
  82. + bootargs = "console=ttyS0,115200";
  83. + };
  84. +
  85. + leds {
  86. + compatible = "gpio-leds";
  87. +
  88. + led_wifi: wifi {
  89. + label = "cf-e538ac:white:wifi";
  90. + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
  91. + };
  92. + };
  93. +
  94. + keys {
  95. + compatible = "gpio-keys-polled";
  96. + poll-interval = <20>;
  97. +
  98. + reset {
  99. + label = "reset";
  100. + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
  101. + linux,code = <KEY_RESTART>;
  102. + };
  103. + };
  104. +
  105. +};
  106. +
  107. +&gpio0 {
  108. + status = "okay";
  109. +};
  110. +
  111. +&gpio2 {
  112. + status = "okay";
  113. +};
  114. +
  115. +&gpio3 {
  116. + status = "okay";
  117. +};
  118. +
  119. +&spi0 {
  120. + status = "okay";
  121. +
  122. + m25p80@0 {
  123. + compatible = "jedec,spi-nor";
  124. + reg = <0>;
  125. + spi-max-frequency = <10000000>;
  126. +
  127. + partitions {
  128. + compatible = "fixed-partitions";
  129. + #address-cells = <1>;
  130. + #size-cells = <1>;
  131. +
  132. + partition@0 {
  133. + label = "u-boot";
  134. + reg = <0x0 0x30000>;
  135. + read-only;
  136. + };
  137. +
  138. + partition@30000 {
  139. + label = "u-boot-env";
  140. + reg = <0x30000 0x10000>;
  141. + read-only;
  142. + };
  143. +
  144. + factory: partition@40000 {
  145. + label = "factory";
  146. + reg = <0x40000 0x10000>;
  147. + read-only;
  148. + };
  149. +
  150. + partition@50000 {
  151. + compatible = "denx,uimage";
  152. + label = "firmware";
  153. + reg = <0x50000 0x7b0000>;
  154. + };
  155. + };
  156. + };
  157. +};
  158. +
  159. +&ethernet {
  160. + status = "okay";
  161. + pinctrl-names = "default";
  162. + mtd-mac-address = < 0x09 0xe000 >;
  163. + pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
  164. + mediatek,portmap = "llllw";
  165. +
  166. + port@4 {
  167. + status = "okay";
  168. + phy-mode = "rgmii";
  169. + phy-handle = <&phy4>;
  170. + };
  171. +
  172. + port@5 {
  173. + status = "okay";
  174. + phy-mode = "rgmii";
  175. + phy-handle = <&phy5>;
  176. + };
  177. +
  178. + mdio-bus {
  179. + status = "okay";
  180. +
  181. + phy4: ethernet-phy@4 {
  182. + reg = < 0x04 >;
  183. + phy-mode = "rgmii";
  184. + };
  185. +
  186. + phy5: ethernet-phy@5 {
  187. + reg = < 0x05 >;
  188. + phy-mode = "rgmii";
  189. + };
  190. + };
  191. +};
  192. +
  193. +&gsw {
  194. + mediatek,port4 = "gmac";
  195. +};
  196. +
  197. +&wmac {
  198. + ralink,mtd-eeprom = <&factory 0>;
  199. + reg = < 0x10180000 0x9c40 >;
  200. +};
  201. +
  202. +
  203. +&pcie {
  204. + status = "okay";
  205. +};
  206. +
  207. +&pinctrl {
  208. + state_default: pinctrl0 {
  209. + gpio {
  210. + ralink,group = "uartf", "nd_sd", "wled";
  211. + ralink,function = "gpio";
  212. + };
  213. + };
  214. +};
  215. +
  216. +&pcie0 {
  217. + mt76@0,0 {
  218. + reg = <0x0000 0 0 0 0>;
  219. + mediatek,mtd-eeprom = <&factory 0x8000>;
  220. + ieee80211-freq-limit = <5000000 6000000>;
  221. + };
  222. +};
  223. +
  224. +
  225. diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
  226. index 89723fbb52..d16704a55e 100644
  227. --- a/target/linux/ramips/image/mt7620.mk
  228. +++ b/target/linux/ramips/image/mt7620.mk
  229. @@ -155,6 +155,13 @@ define Device/cf-wr800n
  230. endef
  231. TARGET_DEVICES += cf-wr800n
  232.  
  233. +define Device/cf-e538ac
  234. + DTS := CF-E538AC
  235. + DEVICE_TITLE := Comfast CF-E538AC
  236. + DEVICE_PACKAGES := kmod-mt76x2
  237. +endef
  238. +TARGET_DEVICES += cf-e538ac
  239. +
  240. define Device/cs-qr10
  241. DTS := CS-QR10
  242. DEVICE_TITLE := Planex CS-QR10
  243.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement