ramips: fix MAC address setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_lenovo_newifi-d1.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 = "lenovo,newifi-d1", "mediatek,mt7621-soc";
10         model = "Newifi-D1";
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                 status-red {
28                         label = "newifi-d1:red:status";
29                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
30                 };
31
32                 status-green {
33                         label = "newifi-d1:green:status";
34                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
35                 };
36
37                 led_blue: status-blue {
38                         label = "newifi-d1:blue:status";
39                         gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
40                         default-state = "on";
41                 };
42         };
43
44         keys {
45                 compatible = "gpio-keys";
46
47                 reset {
48                         label = "reset";
49                         gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
50                         linux,code = <KEY_RESTART>;
51                 };
52         };
53
54         gpio_export {
55                 compatible = "gpio-export";
56                 #size-cells = <0>;
57
58                 usb2power {
59                         gpio-export,name = "usb2power";
60                         gpio-export,output = <1>;
61                         gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
62                 };
63
64                 usb3power {
65                         gpio-export,name = "usb3power";
66                         gpio-export,output = <1>;
67                         gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
68                 };
69         };
70 };
71
72 &sdhci {
73         status = "okay";
74 };
75
76 &spi0 {
77         status = "okay";
78
79         m25p80@0 {
80                 compatible = "mx25l25635f", "jedec,spi-nor";
81                 reg = <0>;
82                 spi-max-frequency = <25000000>;
83                 m25p,fast-read;
84
85                 partitions {
86                         compatible = "fixed-partitions";
87                         #address-cells = <1>;
88                         #size-cells = <1>;
89
90                         partition@0 {
91                                 label = "u-boot";
92                                 reg = <0x0 0x30000>;
93                                 read-only;
94                         };
95
96                         partition@30000 {
97                                 label = "u-boot-env";
98                                 reg = <0x30000 0x10000>;
99                                 read-only;
100                         };
101
102                         factory: partition@40000 {
103                                 label = "factory";
104                                 reg = <0x40000 0x10000>;
105                                 read-only;
106                         };
107
108                         partition@50000 {
109                                 compatible = "denx,uimage";
110                                 label = "firmware";
111                                 reg = <0x50000 0x1fb0000>;
112                         };
113                 };
114         };
115 };
116
117 &pcie {
118         status = "okay";
119 };
120
121 &pcie0 {
122         mt76@0,0 {
123                 reg = <0x0000 0 0 0 0>;
124                 mediatek,mtd-eeprom = <&factory 0x8000>;
125                 ieee80211-freq-limit = <5000000 6000000>;
126         };
127 };
128
129 &pcie1 {
130         mt76@0,0 {
131                 reg = <0x0000 0 0 0 0>;
132                 mediatek,mtd-eeprom = <&factory 0x0000>;
133         };
134 };
135
136 &ethernet {
137         mtd-mac-address = <&factory 0xe000>;
138 };
139
140 &pinctrl {
141         state_default: pinctrl0 {
142                 gpio {
143                         ralink,group = "wdt", "rgmii2", "jtag", "uart2", "uart3", "i2c";
144                         ralink,function = "gpio";
145                 };
146         };
147 };