1/*
2 * Device Tree file for Buffalo Linkstation LS-WVL/VL
3 *
4 * Copyright (C) 2015, rogershimizu@gmail.com
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12/dts-v1/;
13
14#include "kirkwood.dtsi"
15#include "kirkwood-6282.dtsi"
16
17/ {
18	model = "Buffalo Linkstation LS-WVL/VL";
19	compatible = "buffalo,lswvl", "buffalo,lsvl", "marvell,kirkwood-88f6282", "marvell,kirkwood";
20
21	memory { /* 256 MB */
22		device_type = "memory";
23		reg = <0x00000000 0x10000000>;
24	};
25
26	chosen {
27		bootargs = "console=ttyS0,115200n8 earlyprintk";
28		stdout-path = &uart0;
29	};
30
31	mbus {
32		pcie-controller {
33			status = "okay";
34			pcie@1,0 {
35				status = "okay";
36			};
37		};
38	};
39
40	ocp@f1000000 {
41		pinctrl: pin-controller@10000 {
42			pmx_power_hdd0: pmx-power-hdd0 {
43				marvell,pins = "mpp8";
44				marvell,function = "gpio";
45			};
46			pmx_power_hdd1: pmx-power-hdd1 {
47				marvell,pins = "mpp9";
48				marvell,function = "gpio";
49			};
50			pmx_usb_vbus: pmx-usb-vbus {
51				marvell,pins = "mpp12";
52				marvell,function = "gpio";
53			};
54			pmx_fan_high: pmx-fan-high {
55				marvell,pins = "mpp16";
56				marvell,function = "gpio";
57			};
58			pmx_fan_low: pmx-fan-low {
59				marvell,pins = "mpp17";
60				marvell,function = "gpio";
61			};
62			pmx_led_hdderr0: pmx-led-hdderr0 {
63				marvell,pins = "mpp34";
64				marvell,function = "gpio";
65			};
66			pmx_led_hdderr1: pmx-led-hdderr1 {
67				marvell,pins = "mpp35";
68				marvell,function = "gpio";
69			};
70			pmx_led_alarm: pmx-led-alarm {
71				marvell,pins = "mpp36";
72				marvell,function = "gpio";
73			};
74			pmx_led_function_red: pmx-led-function-red {
75				marvell,pins = "mpp37";
76				marvell,function = "gpio";
77			};
78			pmx_led_info: pmx-led-info {
79				marvell,pins = "mpp38";
80				marvell,function = "gpio";
81			};
82			pmx_led_function_blue: pmx-led-function-blue {
83				marvell,pins = "mpp39";
84				marvell,function = "gpio";
85			};
86			pmx_led_power: pmx-led-power {
87				marvell,pins = "mpp40";
88				marvell,function = "gpio";
89			};
90			pmx_fan_lock: pmx-fan-lock {
91				marvell,pins = "mpp43";
92				marvell,function = "gpio";
93			};
94			pmx_button_function: pmx-button-function {
95				marvell,pins = "mpp45";
96				marvell,function = "gpio";
97			};
98			pmx_power_switch: pmx-power-switch {
99				marvell,pins = "mpp46";
100				marvell,function = "gpio";
101			};
102			pmx_power_auto_switch: pmx-power-auto-switch {
103				marvell,pins = "mpp47";
104				marvell,function = "gpio";
105			};
106		};
107
108		serial@12000 {
109			status = "okay";
110		};
111
112		sata@80000 {
113			status = "okay";
114			nr-ports = <2>;
115		};
116
117		spi@10600 {
118			status = "okay";
119
120			m25p40@0 {
121				#address-cells = <1>;
122				#size-cells = <1>;
123				compatible = "st,m25p40", "jedec,spi-nor";
124				reg = <0>;
125				spi-max-frequency = <25000000>;
126				mode = <0>;
127
128				partition@0 {
129					reg = <0x0 0x60000>;
130					label = "uboot";
131					read-only;
132				};
133
134				partition@60000 {
135					reg = <0x60000 0x10000>;
136					label = "dtb";
137					read-only;
138				};
139
140				partition@70000 {
141					reg = <0x70000 0x10000>;
142					label = "uboot_env";
143				};
144			};
145		};
146	};
147
148	gpio_keys {
149		compatible = "gpio-keys";
150		#address-cells = <1>;
151		#size-cells = <0>;
152		pinctrl-0 = <&pmx_button_function &pmx_power_switch
153			     &pmx_power_auto_switch>;
154		pinctrl-names = "default";
155
156		button@1 {
157			label = "Function Button";
158			linux,code = <KEY_OPTION>;
159			gpios = <&gpio0 45 GPIO_ACTIVE_LOW>;
160		};
161
162		button@2 {
163			label = "Power-on Switch";
164			linux,code = <KEY_RESERVED>;
165			linux,input-type = <5>;
166			gpios = <&gpio0 46 GPIO_ACTIVE_LOW>;
167		};
168
169		button@3 {
170			label = "Power-auto Switch";
171			linux,code = <KEY_ESC>;
172			linux,input-type = <5>;
173			gpios = <&gpio0 47 GPIO_ACTIVE_LOW>;
174		};
175	};
176
177	gpio_leds {
178		compatible = "gpio-leds";
179		pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
180			     &pmx_led_info &pmx_led_power
181			     &pmx_led_function_blue
182			     &pmx_led_hdderr0
183			     &pmx_led_hdderr1>;
184		pinctrl-names = "default";
185
186		led@1 {
187			label = "lswvl:red:alarm";
188			gpios = <&gpio0 36 GPIO_ACTIVE_LOW>;
189		};
190
191		led@2 {
192			label = "lswvl:red:func";
193			gpios = <&gpio0 37 GPIO_ACTIVE_LOW>;
194		};
195
196		led@3 {
197			label = "lswvl:amber:info";
198			gpios = <&gpio0 38 GPIO_ACTIVE_LOW>;
199		};
200
201		led@4 {
202			label = "lswvl:blue:func";
203			gpios = <&gpio0 39 GPIO_ACTIVE_LOW>;
204		};
205
206		led@5 {
207			label = "lswvl:blue:power";
208			gpios = <&gpio0 40 GPIO_ACTIVE_LOW>;
209			default-state = "keep";
210		};
211
212		led@6 {
213			label = "lswvl:red:hdderr0";
214			gpios = <&gpio0 34 GPIO_ACTIVE_LOW>;
215		};
216
217		led@7 {
218			label = "lswvl:red:hdderr1";
219			gpios = <&gpio0 35 GPIO_ACTIVE_LOW>;
220		};
221	};
222
223	gpio_fan {
224		compatible = "gpio-fan";
225		pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
226		pinctrl-names = "default";
227
228		gpios = <&gpio0 17 GPIO_ACTIVE_LOW
229			 &gpio0 16 GPIO_ACTIVE_LOW>;
230
231		gpio-fan,speed-map = <0 3
232				1500 2
233				3250 1
234				5000 0>;
235
236		alarm-gpios = <&gpio0 43 GPIO_ACTIVE_HIGH>;
237	};
238
239	restart_poweroff {
240		compatible = "restart-poweroff";
241	};
242
243	regulators {
244		compatible = "simple-bus";
245		#address-cells = <1>;
246		#size-cells = <0>;
247		pinctrl-0 = <&pmx_power_hdd0 &pmx_power_hdd1 &pmx_usb_vbus>;
248		pinctrl-names = "default";
249
250		usb_power: regulator@1 {
251			compatible = "regulator-fixed";
252			reg = <1>;
253			regulator-name = "USB Power";
254			regulator-min-microvolt = <5000000>;
255			regulator-max-microvolt = <5000000>;
256			enable-active-high;
257			regulator-always-on;
258			regulator-boot-on;
259			gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
260		};
261		hdd_power0: regulator@2 {
262			compatible = "regulator-fixed";
263			reg = <2>;
264			regulator-name = "HDD0 Power";
265			regulator-min-microvolt = <5000000>;
266			regulator-max-microvolt = <5000000>;
267			enable-active-high;
268			regulator-always-on;
269			regulator-boot-on;
270			gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
271		};
272		hdd_power1: regulator@3 {
273			compatible = "regulator-fixed";
274			reg = <3>;
275			regulator-name = "HDD1 Power";
276			regulator-min-microvolt = <5000000>;
277			regulator-max-microvolt = <5000000>;
278			enable-active-high;
279			regulator-always-on;
280			regulator-boot-on;
281			gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
282		};
283	};
284};
285
286&mdio {
287	status = "okay";
288
289	ethphy0: ethernet-phy@0 {
290		device_type = "ethernet-phy";
291		reg = <0>;
292	};
293};
294
295&eth0 {
296	status = "okay";
297
298	ethernet0-port@0 {
299		phy-handle = <&ethphy0>;
300	};
301};
302