Advertisement
Guest User

Untitled

a guest
Apr 14th, 2021
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.66 KB | None | 0 0
  1. diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
  2. new file mode 100644
  3. index 0000000000..4b77b35843
  4. --- /dev/null
  5. +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn578a2.dts
  6. @@ -0,0 +1,165 @@
  7. +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
  8. +
  9. +#include "mt7628an.dtsi"
  10. +
  11. +#include <dt-bindings/input/input.h>
  12. +#include <dt-bindings/gpio/gpio.h>
  13. +
  14. +/ {
  15. +   compatible = "wavlink,wl-wn578a2", "mediatek,mt7628an-soc";
  16. +   model = "Wavlink WL-WN578A2";
  17. +
  18. +   aliases {
  19. +       led-boot = &led_wps;
  20. +       led-failsafe = &led_wps;
  21. +       led-running = &led_wps;
  22. +       led-upgrade = &led_wps;
  23. +   };
  24. +
  25. +   keys {
  26. +       compatible = "gpio-keys";
  27. +
  28. +       reset {
  29. +           label = "reset";
  30. +           gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
  31. +           linux,code = <KEY_RESTART>;
  32. +       };
  33. +
  34. +       wps {
  35. +           label = "wps";
  36. +           gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
  37. +           linux,code = <KEY_WPS_BUTTON>;
  38. +       };
  39. +
  40. +       ap {
  41. +           label = "ap";
  42. +           gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
  43. +           linux,code = <BTN_0>;
  44. +           linux,input-type = <EV_SW>;
  45. +       };
  46. +
  47. +       repeater {
  48. +           label = "repeater";
  49. +           gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
  50. +           linux,code = <BTN_0>;
  51. +           linux,input-type = <EV_SW>;
  52. +       };
  53. +   };
  54. +
  55. +   leds {
  56. +       compatible = "gpio-leds";
  57. +
  58. +       wifi-high {
  59. +           label = "green:wifi-high";
  60. +           gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
  61. +       };
  62. +
  63. +       wifi-med {
  64. +           label = "green:wifi-med";
  65. +           gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
  66. +       };
  67. +
  68. +       wifi-low {
  69. +           label = "green:wifi-low";
  70. +           gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
  71. +       };
  72. +
  73. +       lan {
  74. +           label = "green:lan";
  75. +           gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
  76. +       };
  77. +
  78. +       wan {
  79. +           label = "green:wan";
  80. +           gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
  81. +       };
  82. +
  83. +       led_wps: wps {
  84. +           label = "green:wps";
  85. +           gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
  86. +       };
  87. +   };
  88. +};
  89. +
  90. +&state_default {
  91. +   gpio {
  92. +       groups = "i2c", "wdt", "wled_an", "p0led_an", "p1led_an", "p2_led", "p3led_an", "p4led_an", "refclk";
  93. +       function = "gpio";
  94. +   };
  95. +};
  96. +
  97. +&pcie {
  98. +   status = "okay";
  99. +};
  100. +
  101. +&pcie0 {
  102. +   mt76@0,0 {
  103. +       reg = <0x0000 0 0 0 0>;
  104. +       mediatek,mtd-eeprom = <&factory 0x8000>;
  105. +       ieee80211-freq-limit = <5000000 6000000>;
  106. +   };
  107. +};
  108. +
  109. +&spi0 {
  110. +   status = "okay";
  111. +
  112. +   flash@0 {
  113. +       compatible = "jedec,spi-nor";
  114. +       reg = <0>;
  115. +       spi-max-frequency = <40000000>;
  116. +
  117. +       partitions {
  118. +           compatible = "fixed-partitions";
  119. +           #address-cells = <1>;
  120. +           #size-cells = <1>;
  121. +
  122. +           partition@0 {
  123. +               label = "u-boot";
  124. +               reg = <0x0 0x30000>;
  125. +               read-only;
  126. +           };
  127. +
  128. +           partition@30000 {
  129. +               label = "u-boot-env";
  130. +               reg = <0x30000 0x10000>;
  131. +               read-only;
  132. +           };
  133. +
  134. +           factory: partition@40000 {
  135. +               label = "factory";
  136. +               reg = <0x40000 0x10000>;
  137. +               read-only;
  138. +           };
  139. +
  140. +           partition@50000 {
  141. +               compatible = "denx,uimage";
  142. +               label = "firmware";
  143. +               reg = <0x50000 0x7b0000>;
  144. +           };
  145. +       };
  146. +   };
  147. +};
  148. +
  149. +&wmac {
  150. +   status = "okay";
  151. +};
  152. +
  153. +&ethernet {
  154. +   mtd-mac-address = <&factory 0x28>;
  155. +};
  156. +
  157. +&esw {
  158. +   mediatek,portmap = <0x2f>;
  159. +};
  160. +
  161. +&usbphy {
  162. +   status = "disabled";
  163. +};
  164. +
  165. +&ehci {
  166. +   status = "disabled";
  167. +};
  168. +
  169. +&ohci {
  170. +   status = "disabled";
  171. +};
  172. diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
  173. index d5a9684dba..79221239e9 100644
  174. --- a/target/linux/ramips/image/mt76x8.mk
  175. +++ b/target/linux/ramips/image/mt76x8.mk
  176. @@ -733,6 +733,16 @@ define Device/wavlink_wl-wn577a2
  177.  endef
  178.  TARGET_DEVICES += wavlink_wl-wn577a2
  179.  
  180. +define Device/wavlink_wl-wn578a2
  181. +  IMAGE_SIZE := 7872k
  182. +  DEVICE_VENDOR := Wavlink
  183. +  DEVICE_MODEL := WL-WN578A2
  184. +  DEVICE_ALT0_VENDOR := SilverCrest
  185. +  DEVICE_ALT0_MODEL := SWV 733 A2
  186. +  DEVICE_PACKAGES := rssileds kmod-mt76x0e
  187. +endef
  188. +TARGET_DEVICES += wavlink_wl-wn578a2
  189. +
  190.  define Device/widora_neo-16m
  191.    IMAGE_SIZE := 16064k
  192.    DEVICE_VENDOR := Widora
  193. diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
  194. index fdef158ea8..00093a7cd7 100644
  195. --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
  196. +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
  197. @@ -133,6 +133,14 @@ wavlink,wl-wn577a2)
  198.     ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
  199.     ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
  200.     ;;
  201. +wavlink,wl-wn578a2)
  202. +   ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
  203. +   ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
  204. +   ucidef_set_rssimon "wlan1" "200000" "1"
  205. +   ucidef_set_led_rssi "wifi-low" "wifi-low" "green:wifi-low" "wlan1" "1" "49"
  206. +   ucidef_set_led_rssi "wifi-med" "wifi-med" "green:wifi-med" "wlan1" "50" "84"
  207. +   ucidef_set_led_rssi "wifi-high" "wifi-high" "green:wifi-high" "wlan1" "85" "100"
  208. +   ;;
  209.  zbtlink,zbt-we1226)
  210.     ucidef_set_led_netdev "wifi_led" "wifi" "green:wlan" "wlan0"
  211.     ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x01"
  212. diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
  213. index 5ce44d0e9b..d61a60591c 100644
  214. --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
  215. +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
  216. @@ -46,7 +46,8 @@ ramips_setup_interfaces()
  217.         ;;
  218.     buffalo,wcr-1166ds|\
  219.     elecom,wrc-1167fs|\
  220. -   wavlink,wl-wn577a2)
  221. +   wavlink,wl-wn577a2|\
  222. +   wavlink,wl-wn578a2)
  223.         ucidef_add_switch "switch0" \
  224.             "3:lan" "4:wan" "6@eth0"
  225.         ;;
  226. @@ -168,7 +169,8 @@ ramips_setup_macs()
  227.         ;;
  228.     cudy,wr1000|\
  229.     hilink,hlk-7688a|\
  230. -   wavlink,wl-wn577a2)
  231. +   wavlink,wl-wn577a2|\
  232. +   wavlink,wl-wn578a2)
  233.         wan_mac=$(mtd_get_mac_binary factory 0x2e)
  234.         label_mac=$(mtd_get_mac_binary factory 0x4)
  235.         ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement