ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_ec330-g5u-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,ec330-g5u-v1", "mediatek,mt7621-soc";
11 model = "TP-Link EC330-G5u v1";
12
13 aliases {
14 label-mac-device = &gmac0;
15
16 led-boot = &led_power;
17 led-failsafe = &led_power;
18 led-running = &led_power;
19 led-upgrade = &led_power;
20 };
21
22 chosen {
23 bootargs = "console=ttyS0,115200";
24 };
25
26 leds {
27 compatible = "gpio-leds";
28
29 led-0 {
30 color = <LED_COLOR_ID_BLUE>;
31 function = LED_FUNCTION_USB;
32 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
33 trigger-sources = <&xhci_ehci_port1>;
34 linux,default-trigger = "usbport";
35 };
36
37 led-1 {
38 color = <LED_COLOR_ID_BLUE>;
39 function = LED_FUNCTION_WPS;
40 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
41 };
42
43 led-2 {
44 color = <LED_COLOR_ID_BLUE>;
45 function = LED_FUNCTION_LAN;
46 gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
47 };
48
49 led-3 {
50 color = <LED_COLOR_ID_AMBER>;
51 function = LED_FUNCTION_WAN;
52 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
53 };
54
55 led-4 {
56 color = <LED_COLOR_ID_BLUE>;
57 function = LED_FUNCTION_WAN;
58 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
59 };
60
61 led-5 {
62 color = <LED_COLOR_ID_BLUE>;
63 function = LED_FUNCTION_WLAN;
64 function-enumerator = <50>;
65 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
66 linux,default-trigger = "phy1tpt";
67 };
68
69 led-6 {
70 color = <LED_COLOR_ID_BLUE>;
71 function = LED_FUNCTION_WLAN;
72 function-enumerator = <24>;
73 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
74 linux,default-trigger = "phy0tpt";
75 };
76
77 led_power: led-7 {
78 color = <LED_COLOR_ID_BLUE>;
79 function = LED_FUNCTION_POWER;
80 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
81 };
82 };
83
84 keys {
85 compatible = "gpio-keys";
86
87 button-0 {
88 label = "led";
89 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
90 debounce-interval = <60>;
91 linux,code = <KEY_LIGHTS_TOGGLE>;
92 };
93
94 button-1 {
95 label = "wifi on/off";
96 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
97 debounce-interval = <60>;
98 linux,code = <KEY_RFKILL>;
99 };
100
101 button-2 {
102 label = "reset";
103 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
104 debounce-interval = <60>;
105 linux,code = <KEY_RESTART>;
106 };
107
108 button-3 {
109 label = "wps";
110 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
111 debounce-interval = <60>;
112 linux,code = <KEY_WPS_BUTTON>;
113 };
114 };
115
116 gpio-export {
117 compatible = "gpio-export";
118
119 led-light {
120 gpio-export,name = "led-light";
121 gpio-export,output = <0>;
122 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
123 };
124 };
125
126 ubi-concat {
127 compatible = "mtd-concat";
128 devices = <&ubiconcat0 &ubiconcat1>;
129
130 partitions {
131 compatible = "fixed-partitions";
132 #address-cells = <1>;
133 #size-cells = <1>;
134
135 partition@0 {
136 label = "ubi";
137 reg = <0x0 0x3c00000>;
138 };
139 };
140 };
141 };
142
143 &nand {
144 status = "okay";
145
146 partitions {
147 compatible = "fixed-partitions";
148 #address-cells = <1>;
149 #size-cells = <1>;
150
151 partition@0 {
152 label = "u-boot";
153 reg = <0x0 0x400000>;
154 read-only;
155
156 compatible = "fixed-partitions";
157 #address-cells = <1>;
158 #size-cells = <1>;
159
160 partition@0 {
161 label = "u-boot-first";
162 reg = <0x0 0x20000>;
163 read-only;
164 };
165
166 partition@20000 {
167 label = "u-boot-main";
168 reg = <0x20000 0x40000>;
169 read-only;
170 };
171
172 partition@60000 {
173 label = "u-boot-main-reserve";
174 reg = <0x60000 0x40000>;
175 read-only;
176 };
177 };
178
179 partition@400000 {
180 label = "os0";
181 reg = <0x400000 0x3000000>;
182
183 compatible = "fixed-partitions";
184 #address-cells = <1>;
185 #size-cells = <1>;
186
187 partition@0 {
188 label = "kernel";
189 reg = <0x0 0x400000>;
190 };
191
192 ubiconcat0: partition@400000 {
193 label = "ubi-os0";
194 reg = <0x400000 0x2c00000>;
195 };
196 };
197
198 partition@3400000 {
199 label = "os1";
200 reg = <0x3400000 0x3000000>;
201 read-only;
202 };
203
204 ubiconcat1: partition@6400000 {
205 label = "userfs";
206 reg = <0x6400000 0x1000000>;
207 };
208
209 partition@7400000 {
210 label = "u-boot-env";
211 reg = <0x7400000 0x400000>;
212 };
213
214 partition@7800000 {
215 label = "factory";
216 reg = <0x7800000 0x400000>;
217 read-only;
218
219 nvmem-layout {
220 compatible = "fixed-layout";
221 #address-cells = <1>;
222 #size-cells = <1>;
223
224 eeprom_factory_8000: eeprom@8000 {
225 reg = <0x8000 0x4da8>;
226 };
227
228 eeprom_factory_14000: eeprom@14000 {
229 reg = <0x14000 0x4da8>;
230 };
231
232 macaddr_factory_165: macaddr@165 {
233 compatible = "mac-base";
234 reg = <0x165 0x11>;
235 #nvmem-cell-cells = <1>;
236 };
237 };
238 };
239
240 partition@0_wholeflash {
241 label = "wholeflash";
242 reg = <0x0 0x7f80000>;
243 read-only;
244 };
245 };
246 };
247
248 &pcie {
249 status = "okay";
250 };
251
252 &pcie0 {
253 wifi@0,0 {
254 compatible = "mediatek,mt76";
255 reg = <0x0000 0 0 0 0>;
256 ieee80211-freq-limit = <2400000 2500000>;
257 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_165 0>;
258 nvmem-cell-names = "eeprom", "mac-address";
259 };
260 };
261
262 &pcie1 {
263 wifi@0,0 {
264 compatible = "mediatek,mt76";
265 reg = <0x0000 0 0 0 0>;
266 ieee80211-freq-limit = <5000000 6000000>;
267 nvmem-cells = <&eeprom_factory_14000>, <&macaddr_factory_165 2>;
268 nvmem-cell-names = "eeprom", "mac-address";
269 };
270 };
271
272 &gmac0 {
273 nvmem-cells = <&macaddr_factory_165 0>;
274 nvmem-cell-names = "mac-address";
275 };
276
277 &gmac1 {
278 status = "okay";
279 label = "wan";
280 phy-handle = <&ethphy0>;
281
282 nvmem-cells = <&macaddr_factory_165 1>;
283 nvmem-cell-names = "mac-address";
284 };
285
286 &ethphy0 {
287 /delete-property/ interrupts;
288 };
289
290 &switch0 {
291 ports {
292 port@1 {
293 status = "okay";
294 label = "lan1";
295 };
296
297 port@2 {
298 status = "okay";
299 label = "lan2";
300 };
301
302 port@3 {
303 status = "okay";
304 label = "lan3";
305 };
306
307 port@4 {
308 status = "okay";
309 label = "lan4";
310 };
311 };
312 };
313
314 &state_default {
315 gpio {
316 groups = "i2c", "jtag", "uart2", "uart3", "wdt";
317 function = "gpio";
318 };
319 };