b2b762d63a7f756534d4bfa41d078fcbb3677b7a
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_wavlink_wl-wn579x3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "wavlink,wl-wn579x3", "ralink,mt7620a-soc";
10 model = "Wavlink WL-WN579X3";
11
12 aliases {
13 led-boot = &led_wps;
14 led-failsafe = &led_wps;
15 led-running = &led_wps;
16 led-upgrade = &led_wps;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset {
23 label = "reset";
24 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RESTART>;
26 };
27
28 wps {
29 label = "wps";
30 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_WPS_BUTTON>;
32 };
33
34 switch_aps {
35 label = "mode_aps";
36 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
37 linux,code = <BTN_1>;
38 linux,input-type = <EV_SW>;
39 };
40
41 switch_repeater {
42 label = "mode_repeater";
43 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
44 linux,code = <BTN_0>;
45 linux,input-type = <EV_SW>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 led_wps: wps {
53 label = "blue:wps";
54 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
55 };
56
57 lan {
58 label = "blue:lan";
59 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
60 };
61
62 wan {
63 label = "blue:wan";
64 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
65 };
66
67 wifi {
68 label = "blue:wifi";
69 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
70 };
71
72 /* These three form the signal wifi strength segments */
73 wifi_high {
74 label = "blue:wifi_high";
75 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
76 };
77
78 wifi_medium {
79 label = "blue:wifi_medium";
80 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
81 };
82
83 wifi_low {
84 label = "blue:wifi_low";
85 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
86 };
87 };
88 };
89
90 &gpio2 {
91 status = "okay";
92 };
93
94 &gpio3 {
95 status = "okay";
96 };
97
98 &spi0 {
99 status = "okay";
100
101 flash@0 {
102 compatible = "jedec,spi-nor";
103 reg = <0>;
104 spi-max-frequency = <50000000>;
105
106 partitions {
107 compatible = "fixed-partitions";
108 #address-cells = <1>;
109 #size-cells = <1>;
110
111 partition@0 {
112 label = "u-boot";
113 reg = <0x0 0x30000>;
114 read-only;
115 };
116
117 partition@30000 {
118 label = "config";
119 reg = <0x30000 0x10000>;
120 read-only;
121 };
122
123 factory: partition@40000 {
124 label = "factory";
125 reg = <0x40000 0x10000>;
126 read-only;
127
128 nvmem-layout {
129 compatible = "fixed-layout";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 eeprom_factory_0: eeprom@0 {
134 reg = <0x0 0x200>;
135 };
136
137 eeprom_factory_8000: eeprom@8000 {
138 reg = <0x8000 0x200>;
139 };
140
141 macaddr_factory_28: macaddr@28 {
142 reg = <0x28 0x6>;
143 };
144 };
145 };
146
147 partition@50000 {
148 compatible = "denx,uimage";
149 label = "firmware";
150 reg = <0x50000 0x790000>;
151 };
152
153 partition@7e0000 {
154 label = "board_data";
155 reg = <0x7e0000 0x10000>;
156 read-only;
157 };
158
159 partition@7f0000 {
160 label = "nvram";
161 reg = <0x7f0000 0x10000>;
162 read-only;
163 };
164 };
165 };
166 };
167
168 &pcie {
169 status = "okay";
170 };
171
172 &pcie0 {
173 wifi@0,0 {
174 reg = <0x0000 0 0 0 0>;
175 nvmem-cells = <&eeprom_factory_8000>;
176 nvmem-cell-names = "eeprom";
177 ieee80211-freq-limit = <5000000 6000000>;
178 };
179 };
180
181 &ethernet {
182 pinctrl-names = "default";
183 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
184
185 nvmem-cells = <&macaddr_factory_28>;
186 nvmem-cell-names = "mac-address";
187
188 mediatek,portmap = "llllw";
189
190 port@4 {
191 status = "okay";
192 phy-handle = <&phy4>;
193 phy-mode = "rgmii";
194 };
195
196 port@5 {
197 status = "okay";
198 phy-handle = <&phy5>;
199 phy-mode = "rgmii";
200 };
201
202 mdio-bus {
203 status = "okay";
204
205 phy4: ethernet-phy@4 {
206 reg = <4>;
207 phy-mode = "rgmii";
208 };
209
210 phy5: ethernet-phy@5 {
211 reg = <5>;
212 phy-mode = "rgmii";
213 };
214 };
215 };
216
217 &gsw {
218 mediatek,port4-gmac;
219 mediatek,ephy-base = /bits/ 8 <8>;
220 };
221
222 &wmac {
223 nvmem-cells = <&eeprom_factory_0>;
224 nvmem-cell-names = "eeprom";
225 };
226
227 &state_default {
228 gpio {
229 groups = "ephy", "i2c", "wled", "uartf";
230 function = "gpio";
231 };
232 };