lantiq: kernel 4.14: use vbus-supply devicetree property
[oweals/openwrt.git] / target / linux / lantiq / files-4.14 / 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
21                 led-dsl = &dsl;
22                 led-internet = &router_g;
23                 led-wifi = &wifi_g;
24         };
25
26         memory@0 {
27                 reg = <0x0 0x4000000>;
28         };
29
30         gpio_poweroff {
31                 compatible = "gpio-poweroff";
32                 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
33         };
34
35         gpio-keys-polled {
36                 compatible = "gpio-keys-polled";
37                 #address-cells = <1>;
38                 #size-cells = <0>;
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         gpio-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@0 {
192                 #address-cells = <1>;
193                 #size-cells = <0>;
194                 compatible = "lantiq,xrx200-mdio";
195                 reg = <0>;
196
197                 phy11: ethernet-phy@11 {
198                         reg = <0x11>;
199                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
200                 };
201                 phy12: ethernet-phy@12 {
202                         reg = <0x12>;
203                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
204                 };
205                 phy13: ethernet-phy@13 {
206                         reg = <0x13>;
207                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
208                 };
209                 phy14: ethernet-phy@14 {
210                         reg = <0x14>;
211                         compatible = "lantiq,phy22f", "ethernet-phy-ieee802.3-c22";
212                 };
213         };
214 };
215
216 &gphy0 {
217         lantiq,gphy-mode = <GPHY_MODE_FE>;
218 };
219
220 &gphy1 {
221         lantiq,gphy-mode = <GPHY_MODE_FE>;
222 };
223
224 &gpio {
225         pinctrl-names = "default";
226         pinctrl-0 = <&state_default>;
227
228         state_default: pinmux {
229                 mdio {
230                         lantiq,groups = "mdio";
231                         lantiq,function = "mdio";
232                 };
233                 phy-rst {
234                         lantiq,pins = "io42";
235                         lantiq,pull = <0>;
236                         lantiq,open-drain = <0>;
237                         lantiq,output = <1>;
238                 };
239                 pcie-rst {
240                         lantiq,pins = "io38";
241                         lantiq,pull = <0>;
242                         lantiq,output = <1>;
243                 };
244         };
245         pins_spi_default: pins_spi_default {
246                 spi_in {
247                         lantiq,groups = "spi_di";
248                         lantiq,function = "spi";
249                 };
250                 spi_out {
251                         lantiq,groups = "spi_do", "spi_clk",
252                                 "spi_cs4";
253                         lantiq,function = "spi";
254                         lantiq,output = <1>;
255                 };
256         };
257 };
258
259 &spi {
260         status = "okay";
261
262         pinctrl-names = "default";
263         pinctrl-0 = <&pins_spi_default>;
264
265         m25p80@4 {
266                 #address-cells = <1>;
267                 #size-cells = <1>;
268                 compatible = "jedec,spi-nor";
269                 reg = <4 0>;
270                 spi-max-frequency = <20000000>;
271
272                 partition@0 {
273                         reg = <0x0 0x10000>;
274                         label = "u-boot";
275                         read-only;
276                 };
277
278                 partition@10000 {
279                         reg = <0x10000 0x10000>;
280                         label = "gphyfirmware";
281                         read-only;
282                 };
283
284                 partition@20000 {
285                         reg = <0x20000 0x80000>;
286                         label = "dsl_fw";
287                 };
288
289                 partition@de0000 {
290                         reg = <0xa0000 0xf40000>;
291                         label = "firmware";
292                 };
293
294                 partition@fe0000 {
295                         reg = <0xfe0000 0x10000>;
296                         label = "sysconfig";
297                         read-only;
298                 };
299
300                 partition@ff0000 {
301                         reg = <0xff0000 0x2000>;
302                         label = "ubootconfig";
303                 };
304
305                 partition@ff3000 {
306                         reg = <0xff3000 0x2000>;
307                         label = "board_config";
308                         read-only;
309                 };
310         };
311 };
312
313 &usb_phy0 {
314         status = "okay";
315 };
316
317 &usb_phy1 {
318         status = "okay";
319 };
320
321 &usb0 {
322         status = "okay";
323         vbus-supply = <&usb_vbus>;
324 };
325
326 &usb1 {
327         status = "okay";
328         vbus-supply = <&usb_vbus>;
329 };