ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[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 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 compatible = "nvmem-cells";
229 label = "factory";
230 reg = <0x7800000 0x400000>;
231 read-only;
232
233 nvmem-layout {
234 compatible = "fixed-layout";
235 #address-cells = <1>;
236 #size-cells = <1>;
237
238 eeprom_factory_8000: eeprom@8000 {
239 reg = <0x8000 0x4da8>;
240 };
241
242 eeprom_factory_14000: eeprom@14000 {
243 reg = <0x14000 0x4da8>;
244 };
245
246 macaddr_factory_165: macaddr@165 {
247 compatible = "mac-base";
248 reg = <0x165 0x11>;
249 #nvmem-cell-cells = <1>;
250 };
251 };
252 };
253
254 partition@0_wholeflash {
255 label = "wholeflash";
256 reg = <0x0 0x7f80000>;
257 read-only;
258 };
259 };
260 };
261
262 &pcie {
263 status = "okay";
264 };
265
266 &pcie0 {
267 wifi@0,0 {
268 compatible = "mediatek,mt76";
269 reg = <0x0000 0 0 0 0>;
270 ieee80211-freq-limit = <2400000 2500000>;
271 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_165 0>;
272 nvmem-cell-names = "eeprom", "mac-address";
273 };
274 };
275
276 &pcie1 {
277 wifi@0,0 {
278 compatible = "mediatek,mt76";
279 reg = <0x0000 0 0 0 0>;
280 ieee80211-freq-limit = <5000000 6000000>;
281 nvmem-cells = <&eeprom_factory_14000>, <&macaddr_factory_165 2>;
282 nvmem-cell-names = "eeprom", "mac-address";
283 };
284 };
285
286 &gmac0 {
287 nvmem-cells = <&macaddr_factory_165 0>;
288 nvmem-cell-names = "mac-address";
289 };
290
291 &gmac1 {
292 status = "okay";
293 label = "wan";
294 phy-handle = <&ethphy0>;
295
296 nvmem-cells = <&macaddr_factory_165 1>;
297 nvmem-cell-names = "mac-address";
298 };
299
300 &mdio {
301 ethphy0: ethernet-phy@0 {
302 reg = <0>;
303 };
304 };
305
306 &switch0 {
307 ports {
308 port@1 {
309 status = "okay";
310 label = "lan1";
311 };
312
313 port@2 {
314 status = "okay";
315 label = "lan2";
316 };
317
318 port@3 {
319 status = "okay";
320 label = "lan3";
321 };
322
323 port@4 {
324 status = "okay";
325 label = "lan4";
326 };
327 };
328 };
329
330 &state_default {
331 gpio {
332 groups = "i2c", "jtag", "uart2", "uart3", "wdt";
333 function = "gpio";
334 };
335 };