ramips: fix MAC address setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_xiaomi_miwifi-mini.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "xiaomi,miwifi-mini", "ralink,mt7620a-soc";
10         model = "Xiaomi MiWiFi Mini";
11
12         aliases {
13                 led-boot = &led_blue;
14                 led-failsafe = &led_blue;
15                 led-running = &led_blue;
16                 led-upgrade = &led_blue;
17                 label-mac-device = &ethernet;
18         };
19
20         chosen {
21                 bootargs = "console=ttyS0,115200";
22         };
23
24         leds {
25                 compatible = "gpio-leds";
26
27                 led_blue: blue {
28                         label = "miwifi-mini:blue:status";
29                         gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
30                         default-state = "on";
31                 };
32
33                 yellow {
34                         label = "miwifi-mini:yellow:status";
35                         gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
36                 };
37
38                 red {
39                         label = "miwifi-mini:red:status";
40                         gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
41                 };
42         };
43
44         keys {
45                 compatible = "gpio-keys";
46
47                 reset {
48                         label = "reset";
49                         gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
50                         linux,code = <KEY_RESTART>;
51                 };
52         };
53 };
54
55 &gpio0 {
56         status = "okay";
57 };
58
59 &gpio1 {
60         status = "okay";
61 };
62
63 &gpio2 {
64         status = "okay";
65 };
66
67 &spi0 {
68         status = "okay";
69
70         m25p80@0 {
71                 compatible = "jedec,spi-nor";
72                 reg = <0>;
73                 spi-max-frequency = <10000000>;
74
75                 partitions {
76                         compatible = "fixed-partitions";
77                         #address-cells = <1>;
78                         #size-cells = <1>;
79
80                         partition@0 {
81                                 label = "u-boot";
82                                 reg = <0x0 0x30000>;
83                         };
84
85                         partition@30000 {
86                                 label = "u-boot-env";
87                                 reg = <0x30000 0x10000>;
88                                 read-only;
89                         };
90
91                         factory: partition@40000 {
92                                 label = "factory";
93                                 reg = <0x40000 0x10000>;
94                                 read-only;
95                         };
96
97                         partition@50000 {
98                                 compatible = "denx,uimage";
99                                 label = "firmware";
100                                 reg = <0x50000 0xf80000>;
101                         };
102
103                         partition@fd0000 {
104                                 label = "crash";
105                                 reg = <0xfd0000 0x10000>;
106                         };
107
108                         partition@fe0000 {
109                                 label = "reserved";
110                                 reg = <0xfe0000 0x10000>;
111                                 read-only;
112                         };
113
114                         partition@ff0000 {
115                                 label = "Bdata";
116                                 reg = <0xff0000 0x10000>;
117                         };
118                 };
119         };
120 };
121
122 &ehci {
123         status = "okay";
124 };
125
126 &ohci {
127         status = "okay";
128 };
129
130 &ethernet {
131         pinctrl-names = "default";
132         pinctrl-0 = <&ephy_pins>;
133         mtd-mac-address = <&factory 0x28>;
134         mediatek,portmap = "llllw";
135 };
136
137 &wmac {
138         ralink,mtd-eeprom = <&factory 0>;
139         pinctrl-names = "default";
140         pinctrl-0 = <&pa_pins>;
141 };
142
143 &pcie {
144         status = "okay";
145 };
146
147 &pcie0 {
148         mt76@0,0 {
149                 reg = <0x0000 0 0 0 0>;
150                 mediatek,mtd-eeprom = <&factory 0x8000>;
151                 ieee80211-freq-limit = <5000000 6000000>;
152         };
153 };
154
155 &pinctrl {
156         state_default: pinctrl0 {
157                 gpio {
158                         ralink,group = "i2c", "rgmii1";
159                         ralink,function = "gpio";
160                 };
161         };
162 };