ramips: fix switch setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_buffalo_wsr-600dhp.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 = "buffalo,wsr-600dhp", "mediatek,mt7621-soc";
10         model = "Buffalo WSR-600DHP";
11
12         aliases {
13                 led-boot = &led_power;
14                 led-failsafe = &led_power;
15                 led-running = &led_power;
16                 led-upgrade = &led_power;
17         };
18
19         chosen {
20                 bootargs = "console=ttyS0,57600";
21         };
22
23         leds {
24                 compatible = "gpio-leds";
25
26                 led_power: power {
27                         label = "wsr-600:green:power";
28                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
29                 };
30
31                 wifi_o {
32                         label = "wsr-600:orange:wifi";
33                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
34                 };
35
36                 diag {
37                         label = "wsr-600:orange:diag";
38                         gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
39                 };
40
41                 wifi_g {
42                         label = "wsr-600:green:wifi";
43                         gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
44                 };
45
46                 router_o {
47                         label = "wsr-600:orange:router";
48                         gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
49                 };
50
51                 router_g {
52                         label = "wsr-600:green:router";
53                         gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
54                 };
55
56                 internet_o {
57                         label = "wsr-600:orange:internet";
58                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
59                 };
60
61                 internet_g {
62                         label = "wsr-600:green:internet";
63                         gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
64                 };
65         };
66
67         keys {
68                 compatible = "gpio-keys";
69
70                 power {
71                         label = "power";
72                         gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
73                         linux,code = <KEY_POWER>;
74                 };
75
76                 reset {
77                         label = "reset";
78                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
79                         linux,code = <KEY_RESTART>;
80                 };
81
82                 aoss {
83                         label = "aoss";
84                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
85                         linux,code = <KEY_WPS_BUTTON>;
86                 };
87
88                 auto {
89                         label = "mode";
90                         gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
91                         linux,code = <BTN_0>;
92                         linux,input-type = <EV_SW>;
93                 };
94
95                 ap {
96                         label = "ap";
97                         gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
98                         linux,code = <BTN_0>;
99                         linux,input-type = <EV_SW>;
100                 };
101
102                 router {
103                         label = "router";
104                         gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
105                         linux,code = <BTN_0>;
106                         linux,input-type = <EV_SW>;
107                 };
108         };
109
110         gpio_poweroff {
111                 compatible = "gpio-poweroff";
112                 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
113         };
114 };
115
116 &spi0 {
117         status = "okay";
118
119         m25p80@0 {
120                 compatible = "jedec,spi-nor";
121                 reg = <0>;
122                 spi-max-frequency = <10000000>;
123
124                 partitions {
125                         compatible = "fixed-partitions";
126                         #address-cells = <1>;
127                         #size-cells = <1>;
128
129                         partition@0 {
130                                 label = "u-boot";
131                                 reg = <0x0 0x30000>;
132                                 read-only;
133                         };
134
135                         partition@30000 {
136                                 label = "u-boot-env";
137                                 reg = <0x30000 0x10000>;
138                                 read-only;
139                         };
140
141                         factory: partition@40000 {
142                                 label = "factory";
143                                 reg = <0x40000 0x10000>;
144                                 read-only;
145                         };
146
147                         partition@50000 {
148                                 compatible = "denx,uimage";
149                                 label = "firmware";
150                                 reg = <0x50000 0xfb0000>;
151                         };
152                 };
153         };
154 };
155
156 &state_default {
157         gpio {
158                 ralink,group = "i2c", "uart2", "uart3", "rgmii2", "sdhci";
159                 ralink,function = "gpio";
160         };
161 };
162
163 &pcie {
164         status = "okay";
165 };
166
167 &pcie0 {
168         rt5592@0,0 {
169                 reg = <0x0000 0 0 0 0>;
170                 ralink,mtd-eeprom = <&factory 0x8000>;
171         };
172 };
173
174 &pcie1 {
175         mt76@0,0 {
176                 reg = <0x0000 0 0 0 0>;
177                 mediatek,mtd-eeprom = <&factory 0x0000>;
178         };
179 };
180
181 &ethernet {
182         mtd-mac-address = <&factory 0x4>;
183 };
184
185 &xhci {
186         status = "disabled";
187 };