faba70f181594408ceb30e49523857b80d6cf8bb
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / MIR3G.dts
1 /dts-v1/;
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,mir3g", "mediatek,mt7621-soc";
10 model = "Xiaomi Mi Router 3G";
11
12 aliases {
13 led-status = &led_status_blue;
14 };
15
16 memory@0 {
17 device_type = "memory";
18 reg = <0x0 0x10000000>;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200n8";
23 };
24
25 gpio-leds {
26 compatible = "gpio-leds";
27
28 status_red {
29 label = "mir3g:red:status";
30 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
31 };
32
33 led_status_blue: status_blue {
34 label = "mir3g:blue:status";
35 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
36 };
37
38 status_yellow {
39 label = "mir3g:yellow:status";
40 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
41 };
42
43 wan_amber {
44 label = "mir3g:amber:wan";
45 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
46 };
47
48 lan1_amber {
49 label = "mir3g:amber:lan1";
50 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
51 };
52
53 lan2_amber {
54 label = "mir3g:amber:lan2";
55 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
56 };
57
58 };
59
60 gpio-keys-polled {
61 compatible = "gpio-keys-polled";
62 #address-cells = <1>;
63 #size-cells = <0>;
64 poll-interval = <20>;
65
66 reset {
67 label = "reset";
68 gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
69 linux,code = <KEY_RESTART>;
70 };
71 };
72
73 reg_usb_vbus: reg_usb_vbus {
74 compatible = "regulator-fixed";
75 regulator-name = "usb_vbus";
76 regulator-min-microvolt = <5000000>;
77 regulator-max-microvolt = <5000000>;
78 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
79 enable-active-high;
80 };
81
82 };
83
84 &xhci {
85 vbus-supply = <&reg_usb_vbus>;
86 };
87
88 &nand {
89 status = "okay";
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 &pcie {
169 status = "okay";
170
171 pcie0 {
172 wifi@14c3,7603 {
173 compatible = "pci14c3,7603";
174 reg = <0x0000 0 0 0 0>;
175 mediatek,mtd-eeprom = <&factory 0x0000>;
176 ieee80211-freq-limit = <2400000 2500000>;
177 };
178 };
179
180 pcie1 {
181 wifi@14c3,7662 {
182 compatible = "pci14c3,7662";
183 reg = <0x0000 0 0 0 0>;
184 mediatek,mtd-eeprom = <&factory 0x8000>;
185 ieee80211-freq-limit = <5000000 6000000>;
186 };
187 };
188 };
189
190 &ethernet {
191 mtd-mac-address = <&factory 0xe000>;
192 mediatek,portmap = "lwlll";
193 };
194
195 &pinctrl {
196 state_default: pinctrl0 {
197 gpio {
198 ralink,group = "jtag", "uart2", "uart3", "wdt";
199 ralink,function = "gpio";
200 };
201 };
202 };