ramips: add Xiaomi Mi Router 3G support
[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 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 wan {
25 label = "mir3g:red:wan";
26 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
27 };
28
29 usb {
30 label = "mir3g:blue:usb";
31 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
32 };
33
34 status {
35 label = "mir3g:yellow:status";
36 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
37 };
38 };
39
40 gpio-keys-polled {
41 compatible = "gpio-keys-polled";
42 #address-cells = <1>;
43 #size-cells = <0>;
44 poll-interval = <20>;
45
46 reset {
47 label = "reset";
48 gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
49 linux,code = <KEY_RESTART>;
50 };
51 };
52 };
53
54 &nand {
55 status = "okay";
56
57 partition@0 {
58 label = "Bootloader";
59 reg = <0x0 0x80000>;
60 read-only;
61 };
62
63 partition@80000 {
64 label = "Config";
65 reg = <0x80000 0x40000>;
66 read-only;
67 };
68
69 partition@c0000 {
70 label = "Bdata";
71 reg = <0xc0000 0x40000>;
72 read-only;
73 };
74
75 factory: partition@100000 {
76 label = "Factory";
77 reg = <0x100000 0x40000>;
78 read-only;
79 };
80
81 partition@140000 {
82 label = "crash";
83 reg = <0x140000 0x40000>;
84 read-only;
85 };
86
87 partition@180000 {
88 label = "crash_syslog";
89 reg = <0x180000 0x40000>;
90 read-only;
91 };
92
93 partition@1c0000 {
94 label = "reserved0";
95 reg = <0x1c0000 0x40000>;
96 read-only;
97 };
98
99 /*
100 * kernel0 partition should be erased, so
101 * u-boot in failsafe routine switches
102 * to next one looking for kernel image.
103 * To remind about this fact rename kernel0
104 * into kernel_erase.
105 */
106 partition@200000 {
107 label = "kernel_erase";
108 reg = <0x200000 0x400000>;
109 };
110
111 partition@600000 {
112 label = "kernel";
113 reg = <0x600000 0x400000>;
114 };
115
116 /* ubi partition is the result of squashing
117 * next consequent stock partitions:
118 * - rootfs0 (rootfs partition for stock kernel0),
119 * - rootfs1 (rootfs partition for stock failsafe kernel1),
120 * - overlay (used as ubi overlay in stock fw)
121 * resulting 117,5MiB space for packages.
122 */
123 partition@a00000 {
124 label = "ubi";
125 reg = <0xa00000 0x7580000>;
126 };
127 };
128
129 &pcie {
130 status = "okay";
131
132 pcie0 {
133 wifi@14c3,7603 {
134 compatible = "pci14c3,7603";
135 reg = <0x0000 0 0 0 0>;
136 mediatek,mtd-eeprom = <&factory 0x0000>;
137 ieee80211-freq-limit = <2400000 2500000>;
138 };
139 };
140
141 pcie1 {
142 wifi@14c3,7662 {
143 compatible = "pci14c3,7662";
144 reg = <0x0000 0 0 0 0>;
145 mediatek,mtd-eeprom = <&factory 0x8000>;
146 ieee80211-freq-limit = <5000000 6000000>;
147 };
148 };
149 };
150
151 &ethernet {
152 mtd-mac-address = <&factory 0xe000>;
153 mediatek,portmap = "lwlll";
154 };
155
156 &pinctrl {
157 state_default: pinctrl0 {
158 gpio {
159 ralink,group = "jtag", "uart3", "wdt";
160 ralink,function = "gpio";
161 };
162 };
163 };