ramips: mt7621: fix Xiaomi Router 3G/Pro LEDs
[openwrt/staging/ldir.git] / target / linux / ramips / dts / mt7621_xiaomi_mi-router-3-pro.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 = "xiaomi,mi-router-3-pro", "mediatek,mt7621-soc";
11 model = "Xiaomi Mi Router 3 Pro";
12
13 aliases {
14 led-boot = &led_status_yellow;
15 led-failsafe = &led_status_red;
16 led-running = &led_status_blue;
17 led-upgrade = &led_status_yellow;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200n8";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led_status_red: led-0 {
29 label = "red:status";
30 color = <LED_COLOR_ID_RED>;
31 function = LED_FUNCTION_STATUS;
32 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
33 };
34
35 led_status_blue: led-1 {
36 label = "blue:status";
37 color = <LED_COLOR_ID_BLUE>;
38 function = LED_FUNCTION_STATUS;
39 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
40 };
41
42 led_status_yellow: led-2 {
43 label = "yellow:status";
44 color = <LED_COLOR_ID_YELLOW>;
45 function = LED_FUNCTION_STATUS;
46 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
47 };
48
49 led-3 {
50 label = "amber:wan";
51 color = <LED_COLOR_ID_AMBER>;
52 function = LED_FUNCTION_WAN;
53 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
54 linux,default-trigger = "mt7530-0:04:1Gbps";
55 };
56
57 led-4 {
58 label = "amber:lan3";
59 color = <LED_COLOR_ID_AMBER>;
60 function = LED_FUNCTION_LAN;
61 function-enumerator = <3>;
62 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "mt7530-0:03:1Gbps";
64 };
65
66 led-5 {
67 label = "amber:lan2";
68 color = <LED_COLOR_ID_AMBER>;
69 function = LED_FUNCTION_LAN;
70 function-enumerator = <2>;
71 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
72 linux,default-trigger = "mt7530-0:02:1Gbps";
73 };
74
75 led-6 {
76 label = "amber:lan1";
77 color = <LED_COLOR_ID_AMBER>;
78 function = LED_FUNCTION_LAN;
79 function-enumerator = <1>;
80 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
81 linux,default-trigger = "mt7530-0:01:1Gbps";
82 };
83 };
84
85 keys {
86 compatible = "gpio-keys";
87
88 reset {
89 label = "reset";
90 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
91 linux,code = <KEY_RESTART>;
92 };
93 };
94
95 reg_usb_vbus: regulator {
96 compatible = "regulator-fixed";
97 regulator-name = "usb_vbus";
98 regulator-min-microvolt = <5000000>;
99 regulator-max-microvolt = <5000000>;
100 gpio = <&gpio 12 GPIO_ACTIVE_HIGH>;
101 enable-active-high;
102 };
103 };
104
105 &xhci {
106 vbus-supply = <&reg_usb_vbus>;
107 };
108
109 &nand {
110 status = "okay";
111
112 partitions {
113 compatible = "fixed-partitions";
114 #address-cells = <1>;
115 #size-cells = <1>;
116
117 partition@0 {
118 label = "Bootloader";
119 reg = <0x0 0x40000>;
120 read-only;
121 };
122
123 partition@40000 {
124 label = "Config";
125 reg = <0x40000 0x40000>;
126 };
127
128 partition@80000 {
129 label = "Bdata";
130 reg = <0x80000 0x40000>;
131 read-only;
132 };
133
134 factory: partition@c0000 {
135 label = "factory";
136 reg = <0x0c0000 0x40000>;
137 read-only;
138 };
139
140 partition@100000 {
141 label = "crash";
142 reg = <0x100000 0x40000>;
143 };
144
145 partition@140000 {
146 label = "crash_syslog";
147 reg = <0x140000 0x80000>;
148 };
149
150 partition@1c0000 {
151 label = "reserved0";
152 reg = <0x1c0000 0x40000>;
153 read-only;
154 };
155
156 /* We keep stock xiaomi firmware (kernel0) here */
157 partition@200000 {
158 label = "kernel_stock";
159 reg = <0x200000 0x400000>;
160 };
161
162 partition@600000 {
163 label = "kernel";
164 reg = <0x600000 0x400000>;
165 };
166
167 partition@a00000 {
168 label = "ubi";
169 reg = <0xa00000 0xf580000>;
170 };
171 };
172 };
173
174 &pcie {
175 status = "okay";
176 };
177
178 &pcie0 {
179 wifi@0,0 {
180 compatible = "mediatek,mt76";
181 reg = <0x0000 0 0 0 0>;
182 mediatek,mtd-eeprom = <&factory 0x0000>;
183 ieee80211-freq-limit = <2400000 2500000>;
184 };
185 };
186
187 &pcie1 {
188 wifi@0,0 {
189 compatible = "mediatek,mt76";
190 reg = <0x0000 0 0 0 0>;
191 mediatek,mtd-eeprom = <&factory 0x8000>;
192 ieee80211-freq-limit = <5000000 6000000>;
193 };
194 };
195
196 &gmac0 {
197 nvmem-cells = <&macaddr_factory_e006>;
198 nvmem-cell-names = "mac-address";
199 };
200
201 &gmac1 {
202 status = "okay";
203 label = "wan";
204 phy-handle = <&ethphy4>;
205
206 nvmem-cells = <&macaddr_factory_e000>;
207 nvmem-cell-names = "mac-address";
208 };
209
210 &mdio {
211 ethphy4: ethernet-phy@4 {
212 reg = <4>;
213 };
214 };
215
216 &switch0 {
217 ports {
218 port@1 {
219 status = "okay";
220 label = "lan3";
221 };
222
223 port@2 {
224 status = "okay";
225 label = "lan2";
226 };
227
228 port@3 {
229 status = "okay";
230 label = "lan1";
231 };
232 };
233 };
234
235 &state_default {
236 gpio {
237 groups = "jtag", "uart2", "uart3", "wdt";
238 function = "gpio";
239 };
240 };
241
242 &factory {
243 compatible = "nvmem-cells";
244 #address-cells = <1>;
245 #size-cells = <1>;
246
247 macaddr_factory_e000: macaddr@e000 {
248 reg = <0xe000 0x6>;
249 };
250
251 macaddr_factory_e006: macaddr@e006 {
252 reg = <0xe006 0x6>;
253 };
254 };