ramips: fix MAC address setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / rt3052_buffalo_whr-g300n.dts
1 /dts-v1/;
2
3 #include "rt3050.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "buffalo,whr-g300n", "ralink,rt3052-soc";
10         model = "Buffalo WHR-G300N";
11
12         aliases {
13                 led-boot = &led_diag;
14                 led-failsafe = &led_diag;
15                 led-upgrade = &led_diag;
16         };
17
18         cfi@1f000000 {
19                 compatible = "cfi-flash";
20                 reg = <0x1f000000 0x800000>;
21                 bank-width = <2>;
22                 device-width = <2>;
23
24                 partitions {
25                         compatible = "fixed-partitions";
26                         #address-cells = <1>;
27                         #size-cells = <1>;
28
29                         partition@0 {
30                                 label = "u-boot";
31                                 reg = <0x0 0x30000>;
32                                 read-only;
33                         };
34
35                         partition@30000 {
36                                 label = "u-boot-env";
37                                 reg = <0x30000 0x10000>;
38                                 read-only;
39                         };
40
41                         factory: partition@40000 {
42                                 label = "factory";
43                                 reg = <0x40000 0x10000>;
44                                 read-only;
45                         };
46
47                         partition@50000 {
48                                 compatible = "denx,uimage";
49                                 label = "firmware";
50                                 reg = <0x50000 0x3a0000>;
51                         };
52
53                         partition@3f0000 {
54                                 label = "user";
55                                 reg = <0x3f0000 0x10000>;
56                                 read-only;
57                         };
58                 };
59         };
60
61         leds {
62                 compatible = "gpio-leds";
63
64                 led_diag: diag {
65                         label = "whr-g300n:red:diag";
66                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
67                 };
68
69                 router {
70                         label = "whr-g300n:green:router";
71                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
72                 };
73
74                 security {
75                         label = "whr-g300n:amber:security";
76                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
77                 };
78         };
79
80         keys {
81                 compatible = "gpio-keys-polled";
82                 poll-interval = <20>;
83
84                 reset {
85                         label = "reset";
86                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
87                         linux,code = <KEY_RESTART>;
88                 };
89
90                 aoss {
91                         label = "aoss";
92                         gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
93                         linux,code = <KEY_WPS_BUTTON>;
94                 };
95
96                 router-off {
97                         label = "router-off";
98                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
99                         linux,code = <BTN_2>;
100                 };
101
102                 router-on {
103                         label = "router-on";
104                         gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
105                         linux,code = <BTN_3>;
106                 };
107         };
108 };
109
110 &pinctrl {
111         state_default: pinctrl0 {
112                 gpio {
113                         ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
114                         ralink,function = "gpio";
115                 };
116         };
117 };
118
119 &ethernet {
120         mtd-mac-address = <&factory 0x4>;
121 };
122
123 &esw {
124         mediatek,portmap = <0x2f>;
125 };
126
127 &wmac {
128         ralink,mtd-eeprom = <&factory 0>;
129 };