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