mvebu: LS421DE: dts file improvements
[openwrt/staging/dedeckeh.git] / target / linux / mvebu / files / arch / arm / boot / dts / armada-370-buffalo-ls421de.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3 * Device Tree file for Buffalo LinkStation LS421DE
4 *
5 * Copyright (C) 2020 Daniel González Cabanelas <dgcbueu@gmail.com>
6 */
7
8 /dts-v1/;
9
10 #include "armada-370.dtsi"
11 #include "mvebu-linkstation-fan.dtsi"
12 #include <dt-bindings/gpio/gpio.h>
13 #include <dt-bindings/input/input.h>
14
15 / {
16 model = "Buffalo LinkStation LS421DE";
17 compatible = "buffalo,ls421de", "marvell,armada370", "marvell,armada-370-xp";
18
19 aliases {
20 led-boot = &led_boot;
21 led-failsafe = &led_failsafe;
22 led-running = &led_power;
23 led-upgrade = &led_upgrade;
24 };
25
26 chosen {
27 bootargs = "console=ttyS0,115200 earlyprintk noinitrd rootfstype=squashfs";
28 stdout-path = "serial0:115200n8";
29 append-rootblock = "nullparameter="; /* override the bootloader args */
30 };
31
32 memory {
33 device_type = "memory";
34 reg = <0x00000000 0x20000000>; /* 512 MB */
35 };
36
37 soc {
38 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
39 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
40 MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
41 };
42
43 gpio_fan {
44 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
45 &gpio0 14 GPIO_ACTIVE_HIGH>;
46 alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
47 };
48
49 gpio_keys {
50 compatible = "gpio-keys";
51 #address-cells = <1>;
52 #size-cells = <0>;
53 pinctrl-0 = <&pmx_buttons>;
54 pinctrl-names = "default";
55
56 power {
57 label = "Power Switch";
58 linux,code = <KEY_POWER>;
59 linux,input-type = <EV_SW>;
60 gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
61 };
62
63 function {
64 label = "Function Button";
65 linux,code = <KEY_CONFIG>;
66 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
67 };
68 };
69
70 gpio_leds {
71 compatible = "gpio-leds";
72 pinctrl-names = "default";
73 pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
74
75 system_red {
76 label = "ls421de:red:system";
77 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
78 };
79
80 led_power: power_white {
81 label = "ls421de:white:power";
82 gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
83 default-state = "on";
84 };
85
86 led_failsafe: power_red {
87 label = "ls421de:red:power";
88 gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
89 };
90
91 led_upgrade: power_orange {
92 label = "ls421de:orange:power";
93 gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
94 };
95
96 led_boot: system_white {
97 label = "ls421de:white:system";
98 gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
99 };
100
101 hdd1_red {
102 label = "ls421de:red:hdd1";
103 gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
104 default-state = "off";
105 linux,default-trigger = "disk-activity";
106 };
107
108 hdd2_red {
109 label = "ls421de:red:hdd2";
110 gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
111 default-state = "off";
112 linux,default-trigger = "disk-activity";
113 };
114 };
115
116 regulators {
117 compatible = "simple-bus";
118 #address-cells = <1>;
119 #size-cells = <0>;
120 pinctrl-0 = <&pmx_power_usb &pmx_power_hdd1 &pmx_power_hdd2>;
121 pinctrl-names = "default";
122
123 usb_power: regulator@0 {
124 compatible = "regulator-fixed";
125 reg = <0>;
126 regulator-name = "USB";
127 regulator-min-microvolt = <5000000>;
128 regulator-max-microvolt = <5000000>;
129 enable-active-high;
130 regulator-always-on;
131 regulator-boot-on;
132 gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>;
133 };
134
135 sata1_power: regulator@1 {
136 compatible = "regulator-fixed";
137 reg = <1>;
138 regulator-name = "HDD1";
139 regulator-min-microvolt = <12000000>;
140 regulator-max-microvolt = <12000000>;
141 startup-delay-us = <2000000>;
142 enable-active-high;
143 regulator-always-on;
144 regulator-boot-on;
145 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
146 };
147
148 sata2_power: regulator@2 {
149 compatible = "regulator-fixed";
150 reg = <2>;
151 regulator-name = "HDD2";
152 regulator-min-microvolt = <12000000>;
153 regulator-max-microvolt = <12000000>;
154 startup-delay-us = <4000000>;
155 enable-active-high;
156 regulator-always-on;
157 regulator-boot-on;
158 gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
159 };
160 };
161
162 /* FIXME: this driver needs to be aware of the LED2 eth phy use,
163 which must be set to off state before shutting down the machine */
164 restart_poweroff {
165 compatible = "restart-poweroff";
166 };
167 };
168
169 &eth1 {
170 pinctrl-0 = <&ge1_rgmii_pins>;
171 pinctrl-names = "default";
172 status = "okay";
173 phy-handle = <&ethphy0>;
174 phy-connection-type = "rgmii-id";
175 };
176
177 &i2c0 {
178 pinctrl-0 = <&i2c0_pins>;
179 pinctrl-names = "default";
180 clock-frequency = <100000>;
181 status = "okay";
182
183 rs5c372a: rs5c372a@32 {
184 compatible = "ricoh,rs5c372a";
185 reg = <0x32>;
186 };
187 };
188
189 &mdio {
190 pinctrl-0 = <&mdio_pins>;
191 pinctrl-names = "default";
192
193 ethphy0: ethernet-phy@0 { /* Marvell 88E1518 */
194 reg = <0>;
195 /*
196 * LED2 is used to inform, at restart time, if the power
197 * switch was slided to the "off" position.
198 * Page 0x3, Register 0x10, bits 8-11:
199 * 0x800: LED2 off, power off the machine
200 * 0x900: LED2 on, boot the machine
201 */
202 marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED function */
203 <0x3 0x11 0x1 0x4401>, /* LED polarity */
204 <0x3 0x12 0x1 0x4905>; /* LED timer */
205 };
206 };
207
208 &pciec {
209 status = "okay";
210 /* Connected to uPD720202 USB 3.0 Host */
211 pcie@1,0 {
212 status = "okay";
213 };
214 };
215
216 &pmsu {
217 pinctrl-0 = <&pmx_power_cpu>;
218 pinctrl-names = "default";
219 };
220
221 &rtc {
222 status = "disabled";
223 };
224
225 &sata {
226 nr-ports = <2>;
227 status = "okay";
228 };
229
230 &sdio {
231 pinctrl-0 = <&sdio_pins2>;
232 pinctrl-names = "default";
233 status = "okay";
234 /* No CD or WP GPIOs */
235 broken-cd;
236 };
237
238 &uart0 {
239 status = "okay";
240 };
241
242 &usb0 {
243 status = "okay";
244 };
245
246 &nand_controller {
247 status = "okay";
248
249 nand@0 {
250 reg = <0>;
251 label = "pxa3xx_nand-0";
252 nand-rb = <0>;
253 marvell,nand-keep-config;
254 nand-on-flash-bbt;
255 nand-ecc-strength = <4>;
256 nand-ecc-step-size = <512>;
257
258 partitions {
259 compatible = "fixed-partitions";
260 #address-cells = <1>;
261 #size-cells = <1>;
262
263 partition@0 {
264 label = "kernel";
265 reg = <0x00000000 0x02000000>; /* 32 MiB */
266 };
267
268 partition@2000000 {
269 label = "ubi";
270 reg = <0x02000000 0x1e000000>; /* 480 MiB */
271 };
272 };
273 };
274 };
275
276 &spi0 {
277 status = "okay";
278 pinctrl-0 = <&spi0_pins2>;
279 pinctrl-names = "default";
280
281 spi-flash@0 {
282 #address-cells = <1>;
283 #size-cells = <1>;
284 compatible = "mxicy,mx25l8005", "jedec,spi-nor";
285 reg = <0>; /* Chip select 0 */
286 spi-max-frequency = <50000000>;
287
288 partitions {
289 compatible = "fixed-partitions";
290 #address-cells = <1>;
291 #size-cells = <1>;
292
293 partition@0 {
294 reg = <0x00000 0xf0000>; /* 960 KiB*/
295 label = "u-boot";
296 read-only;
297 };
298 partition@f0000 {
299 reg = <0xf0000 0x10000>; /* 64 KiB */
300 label = "u-boot-env";
301 };
302 };
303 };
304 };
305
306 &pinctrl {
307 pmx_power_cpu: pmx-power-cpu {
308 marvell,pins = "mpp4";
309 marvell,function = "vdd";
310 };
311 pmx_power_usb: pmx-power-usb {
312 marvell,pins = "mpp5";
313 marvell,function = "gpo";
314 };
315 pmx_power_hdd1: pmx-power-hdd1 {
316 marvell,pins = "mpp8";
317 marvell,function = "gpio";
318 };
319 pmx_power_hdd2: pmx-power-hdd2 {
320 marvell,pins = "mpp9";
321 marvell,function = "gpo";
322 };
323 pmx_fan_lock: pmx-fan-lock {
324 marvell,pins = "mpp10";
325 marvell,function = "gpio";
326 };
327 pmx_hdd_present: pmx-hdd-present {
328 marvell,pins = "mpp11", "mpp12";
329 marvell,function = "gpio";
330 };
331 pmx_fan_high: pmx-fan-high {
332 marvell,pins = "mpp13";
333 marvell,function = "gpio";
334 };
335 pmx_fan_low: pmx-fan-low {
336 marvell,pins = "mpp14";
337 marvell,function = "gpio";
338 };
339 pmx_buttons: pmx-buttons {
340 marvell,pins = "mpp15", "mpp16";
341 marvell,function = "gpio";
342 };
343 pmx_leds1: pmx-leds {
344 marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
345 marvell,function = "gpo";
346 };
347 pmx_leds2: pmx-leds {
348 marvell,pins = "mpp55", "mpp57", "mpp62";
349 marvell,function = "gpio";
350 };
351 };