ramips: fix MAC address setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_zyxel_keenetic-viva.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 = "zyxel,keenetic-viva", "ralink,mt7620a-soc";
10         model = "ZyXEL Keenetic Viva";
11
12         aliases {
13                 led-boot = &led_power_green;
14                 led-failsafe = &led_power_green;
15                 led-running = &led_power_green;
16                 led-upgrade = &led_power_green;
17         };
18
19         leds {
20                 compatible = "gpio-leds";
21
22                 wan {
23                         label = "keenetic-viva:green:wan";
24                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
25                 };
26
27                 usb {
28                         label = "keenetic-viva:green:usb";
29                         gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
30                         trigger-sources = <&ohci_port1>, <&ehci_port1>;
31                         linux,default-trigger = "usbport";
32                 };
33
34                 power_alert {
35                         label = "keenetic-viva:red:power";
36                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
37                 };
38
39                 wifi {
40                         label = "keenetic-viva:green:wifi";
41                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
42                 };
43
44                 led_power_green: power {
45                         label = "keenetic-viva:green:power";
46                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
47                 };
48         };
49
50         keys {
51                 compatible = "gpio-keys";
52
53                 reset {
54                         label = "reset";
55                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
56                         linux,code = <KEY_RESTART>;
57                 };
58
59                 wps {
60                         label = "wps";
61                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
62                         linux,code = <KEY_WPS_BUTTON>;
63                 };
64
65                 fn {
66                         label = "fn";
67                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
68                         linux,code = <BTN_0>;
69                 };
70         };
71
72         gpio_export {
73                 compatible = "gpio-export";
74                 #size-cells = <0>;
75
76                 usb_power {
77                         gpio-export,name = "usb";
78                         gpio-export,output = <1>;
79                         gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
80                 };
81         };
82
83         rtl8367rb {
84                 compatible = "realtek,rtl8367b";
85                 cpu_port = <7>;
86                 realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
87                 mii-bus = <&mdio0>;
88         };
89 };
90
91 &spi0 {
92         status = "okay";
93
94         m25p80@0 {
95                 compatible = "jedec,spi-nor";
96                 reg = <0>;
97                 spi-max-frequency = <10000000>;
98
99                 partitions {
100                         compatible = "fixed-partitions";
101                         #address-cells = <1>;
102                         #size-cells = <1>;
103
104                         partition@0 {
105                                 label = "u-boot";
106                                 reg = <0x0 0x30000>;
107                                 read-only;
108                         };
109
110                         partition@30000 {
111                                 label = "u-boot-env";
112                                 reg = <0x30000 0x10000>;
113                                 read-only;
114                         };
115
116                         factory: partition@40000 {
117                                 label = "factory";
118                                 reg = <0x40000 0x10000>;
119                                 read-only;
120                         };
121
122                         partition@50000 {
123                                 compatible = "denx,uimage";
124                                 label = "firmware";
125                                 reg = <0x50000 0xfb0000>;
126                         };
127                 };
128         };
129 };
130
131 &pinctrl {
132         state_default: pinctrl0 {
133                 gpio {
134                         ralink,group = "i2c", "uartf";
135                         ralink,function = "gpio";
136                 };
137         };
138 };
139
140 &ethernet {
141         status = "okay";
142         pinctrl-names = "default";
143         pinctrl-0 = <&rgmii2_pins &mdio_pins>;
144         mtd-mac-address = <&factory 0x00004>;
145
146         port@4 {
147                 status = "okay";
148                 mediatek,fixed-link = <1000 1 1 1>;
149                 phy-mode = "rgmii";
150                 phy-handle = <&phy4>;
151         };
152
153         mdio0: mdio-bus {
154                 status = "okay";
155
156                 phy4: ethernet-phy@4 {
157                         reg = <4>;
158                         phy-mode = "rgmii";
159                 };
160         };
161 };
162
163 &gsw {
164         mediatek,port4 = "gmac";
165 };
166
167 &wmac {
168         ralink,mtd-eeprom = <&factory 0>;
169 };
170
171 &ehci {
172         status = "okay";
173 };
174
175 &ohci {
176         status = "okay";
177 };