ramips: improve Xiaomi Mi Router 3G support
[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 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 gpio_export {
70 compatible = "gpio-export";
71 #size-cells = <0>;
72
73 usbpower {
74 gpio-export,name = "usbpower";
75 gpio-export,output = <1>;
76 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
77 };
78 };
79 };
80
81 &nand {
82 status = "okay";
83
84 partition@0 {
85 label = "Bootloader";
86 reg = <0x0 0x80000>;
87 read-only;
88 };
89
90 partition@80000 {
91 label = "Config";
92 reg = <0x80000 0x40000>;
93 };
94
95 partition@c0000 {
96 label = "Bdata";
97 reg = <0xc0000 0x40000>;
98 read-only;
99 };
100
101 factory: partition@100000 {
102 label = "Factory";
103 reg = <0x100000 0x40000>;
104 read-only;
105 };
106
107 partition@140000 {
108 label = "crash";
109 reg = <0x140000 0x40000>;
110 };
111
112 partition@180000 {
113 label = "crash_syslog";
114 reg = <0x180000 0x40000>;
115 };
116
117 partition@1c0000 {
118 label = "reserved0";
119 reg = <0x1c0000 0x40000>;
120 read-only;
121 };
122
123 /* uboot expects to find kernels at 0x200000 & 0x600000
124 * referred to as system 1 & system 2 respectively.
125 * a kernel is considered suitable for handing control over
126 * if its linux magic number exists & uImage CRC are correct.
127 * If either of those conditions fail, a matching sys'n'_fail flag
128 * is set in uboot env & a restart performed in the hope that the
129 * alternate kernel is okay.
130 * if neither kernel checksums ok and both are marked failed, system 2
131 * is booted anyway.
132 *
133 * Note uboot's tftp flash install writes the transferred
134 * image to both kernel partitions.
135 */
136
137 partition@200000 {
138 label = "kernel_stock";
139 reg = <0x200000 0x400000>;
140 };
141
142 partition@600000 {
143 label = "kernel";
144 reg = <0x600000 0x400000>;
145 };
146
147 /* ubi partition is the result of squashing
148 * next consecutive stock partitions:
149 * - rootfs0 (rootfs partition for stock kernel0),
150 * - rootfs1 (rootfs partition for stock failsafe kernel1),
151 * - overlay (used as ubi overlay in stock fw)
152 * resulting 117,5MiB space for packages.
153 */
154
155 partition@a00000 {
156 label = "ubi";
157 reg = <0xa00000 0x7580000>;
158 };
159 };
160
161 &pcie {
162 status = "okay";
163
164 pcie0 {
165 wifi@14c3,7603 {
166 compatible = "pci14c3,7603";
167 reg = <0x0000 0 0 0 0>;
168 mediatek,mtd-eeprom = <&factory 0x0000>;
169 ieee80211-freq-limit = <2400000 2500000>;
170 };
171 };
172
173 pcie1 {
174 wifi@14c3,7662 {
175 compatible = "pci14c3,7662";
176 reg = <0x0000 0 0 0 0>;
177 mediatek,mtd-eeprom = <&factory 0x8000>;
178 ieee80211-freq-limit = <5000000 6000000>;
179 };
180 };
181 };
182
183 &ethernet {
184 mtd-mac-address = <&factory 0xe000>;
185 mediatek,portmap = "lwlll";
186 };
187
188 &pinctrl {
189 state_default: pinctrl0 {
190 gpio {
191 ralink,group = "jtag", "uart2", "uart3", "wdt";
192 ralink,function = "gpio";
193 };
194 };
195 };