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