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