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