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