lantiq: dts: assign the MDIO pins to the gsw node
[oweals/openwrt.git] / target / linux / lantiq / files / arch / mips / boot / dts / WBMR300.dts
1 /dts-v1/;
2
3 #include "vr9.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/mips/lantiq_rcu_gphy.h>
7
8 / {
9         compatible = "buffalo,wbmr-300hpd", "lantiq,xway", "lantiq,vr9";
10         model = "Buffalo WBMR-300HPD";
11
12         chosen {
13                 bootargs = "console=ttyLTQ0,115200";
14         };
15
16         aliases {
17                 led-boot = &power_g;
18                 led-failsafe = &diag_r;
19                 led-running = &power_g;
20                 led-upgrade = &power_g;
21
22                 led-dsl = &dsl;
23                 led-internet = &router_g;
24                 led-wifi = &wifi_g;
25         };
26
27         memory@0 {
28                 device_type = "memory";
29                 reg = <0x0 0x4000000>;
30         };
31
32         gpio_poweroff {
33                 compatible = "gpio-poweroff";
34                 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
35         };
36
37         keys {
38                 compatible = "gpio-keys-polled";
39                 poll-interval = <100>;
40
41                 power {
42                         label = "power";
43                         gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
44                         linux,code = <KEY_POWER>;
45                 };
46
47                 reset {
48                         label = "reset";
49                         gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
50                         linux,code = <KEY_RESTART>;
51                 };
52
53                 wps {
54                         label = "wps";
55                         gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
56                         linux,code = <KEY_WPS_BUTTON>;
57                 };
58
59                 auto {
60                         label = "auto";
61                         gpios = <&gpio 48 GPIO_ACTIVE_HIGH>;
62                         linux,code = <BTN_0>;
63                         linux,input-type = <EV_SW>;
64                 };
65
66                 router {
67                         label = "router";
68                         gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
69                         linux,code = <BTN_1>;
70                         linux,input-type = <EV_SW>;
71                 };
72         };
73
74         leds {
75                 compatible = "gpio-leds";
76
77                 diag_r: diag_r {
78                         label = "wbmr300:red:diag";
79                         gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
80                         default_state = "off";
81                 };
82
83                 wifi_g: wifi_g {
84                         label = "wbmr300:green:wifi";
85                         gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
86                 };
87
88                 dsl: dsl {
89                         label = "dsl";
90                         gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
91                 };
92
93                 router_y: router_y {
94                         label = "wbmr300:yellow:router";
95                         gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
96                 };
97
98                 wifi_y: wifi_y {
99                         label = "wbmr300:yellow:wifi";
100                         gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
101                 };
102
103                 lan1: lan1 {
104                         label = "wbmr300:green:lan1";
105                         gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
106                 };
107
108                 wan: wan {
109                         label = "wbmr300:green:wan";
110                         gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
111                 };
112
113                 lan3: lan3 {
114                         label = "wbmr300:green:lan3";
115                         gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
116                 };
117
118                 lan2: lan2 {
119                         label = "wbmr300:green:lan2";
120                         gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
121                 };
122
123                 internet_g: internet_g {
124                         label = "wbmr300:green:internet";
125                         gpios = <&gpio 34 GPIO_ACTIVE_HIGH>;
126                 };
127
128                 internet_y: internet_y {
129                         label = "wbmr300:yellow:internet";
130                         gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
131                 };
132
133                 router_g: router_g {
134                         label = "wbmr300:green:router";
135                         gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
136                 };
137
138                 power_g: power_g {
139                         label = "wbmr300:green:power";
140                         gpios = <&gpio 49 GPIO_ACTIVE_HIGH>;
141                 };
142         };
143
144         usb_vbus: regulator-usb-vbus {
145                 compatible = "regulator-fixed";
146
147                 regulator-name = "USB_VBUS";
148
149                 regulator-min-microvolt = <5000000>;
150                 regulator-max-microvolt = <5000000>;
151
152                 gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
153                 enable-active-high;
154         };
155 };
156
157 &eth0 {
158         lan: interface@0 {
159                 compatible = "lantiq,xrx200-pdi";
160                 #address-cells = <1>;
161                 #size-cells = <0>;
162                 reg = <0>;
163                 lantiq,switch;
164
165                 ethernet@1 {
166                         compatible = "lantiq,xrx200-pdi-port";
167                         reg = <4>;
168                         phy-mode = "mii";
169                         phy-handle = <&phy13>;
170                 };
171                 ethernet@2 {
172                         compatible = "lantiq,xrx200-pdi-port";
173                         reg = <5>;
174                         phy-mode = "mii";
175                         phy-handle = <&phy14>;
176                 };
177                 ethernet@3 {
178                         compatible = "lantiq,xrx200-pdi-port";
179                         reg = <2>;
180                         phy-mode = "mii";
181                         phy-handle = <&phy11>;
182                 };
183                 ethernet@4 {
184                         compatible = "lantiq,xrx200-pdi-port";
185                         reg = <3>;
186                         phy-mode = "mii";
187                         phy-handle = <&phy12>;
188                 };
189         };
190
191         mdio {
192                 #address-cells = <1>;
193                 #size-cells = <0>;
194                 compatible = "lantiq,xrx200-mdio";
195
196                 phy11: ethernet-phy@11 {
197                         reg = <0x11>;
198                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
199                 };
200                 phy12: ethernet-phy@12 {
201                         reg = <0x12>;
202                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
203                 };
204                 phy13: ethernet-phy@13 {
205                         reg = <0x13>;
206                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
207                 };
208                 phy14: ethernet-phy@14 {
209                         reg = <0x14>;
210                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
211                 };
212         };
213 };
214
215 &gphy0 {
216         lantiq,gphy-mode = <GPHY_MODE_FE>;
217 };
218
219 &gphy1 {
220         lantiq,gphy-mode = <GPHY_MODE_FE>;
221 };
222
223 &gpio {
224         pinctrl-names = "default";
225         pinctrl-0 = <&state_default>;
226
227         state_default: pinmux {
228                 phy-rst {
229                         lantiq,pins = "io42";
230                         lantiq,pull = <0>;
231                         lantiq,open-drain = <0>;
232                         lantiq,output = <1>;
233                 };
234                 pcie-rst {
235                         lantiq,pins = "io38";
236                         lantiq,pull = <0>;
237                         lantiq,output = <1>;
238                 };
239         };
240         pins_spi_default: pins_spi_default {
241                 spi_in {
242                         lantiq,groups = "spi_di";
243                         lantiq,function = "spi";
244                 };
245                 spi_out {
246                         lantiq,groups = "spi_do", "spi_clk",
247                                 "spi_cs4";
248                         lantiq,function = "spi";
249                         lantiq,output = <1>;
250                 };
251         };
252 };
253
254 &spi {
255         status = "okay";
256
257         pinctrl-names = "default";
258         pinctrl-0 = <&pins_spi_default>;
259
260         flash@4 {
261                 compatible = "jedec,spi-nor";
262                 reg = <4>;
263                 spi-max-frequency = <20000000>;
264
265                 partitions {
266                         #address-cells = <1>;
267                         #size-cells = <1>;
268
269                         partition@0 {
270                                 reg = <0x0 0x10000>;
271                                 label = "u-boot";
272                                 read-only;
273                         };
274
275                         partition@10000 {
276                                 reg = <0x10000 0x10000>;
277                                 label = "gphyfirmware";
278                                 read-only;
279                         };
280
281                         partition@20000 {
282                                 reg = <0x20000 0x80000>;
283                                 label = "dsl_fw";
284                         };
285
286                         partition@de0000 {
287                                 reg = <0xa0000 0xf40000>;
288                                 label = "firmware";
289                         };
290
291                         partition@fe0000 {
292                                 reg = <0xfe0000 0x10000>;
293                                 label = "sysconfig";
294                                 read-only;
295                         };
296
297                         partition@ff0000 {
298                                 reg = <0xff0000 0x2000>;
299                                 label = "ubootconfig";
300                         };
301
302                         partition@ff3000 {
303                                 reg = <0xff3000 0x2000>;
304                                 label = "board_config";
305                                 read-only;
306                         };
307                 };
308         };
309 };
310
311 &usb_phy0 {
312         status = "okay";
313 };
314
315 &usb_phy1 {
316         status = "okay";
317 };
318
319 &usb0 {
320         status = "okay";
321         vbus-supply = <&usb_vbus>;
322 };
323
324 &usb1 {
325         status = "okay";
326         vbus-supply = <&usb_vbus>;
327 };