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