ramips: add support for Xiaomi Mi Router 3 Pro
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / MIR3P.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10 compatible = "xiaomi,mir3p", "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 };
19
20 memory@0 {
21 device_type = "memory";
22 reg = <0x0 0x1c000000>, <0x20000000 0x04000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 leds {
30 compatible = "gpio-leds";
31
32 led_status_red: status_red {
33 label = "mir3p:red:status";
34 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
35 };
36
37 led_status_blue: status_blue {
38 label = "mir3p:blue:status";
39 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
40 };
41
42 led_status_yellow: status_yellow {
43 label = "mir3p:yellow:status";
44 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
45 };
46
47 wan_amber {
48 label = "mir3p:amber:wan";
49 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
50 };
51
52 lan3_amber {
53 label = "mir3p:amber:lan3";
54 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
55 };
56
57 lan2_amber {
58 label = "mir3p:amber:lan2";
59 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
60 };
61
62 lan1_amber {
63 label = "mir3p:amber:lan1";
64 gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
65 };
66 };
67
68 button {
69 compatible = "gpio-keys-polled";
70 poll-interval = <20>;
71
72 reset {
73 label = "reset";
74 gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
75 linux,code = <KEY_RESTART>;
76 };
77 };
78
79 reg_usb_vbus: regulator {
80 compatible = "regulator-fixed";
81 regulator-name = "usb_vbus";
82 regulator-min-microvolt = <5000000>;
83 regulator-max-microvolt = <5000000>;
84 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
85 enable-active-high;
86 };
87 };
88
89 &xhci {
90 vbus-supply = <&reg_usb_vbus>;
91 };
92
93 &nand {
94 status = "okay";
95
96 partitions {
97 compatible = "fixed-partitions";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 partition@0 {
102 label = "Bootloader";
103 reg = <0x0 0x40000>;
104 read-only;
105 };
106
107 partition@40000 {
108 label = "Config";
109 reg = <0x40000 0x40000>;
110 };
111
112 partition@80000 {
113 label = "Bdata";
114 reg = <0x80000 0x40000>;
115 read-only;
116 };
117
118 factory: partition@c0000 {
119 label = "Factory";
120 reg = <0x0c0000 0x40000>;
121 read-only;
122 };
123
124 partition@100000 {
125 label = "crash";
126 reg = <0x100000 0x40000>;
127 };
128
129 partition@140000 {
130 label = "crash_syslog";
131 reg = <0x140000 0x80000>;
132 };
133
134 partition@1c0000 {
135 label = "reserved0";
136 reg = <0x1c0000 0x40000>;
137 read-only;
138 };
139
140 /* We keep stock xiaomi firmware (kernel0) here */
141 partition@200000 {
142 label = "kernel_stock";
143 reg = <0x200000 0x400000>;
144 };
145
146 partition@600000 {
147 label = "kernel";
148 reg = <0x600000 0x400000>;
149 };
150
151 partition@a00000 {
152 label = "ubi";
153 reg = <0xa00000 0xf580000>;
154 };
155 };
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162 &pcie0 {
163 wifi@0,0 {
164 compatible = "pci14c3,7615";
165 reg = <0x0000 0 0 0 0>;
166 mediatek,mtd-eeprom = <&factory 0x0000>;
167 };
168 };
169
170 &pcie1 {
171 wifi@0,0 {
172 compatible = "pci14c3,7615";
173 reg = <0x0000 0 0 0 0>;
174 mediatek,mtd-eeprom = <&factory 0x8000>;
175 ieee80211-freq-limit = <5000000 6000000>;
176 };
177 };
178
179 &ethernet {
180 mtd-mac-address = <&factory 0xe000>;
181 mediatek,portmap = "llllw";
182 };
183
184 &pinctrl {
185 state_default: pinctrl0 {
186 gpio {
187 ralink,group = "jtag", "uart2", "uart3", "wdt";
188 ralink,function = "gpio";
189 };
190 };
191 };