3de9ac5473e5733c03cd6fe522d38500933d0194
[openwrt/openwrt.git] / target / linux / mvebu / files / arch / arm / boot / dts / armada-370-buffalo-ls220de.dts
1 // SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
2 /*
3 * Device Tree file for Buffalo LinkStation LS220DE
4 *
5 * Copyright (C) 2023 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 #include <dt-bindings/leds/common.h>
15 #include <dt-bindings/thermal/thermal.h>
16
17 / {
18 model = "Buffalo LinkStation LS220DE";
19 compatible = "buffalo,ls220de", "marvell,armada370", "marvell,armada-370-xp";
20
21 aliases {
22 led-boot = &led_boot;
23 led-failsafe = &led_failsafe;
24 led-running = &led_power;
25 led-upgrade = &led_upgrade;
26 };
27
28 chosen {
29 bootargs = "earlycon";
30 stdout-path = "serial0:115200n8";
31 append-rootblock = "nullparameter="; /* override the bootloader args */
32 };
33
34 memory {
35 device_type = "memory";
36 reg = <0x00000000 0x10000000>; /* 256 MB */
37 };
38
39 soc {
40 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
41 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
42 MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
43 };
44
45 system_fan: gpio_fan {
46 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
47 &gpio0 14 GPIO_ACTIVE_HIGH>;
48 alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
49
50 #cooling-cells = <2>;
51 };
52
53 thermal-zones {
54 hdd-thermal {
55 polling-delay = <20000>;
56 polling-delay-passive = <2000>;
57
58 thermal-sensors = <&hdd0_temp>; /* only one drivetemp sensor is supported */
59
60 trips {
61 hdd_alert1: trip1 {
62 temperature = <34000>;
63 hysteresis = <2000>;
64 type = "active";
65 };
66 hdd_alert2: trip2 {
67 temperature = <40000>;
68 hysteresis = <2000>;
69 type = "active";
70 };
71 hdd_alert3: trip3 {
72 temperature = <45000>;
73 hysteresis = <2000>;
74 type = "passive";
75 };
76 hdd_hot {
77 temperature = <50000>;
78 hysteresis = <2000>;
79 type = "hot";
80 };
81 hdd_crit {
82 temperature = <60000>;
83 hysteresis = <2000>;
84 type = "critical";
85 };
86 };
87
88 cooling-maps {
89 map1 {
90 trip = <&hdd_alert1>;
91 cooling-device = <&system_fan THERMAL_NO_LIMIT 1>;
92 };
93 map2 {
94 trip = <&hdd_alert2>;
95 cooling-device = <&system_fan 2 2>;
96 };
97 map3 {
98 trip = <&hdd_alert3>;
99 cooling-device = <&system_fan 3 THERMAL_NO_LIMIT>;
100 };
101 };
102 };
103 };
104
105 gpio_keys {
106 compatible = "gpio-keys";
107 pinctrl-0 = <&pmx_buttons>;
108 pinctrl-names = "default";
109
110 power {
111 label = "Power Switch";
112 linux,code = <KEY_POWER>;
113 linux,input-type = <EV_SW>;
114 gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
115 };
116
117 function {
118 label = "Function Button";
119 linux,code = <KEY_CONFIG>;
120 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
121 };
122 };
123
124 gpio_leds {
125 compatible = "gpio-leds";
126 pinctrl-names = "default";
127 pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
128
129 indicator_red {
130 function = LED_FUNCTION_INDICATOR;
131 color = <LED_COLOR_ID_RED>;
132 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
133 panic-indicator;
134 };
135
136 led_power: power_white {
137 label = "white:power";
138 function = LED_FUNCTION_POWER;
139 color = <LED_COLOR_ID_WHITE>;
140 gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
141 default-state = "on";
142 };
143
144 led_failsafe: power_red {
145 label = "red:power";
146 function = LED_FUNCTION_POWER;
147 color = <LED_COLOR_ID_RED>;
148 gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
149 };
150
151 led_upgrade: power_orange {
152 label = "amber:power";
153 function = LED_FUNCTION_POWER;
154 color = <LED_COLOR_ID_AMBER>;
155 gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
156 };
157
158 led_boot: indicator_white {
159 label = "white:indicator";
160 function = LED_FUNCTION_INDICATOR;
161 color = <LED_COLOR_ID_WHITE>;
162 gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
163 };
164
165 hdd1_red {
166 function = LED_FUNCTION_DISK;
167 color = <LED_COLOR_ID_RED>;
168 gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
169 linux,default-trigger = "ata1";
170 function-enumerator = <1>;
171 };
172
173 hdd2_red {
174 function = LED_FUNCTION_DISK;
175 color = <LED_COLOR_ID_RED>;
176 gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
177 linux,default-trigger = "ata2";
178 function-enumerator = <2>;
179 };
180 };
181
182 regulators {
183 compatible = "simple-bus";
184 #address-cells = <1>;
185 #size-cells = <0>;
186 pinctrl-0 = <&pmx_power_hdd1 &pmx_power_hdd2>;
187 pinctrl-names = "default";
188
189 sata1_power: regulator@1 {
190 compatible = "regulator-fixed";
191 reg = <1>;
192 regulator-name = "HDD1";
193 regulator-min-microvolt = <12000000>;
194 regulator-max-microvolt = <12000000>;
195 startup-delay-us = <2000000>;
196 enable-active-high;
197 regulator-always-on;
198 regulator-boot-on;
199 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
200 };
201
202 sata2_power: regulator@2 {
203 compatible = "regulator-fixed";
204 reg = <2>;
205 regulator-name = "HDD2";
206 regulator-min-microvolt = <12000000>;
207 regulator-max-microvolt = <12000000>;
208 startup-delay-us = <4000000>;
209 enable-active-high;
210 regulator-always-on;
211 regulator-boot-on;
212 gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
213 };
214 };
215 };
216
217 &coherencyfab {
218 broken-idle;
219 };
220
221 &eth1 {
222 pinctrl-0 = <&ge1_rgmii_pins>;
223 pinctrl-names = "default";
224 status = "okay";
225 phy-handle = <&ethphy0>;
226 phy-connection-type = "rgmii-id";
227 };
228
229 &mdio {
230 pinctrl-0 = <&mdio_pins>;
231 pinctrl-names = "default";
232
233 ethphy0: ethernet-phy@0 { /* Marvell 88E1318 */
234 reg = <0>;
235 marvell,reg-init = <0x3 0x10 0xf000 0x091A>, /* LED function */
236 <0x3 0x11 0x0000 0x4401>, /* LED polarity */
237 <0x3 0x12 0x0000 0x4905>; /* LED timer */
238 #thermal-sensor-cells = <0>;
239 };
240 };
241
242 &nand_controller {
243 status = "okay";
244
245 nand@0 {
246 reg = <0>;
247 label = "pxa3xx_nand-0";
248 nand-rb = <0>;
249 marvell,nand-keep-config;
250 nand-on-flash-bbt;
251 nand-ecc-strength = <4>;
252 nand-ecc-step-size = <512>;
253
254 partitions {
255 compatible = "fixed-partitions";
256 #address-cells = <1>;
257 #size-cells = <1>;
258
259 partition@0 {
260 label = "ubi_kernel";
261 reg = <0x00000000 0x02000000>; /* 32 MiB */
262 };
263
264 partition@2000000 {
265 label = "ubi";
266 reg = <0x02000000 0x1df00000>; /* 479 MiB */
267 };
268 };
269 };
270 };
271
272 &sata {
273 nr-ports = <2>;
274 status = "okay";
275 #address-cells = <1>;
276 #size-cells = <0>;
277
278 hdd0_temp: sata-port@0 {
279 reg = <0>;
280 #thermal-sensor-cells = <0>;
281 };
282
283 hdd1_temp: sata-port@1 {
284 reg = <1>;
285 #thermal-sensor-cells = <0>;
286 };
287 };
288
289 &spi0 {
290 status = "okay";
291 pinctrl-0 = <&spi0_pins2>;
292 pinctrl-names = "default";
293
294 spi-flash@0 {
295 compatible = "mxicy,mx25l8005", "jedec,spi-nor";
296 reg = <0>;
297 spi-max-frequency = <50000000>;
298
299 partitions {
300 compatible = "fixed-partitions";
301 #address-cells = <1>;
302 #size-cells = <1>;
303
304 partition@0 {
305 reg = <0x00000 0xf0000>; /* 960 KiB*/
306 label = "u-boot";
307 read-only;
308 };
309 partition@f0000 {
310 reg = <0xf0000 0x10000>; /* 64 KiB */
311 label = "u-boot-env";
312 };
313 };
314 };
315 };
316
317 &pmsu {
318 pinctrl-0 = <&pmx_power_cpu>;
319 pinctrl-names = "default";
320 };
321
322 &uart0 {
323 status = "okay";
324 };
325
326 &usb0 {
327 status = "okay";
328 };
329
330 &pinctrl {
331 pmx_power_hdd2: pmx-power-hdd2 {
332 marvell,pins = "mpp2";
333 marvell,function = "gpio";
334 };
335
336 pmx_power_cpu: pmx-power-cpu {
337 marvell,pins = "mpp4";
338 marvell,function = "vdd";
339 };
340
341 pmx_power_hdd1: pmx-power-hdd1 {
342 marvell,pins = "mpp8";
343 marvell,function = "gpio";
344 };
345
346 pmx_fan_lock: pmx-fan-lock {
347 marvell,pins = "mpp10";
348 marvell,function = "gpio";
349 };
350
351 pmx_hdd_present: pmx-hdd-present {
352 marvell,pins = "mpp11", "mpp12";
353 marvell,function = "gpio";
354 };
355
356 pmx_fan_high: pmx-fan-high {
357 marvell,pins = "mpp13";
358 marvell,function = "gpio";
359 };
360
361 pmx_fan_low: pmx-fan-low {
362 marvell,pins = "mpp14";
363 marvell,function = "gpio";
364 };
365
366 pmx_buttons: pmx-buttons {
367 marvell,pins = "mpp15", "mpp16";
368 marvell,function = "gpio";
369 };
370
371 pmx_leds1: pmx-leds {
372 marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
373 marvell,function = "gpo";
374 };
375
376 pmx_leds2: pmx-leds {
377 marvell,pins = "mpp55", "mpp57", "mpp62";
378 marvell,function = "gpio";
379 };
380 };