Advertisement
Guest User

Untitled

a guest
Apr 14th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.39 KB | None | 0 0
  1. diff --git a/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts
  2. new file mode 100644
  3. index 0000000000..4e4725efc9
  4. --- /dev/null
  5. +++ b/target/linux/ramips/dts/mt7628an_wavlink_wl-wn576a2.dts
  6. @@ -0,0 +1,168 @@
  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-wn576a2", "silvercrest,SWV-733-B1", "mediatek,mt7628an-soc";
  16. +   model = "WAVLINK WL-WN576A2";
  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. +       repeatermode {
  41. +           label = "repeatermode";
  42. +           gpios = <&gpio 41 GPIO_ACTIVE_HIGH>;
  43. +           linux,code = <BTN_0>;
  44. +       };
  45. +
  46. +       accesspointmode {
  47. +           label = "accesspointmode";
  48. +           gpios = <&gpio 42 GPIO_ACTIVE_HIGH>;
  49. +           linux,code = <BTN_1>;
  50. +       };
  51. +   };
  52. +
  53. +   leds {
  54. +       compatible = "gpio-leds";
  55. +
  56. +               wifi-excellent { //453/448
  57. +                        label = "blue:wifi-excellent";
  58. +                        gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
  59. +                };
  60. +
  61. +               wifi-high { //491/480
  62. +                        label = "blue:wifi-high";
  63. +                        gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
  64. +                };
  65. +
  66. +               wifi-med { //460/448
  67. +                        label = "blue:wifi-med";
  68. +                        gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
  69. +                };
  70. +
  71. +                wifi-low {
  72. +                        label = "blue:wifi-low";
  73. +                        gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
  74. +                };
  75. +
  76. +                wifi-poor {
  77. +                        label = "blue:wifi-poor";
  78. +                        gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
  79. +                };
  80. +
  81. +       wan { //482/480
  82. +           label = "blue:wan";
  83. +           gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
  84. +       };
  85. +
  86. +       led_wps: wps {
  87. +           label = "blue:wps";
  88. +           gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
  89. +       };
  90. +   };
  91. +};
  92. +
  93. +&state_default {
  94. +   gpio {
  95. +       groups = "i2c", "wdt", "p0led_an", "p3led_an", "p4led_an";
  96. +       function = "gpio";
  97. +   };
  98. +};
  99. +
  100. +&pcie {
  101. +   status = "okay";
  102. +};
  103. +
  104. +&pcie0 {
  105. +   mt76@0,0 {
  106. +       reg = <0x0000 0 0 0 0>;
  107. +       mediatek,mtd-eeprom = <&factory 0x8000>;
  108. +       ieee80211-freq-limit = <5000000 6000000>;
  109. +   };
  110. +};
  111. +
  112. +&spi0 {
  113. +   status = "okay";
  114. +
  115. +   flash@0 {
  116. +       compatible = "jedec,spi-nor";
  117. +       reg = <0>;
  118. +       spi-max-frequency = <40000000>;
  119. +
  120. +       partitions {
  121. +           compatible = "fixed-partitions";
  122. +           #address-cells = <1>;
  123. +           #size-cells = <1>;
  124. +
  125. +           partition@0 {
  126. +               label = "u-boot";
  127. +               reg = <0x0 0x30000>;
  128. +               read-only;
  129. +           };
  130. +
  131. +           partition@30000 {
  132. +               label = "u-boot-env";
  133. +               reg = <0x30000 0x10000>;
  134. +               read-only;
  135. +           };
  136. +
  137. +           factory: partition@40000 {
  138. +               label = "factory";
  139. +               reg = <0x40000 0x10000>;
  140. +               read-only;
  141. +           };
  142. +
  143. +           partition@50000 {
  144. +               compatible = "denx,uimage";
  145. +               label = "firmware";
  146. +               reg = <0x50000 0x7b0000>;
  147. +           };
  148. +       };
  149. +   };
  150. +};
  151. +
  152. +&wmac {
  153. +   status = "okay";
  154. +};
  155. +
  156. +&ethernet {
  157. +   mtd-mac-address = <&factory 0x28>;
  158. +};
  159. +
  160. +&esw {
  161. +   mediatek,portmap = <0x2f>;
  162. +};
  163. +
  164. +&usbphy {
  165. +   status = "disabled";
  166. +};
  167. +
  168. +&ehci {
  169. +   status = "disabled";
  170. +};
  171. +
  172. +&ohci {
  173. +   status = "disabled";
  174. +};
  175. diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
  176. index d5a9684dba..2936058a06 100644
  177. --- a/target/linux/ramips/image/mt76x8.mk
  178. +++ b/target/linux/ramips/image/mt76x8.mk
  179. @@ -733,6 +733,16 @@ define Device/wavlink_wl-wn577a2
  180.  endef
  181.  TARGET_DEVICES += wavlink_wl-wn577a2
  182.  
  183. +define Device/wavlink_wl-wn576a2
  184. +  IMAGE_SIZE := 7872k
  185. +  DEVICE_VENDOR := Wavlink
  186. +  DEVICE_MODEL := WL-WN576A2
  187. +  DEVICE_ALT0_VENDOR := Silvercrest
  188. +  DEVICE_ALT0_MODEL := SWV 733 B1
  189. +  DEVICE_PACKAGES := kmod-mt76x0e
  190. +endef
  191. +TARGET_DEVICES += wavlink_wl-wn576a2
  192. +
  193.  define Device/widora_neo-16m
  194.    IMAGE_SIZE := 16064k
  195.    DEVICE_VENDOR := Widora
  196. 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
  197. index fdef158ea8..e9f0d83a6d 100644
  198. --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
  199. +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds
  200. @@ -129,6 +129,16 @@ wavlink,wl-wn575a3)
  201.     ucidef_set_led_rssi "wifi-med" "wifi-med" "green:wifi-med" "wlan1" "50" "84"
  202.     ucidef_set_led_rssi "wifi-high" "wifi-high" "green:wifi-high" "wlan1" "85" "100"
  203.     ;;
  204. +wavlink,wl-wn576a2)
  205. +   ucidef_set_rssimon "wlan0" "200000" "1"
  206. +   ucidef_set_led_rssi "wifi-poor" "wifi-poor" "blue:wifi-poor" "wlan0" "1" "29"
  207. +   ucidef_set_led_rssi "wifi-low" "wifi-low" "blue:wifi-low" "wlan0" "30" "49"
  208. +   ucidef_set_led_rssi "wifi-med" "wifi-med" "blue:wifi-med" "wlan0" 50" "69"
  209. +   ucidef_set_led_rssi "wifi-high" "wifi-high" "blue:wifi-high" "wlan0" "70" "84"
  210. +   ucidef_set_led_rssi "wifi-excellent" "wifi-excellent" "blue:wifi-excellent" "wlan0" "85" "100"
  211. +   ucidef_set_led_switch "wps" "wps" "blue:wps" "switch0" "0x8"
  212. +   ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
  213. +   ;;
  214.  wavlink,wl-wn577a2)
  215.     ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x8"
  216.     ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10"
  217. 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
  218. index 5ce44d0e9b..6cab465c62 100644
  219. --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
  220. +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
  221. @@ -46,6 +46,10 @@ ramips_setup_interfaces()
  222.         ;;
  223.     buffalo,wcr-1166ds|\
  224.     elecom,wrc-1167fs|\
  225. +   wavlink,wl-wn576a2)
  226. +       ucidef_add_switch "switch0" \
  227. +           "4:lan" "6@eth0"
  228. +       ;;
  229.     wavlink,wl-wn577a2)
  230.         ucidef_add_switch "switch0" \
  231.             "3:lan" "4:wan" "6@eth0"
  232. @@ -168,6 +172,10 @@ ramips_setup_macs()
  233.         ;;
  234.     cudy,wr1000|\
  235.     hilink,hlk-7688a|\
  236. +   wavlink,wl-wn576a2)
  237. +       wan_mac=$(mtd_get_mac_binary factory 0x2e)
  238. +       label_mac=$(mtd_get_mac_binary factory 0x4)
  239. +       ;;
  240.     wavlink,wl-wn577a2)
  241.         wan_mac=$(mtd_get_mac_binary factory 0x2e)
  242.         label_mac=$(mtd_get_mac_binary factory 0x4)
  243.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement