62111520c011fdcc3804bfcd2239938b0a25221f
[openwrt/staging/jow.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 compatible = "nvmem-cells";
136 label = "factory";
137 reg = <0x0c0000 0x40000>;
138 #address-cells = <1>;
139 #size-cells = <1>;
140 read-only;
141
142 eeprom_factory_0: eeprom@0 {
143 reg = <0x0 0x4da8>;
144 };
145
146 eeprom_factory_8000: eeprom@8000 {
147 reg = <0x8000 0x4da8>;
148 };
149
150 macaddr_factory_e000: macaddr@e000 {
151 reg = <0xe000 0x6>;
152 };
153
154 macaddr_factory_e006: macaddr@e006 {
155 reg = <0xe006 0x6>;
156 };
157 };
158
159 partition@100000 {
160 label = "crash";
161 reg = <0x100000 0x40000>;
162 };
163
164 partition@140000 {
165 label = "crash_syslog";
166 reg = <0x140000 0x80000>;
167 };
168
169 partition@1c0000 {
170 label = "reserved0";
171 reg = <0x1c0000 0x40000>;
172 read-only;
173 };
174
175 /* We keep stock xiaomi firmware (kernel0) here */
176 partition@200000 {
177 label = "kernel_stock";
178 reg = <0x200000 0x400000>;
179 };
180
181 partition@600000 {
182 label = "kernel";
183 reg = <0x600000 0x400000>;
184 };
185
186 partition@a00000 {
187 label = "ubi";
188 reg = <0xa00000 0xf580000>;
189 };
190 };
191 };
192
193 &pcie {
194 status = "okay";
195 };
196
197 &pcie0 {
198 wifi@0,0 {
199 compatible = "mediatek,mt76";
200 reg = <0x0000 0 0 0 0>;
201 nvmem-cells = <&eeprom_factory_0>;
202 nvmem-cell-names = "eeprom";
203 ieee80211-freq-limit = <2400000 2500000>;
204 };
205 };
206
207 &pcie1 {
208 wifi@0,0 {
209 compatible = "mediatek,mt76";
210 reg = <0x0000 0 0 0 0>;
211 nvmem-cells = <&eeprom_factory_8000>;
212 nvmem-cell-names = "eeprom";
213 ieee80211-freq-limit = <5000000 6000000>;
214 };
215 };
216
217 &gmac0 {
218 nvmem-cells = <&macaddr_factory_e006>;
219 nvmem-cell-names = "mac-address";
220 };
221
222 &gmac1 {
223 status = "okay";
224 label = "wan";
225 phy-handle = <&ethphy4>;
226
227 nvmem-cells = <&macaddr_factory_e000>;
228 nvmem-cell-names = "mac-address";
229 };
230
231 &mdio {
232 ethphy4: ethernet-phy@4 {
233 reg = <4>;
234 };
235 };
236
237 &switch0 {
238 ports {
239 port@1 {
240 status = "okay";
241 label = "lan3";
242 };
243
244 port@2 {
245 status = "okay";
246 label = "lan2";
247 };
248
249 port@3 {
250 status = "okay";
251 label = "lan1";
252 };
253 };
254 };
255
256 &state_default {
257 gpio {
258 groups = "jtag", "uart2", "uart3", "wdt";
259 function = "gpio";
260 };
261 };