51f4842255a88ac31ca885889d7361cf9b466c7f
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mir3g.dts
1 #include "mt7621.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "xiaomi,mir3g", "mediatek,mt7621-soc";
8 model = "Xiaomi Mi Router 3G";
9
10 aliases {
11 led-boot = &led_status_yellow;
12 led-failsafe = &led_status_red;
13 led-running = &led_status_blue;
14 led-upgrade = &led_status_yellow;
15 label-mac-device = &gmac0;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200n8";
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_status_red: status_red {
26 label = "red:status";
27 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
28 };
29
30 led_status_blue: status_blue {
31 label = "blue:status";
32 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
33 };
34
35 led_status_yellow: status_yellow {
36 label = "yellow:status";
37 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
38 };
39
40 wan_amber {
41 label = "amber:wan";
42 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
43 linux,default-trigger = "dsa-0.0:01:1Gbps";
44 };
45
46 lan1_amber {
47 label = "amber:lan1";
48 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
49 linux,default-trigger = "dsa-0.0:03:1Gbps";
50 };
51
52 lan2_amber {
53 label = "amber:lan2";
54 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
55 linux,default-trigger = "dsa-0.0:02:1Gbps";
56 };
57 };
58
59 keys {
60 compatible = "gpio-keys";
61
62 reset {
63 label = "reset";
64 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
65 linux,code = <KEY_RESTART>;
66 };
67 };
68
69 reg_usb_vbus: regulator {
70 compatible = "regulator-fixed";
71 regulator-name = "usb_vbus";
72 regulator-min-microvolt = <5000000>;
73 regulator-max-microvolt = <5000000>;
74 gpio = <&gpio 12 GPIO_ACTIVE_HIGH>;
75 enable-active-high;
76 };
77 };
78
79 &xhci {
80 vbus-supply = <&reg_usb_vbus>;
81 };
82
83 &nand {
84 status = "okay";
85
86 partitions {
87 compatible = "fixed-partitions";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 partition@0 {
92 label = "Bootloader";
93 reg = <0x0 0x80000>;
94 read-only;
95 };
96
97 partition@80000 {
98 label = "Config";
99 reg = <0x80000 0x40000>;
100 };
101
102 partition@c0000 {
103 label = "Bdata";
104 reg = <0xc0000 0x40000>;
105 read-only;
106 };
107
108 factory: partition@100000 {
109 label = "factory";
110 reg = <0x100000 0x40000>;
111 read-only;
112 };
113
114 partition@140000 {
115 label = "crash";
116 reg = <0x140000 0x40000>;
117 };
118
119 partition@180000 {
120 label = "crash_syslog";
121 reg = <0x180000 0x40000>;
122 };
123
124 partition@1c0000 {
125 label = "reserved0";
126 reg = <0x1c0000 0x40000>;
127 read-only;
128 };
129
130 /* uboot expects to find kernels at 0x200000 & 0x600000
131 * referred to as system 1 & system 2 respectively.
132 * a kernel is considered suitable for handing control over
133 * if its linux magic number exists & uImage CRC are correct.
134 * If either of those conditions fail, a matching sys'n'_fail flag
135 * is set in uboot env & a restart performed in the hope that the
136 * alternate kernel is okay.
137 * if neither kernel checksums ok and both are marked failed, system 2
138 * is booted anyway.
139 *
140 * Note uboot's tftp flash install writes the transferred
141 * image to both kernel partitions.
142 */
143
144 partition@200000 {
145 label = "kernel_stock";
146 reg = <0x200000 0x400000>;
147 };
148
149 partition@600000 {
150 label = "kernel";
151 reg = <0x600000 0x400000>;
152 };
153
154 /* ubi partition is the result of squashing
155 * next consecutive stock partitions:
156 * - rootfs0 (rootfs partition for stock kernel0),
157 * - rootfs1 (rootfs partition for stock failsafe kernel1),
158 * - overlay (used as ubi overlay in stock fw)
159 * resulting 117,5MiB space for packages.
160 */
161
162 partition@a00000 {
163 label = "ubi";
164 reg = <0xa00000 0x7580000>;
165 };
166 };
167 };
168
169 &pcie {
170 status = "okay";
171 };
172
173 &pcie0 {
174 wifi@0,0 {
175 compatible = "pci14c3,7603";
176 reg = <0x0000 0 0 0 0>;
177 mediatek,mtd-eeprom = <&factory 0x0000>;
178 ieee80211-freq-limit = <2400000 2500000>;
179 };
180 };
181
182 &pcie1 {
183 wifi@0,0 {
184 compatible = "pci14c3,7662";
185 reg = <0x0000 0 0 0 0>;
186 mediatek,mtd-eeprom = <&factory 0x8000>;
187 ieee80211-freq-limit = <5000000 6000000>;
188 };
189 };
190
191 &gmac0 {
192 mtd-mac-address = <&factory 0xe006>;
193 };
194
195 &switch0 {
196 ports {
197 port@1 {
198 status = "okay";
199 label = "wan";
200 mtd-mac-address = <&factory 0xe000>;
201 };
202
203 port@2 {
204 status = "okay";
205 label = "lan2";
206 };
207
208 port@3 {
209 status = "okay";
210 label = "lan1";
211 };
212 };
213 };
214
215 &state_default {
216 gpio {
217 groups = "jtag", "uart2", "uart3", "wdt";
218 function = "gpio";
219 };
220 };