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