6c9cc407015b3840908f8555ee7220ca66d03db7
[openwrt/staging/hauke.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 function-enumerator = <0>;
33 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
34 trigger-sources = <&xhci_ehci_port1>;
35 linux,default-trigger = "usbport";
36 };
37
38 led-1 {
39 label = "blue:wps";
40 color = <LED_COLOR_ID_BLUE>;
41 function = LED_FUNCTION_WPS;
42 function-enumerator = <0>;
43 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
44 };
45
46 led-2 {
47 label = "blue:ethernet";
48 color = <LED_COLOR_ID_BLUE>;
49 function = LED_FUNCTION_LAN;
50 function-enumerator = <0>;
51 gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
52 };
53
54 led-3 {
55 label = "amber:internet";
56 color = <LED_COLOR_ID_AMBER>;
57 function = LED_FUNCTION_WAN;
58 function-enumerator = <0>;
59 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
60 };
61
62 led-4 {
63 label = "blue:internet";
64 color = <LED_COLOR_ID_BLUE>;
65 function = LED_FUNCTION_WAN;
66 function-enumerator = <1>;
67 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
68 };
69
70 led-5 {
71 label = "blue:wireless_5g";
72 color = <LED_COLOR_ID_BLUE>;
73 function = LED_FUNCTION_WLAN;
74 function-enumerator = <0>;
75 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
76 linux,default-trigger = "phy1radio";
77 };
78
79 led-6 {
80 label = "blue:wireless_2g";
81 color = <LED_COLOR_ID_BLUE>;
82 function = LED_FUNCTION_WLAN;
83 function-enumerator = <1>;
84 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
85 linux,default-trigger = "phy0radio";
86 };
87
88 led_power: led-7 {
89 label = "blue:power";
90 color = <LED_COLOR_ID_BLUE>;
91 function = LED_FUNCTION_STATUS;
92 function-enumerator = <0>;
93 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
94 };
95 };
96
97 keys {
98 compatible = "gpio-keys";
99
100 led {
101 label = "led";
102 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
103 debounce-interval = <60>;
104 linux,code = <KEY_LIGHTS_TOGGLE>;
105 };
106
107 wifi {
108 label = "wifi on/off";
109 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
110 debounce-interval = <60>;
111 linux,code = <KEY_RFKILL>;
112 };
113
114 reset {
115 label = "reset";
116 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
117 debounce-interval = <60>;
118 linux,code = <KEY_RESTART>;
119 };
120
121 wps {
122 label = "wps";
123 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
124 debounce-interval = <60>;
125 linux,code = <KEY_WPS_BUTTON>;
126 };
127 };
128
129 gpio-export {
130 compatible = "gpio-export";
131
132 led-light {
133 gpio-export,name = "led-light";
134 gpio-export,output = <0>;
135 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
136 };
137 };
138
139 ubi-concat {
140 compatible = "mtd-concat";
141 devices = <&ubiconcat0 &ubiconcat1>;
142
143 partitions {
144 compatible = "fixed-partitions";
145 #address-cells = <1>;
146 #size-cells = <1>;
147
148 partition@0 {
149 label = "ubi";
150 reg = <0x0 0x3c00000>;
151 };
152 };
153 };
154 };
155
156 &nand {
157 status = "okay";
158
159 partitions {
160 compatible = "fixed-partitions";
161 #address-cells = <1>;
162 #size-cells = <1>;
163
164 partition@0 {
165 label = "u-boot";
166 reg = <0x0 0x400000>;
167 read-only;
168
169 compatible = "fixed-partitions";
170 #address-cells = <1>;
171 #size-cells = <1>;
172
173 partition@0 {
174 label = "u-boot-first";
175 reg = <0x0 0x20000>;
176 read-only;
177 };
178
179 partition@20000 {
180 label = "u-boot-main";
181 reg = <0x20000 0x40000>;
182 read-only;
183 };
184
185 partition@60000 {
186 label = "u-boot-main-reserve";
187 reg = <0x60000 0x40000>;
188 read-only;
189 };
190 };
191
192 partition@400000 {
193 label = "os0";
194 reg = <0x400000 0x3000000>;
195
196 compatible = "fixed-partitions";
197 #address-cells = <1>;
198 #size-cells = <1>;
199
200 partition@0 {
201 label = "kernel";
202 reg = <0x0 0x400000>;
203 };
204
205 ubiconcat0: partition@400000 {
206 label = "ubi-os0";
207 reg = <0x400000 0x2c00000>;
208 };
209 };
210
211 partition@3400000 {
212 label = "os1";
213 reg = <0x3400000 0x3000000>;
214 read-only;
215 };
216
217 ubiconcat1: partition@6400000 {
218 label = "userfs";
219 reg = <0x6400000 0x1000000>;
220 };
221
222 partition@7400000 {
223 label = "u-boot-env";
224 reg = <0x7400000 0x400000>;
225 };
226
227 factory: partition@7800000 {
228 label = "factory";
229 reg = <0x7800000 0x400000>;
230 read-only;
231
232 compatible = "nvmem-cells";
233 #address-cells = <1>;
234 #size-cells = <1>;
235
236 macaddr_factory_165: macaddr@165 {
237 reg = <0x165 0x11>;
238 };
239 };
240
241 partition@0_wholeflash {
242 label = "wholeflash";
243 reg = <0x0 0x7f80000>;
244 read-only;
245 };
246 };
247 };
248
249 &pcie {
250 status = "okay";
251 };
252
253 &pcie0 {
254 wifi@0,0 {
255 compatible = "mediatek,mt76";
256 reg = <0x0000 0 0 0 0>;
257 mediatek,mtd-eeprom = <&factory 0x8000>;
258 ieee80211-freq-limit = <2400000 2500000>;
259
260 nvmem-cells = <&macaddr_factory_165>;
261 nvmem-cell-names = "mac-address-ascii";
262 };
263 };
264
265 &pcie1 {
266 wifi@0,0 {
267 compatible = "mediatek,mt76";
268 reg = <0x0000 0 0 0 0>;
269 mediatek,mtd-eeprom = <&factory 0x14000>;
270 ieee80211-freq-limit = <5000000 6000000>;
271
272 nvmem-cells = <&macaddr_factory_165>;
273 nvmem-cell-names = "mac-address-ascii";
274 mac-address-increment = <(2)>;
275 };
276 };
277
278 &gmac0 {
279 nvmem-cells = <&macaddr_factory_165>;
280 nvmem-cell-names = "mac-address-ascii";
281 };
282
283 &gmac1 {
284 status = "okay";
285 label = "wan";
286 phy-handle = <&ethphy0>;
287
288 nvmem-cells = <&macaddr_factory_165>;
289 nvmem-cell-names = "mac-address-ascii";
290 mac-address-increment = <(1)>;
291 };
292
293 &mdio {
294 ethphy0: ethernet-phy@0 {
295 reg = <0>;
296 };
297 };
298
299 &switch0 {
300 ports {
301 port@1 {
302 status = "okay";
303 label = "lan1";
304 };
305
306 port@2 {
307 status = "okay";
308 label = "lan2";
309 };
310
311 port@3 {
312 status = "okay";
313 label = "lan3";
314 };
315
316 port@4 {
317 status = "okay";
318 label = "lan4";
319 };
320 };
321 };
322
323 &state_default {
324 gpio {
325 groups = "i2c", "jtag", "uart2", "uart3", "wdt";
326 function = "gpio";
327 };
328 };