mvebu: LS421DE: fix the thermal zones
[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-later 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 #include <dt-bindings/thermal/thermal.h>
15
16 / {
17 model = "Buffalo LinkStation LS421DE";
18 compatible = "buffalo,ls421de", "marvell,armada370", "marvell,armada-370-xp";
19
20 aliases {
21 led-boot = &led_boot;
22 led-failsafe = &led_failsafe;
23 led-running = &led_power;
24 led-upgrade = &led_upgrade;
25 };
26
27 chosen {
28 bootargs = "console=ttyS0,115200 earlyprintk noinitrd rootfstype=squashfs";
29 stdout-path = "serial0:115200n8";
30 append-rootblock = "nullparameter="; /* override the bootloader args */
31 };
32
33 memory {
34 device_type = "memory";
35 reg = <0x00000000 0x20000000>; /* 512 MB */
36 };
37
38 soc {
39 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
40 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
41 MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
42 };
43
44 system_fan: gpio_fan {
45 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
46 &gpio0 14 GPIO_ACTIVE_HIGH>;
47 alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
48
49 #cooling-cells = <2>;
50 };
51
52 thermal-zones {
53 hdd-thermal {
54 polling-delay = <20000>;
55 polling-delay-passive = <2000>;
56
57 thermal-sensors = <&hdd0_temp>; /* only one drivetemp sensor is supported */
58
59 trips {
60 hdd_alert1: trip1 {
61 temperature = <36000>;
62 hysteresis = <2000>;
63 type = "active";
64 };
65 hdd_alert2: trip2 {
66 temperature = <44000>;
67 hysteresis = <2000>;
68 type = "active";
69 };
70 hdd_alert3: trip3 {
71 temperature = <52000>;
72 hysteresis = <2000>;
73 type = "passive";
74 };
75 hdd_crit: trip4 {
76 temperature = <60000>;
77 hysteresis = <2000>;
78 type = "critical";
79 };
80 };
81
82 cooling-maps {
83 map1 {
84 trip = <&hdd_alert1>;
85 cooling-device = <&system_fan THERMAL_NO_LIMIT 1>;
86 };
87 map2 {
88 trip = <&hdd_alert2>;
89 cooling-device = <&system_fan 2 2>;
90 };
91 map3 {
92 trip = <&hdd_alert3>;
93 cooling-device = <&system_fan 3 THERMAL_NO_LIMIT>;
94 };
95 };
96 };
97
98 ethphy-thermal {
99 polling-delay = <20000>;
100 polling-delay-passive = <2000>;
101
102 thermal-sensors = <&ethphy0>;
103
104 trips {
105 ethphy_alert1: trip1 {
106 temperature = <65000>;
107 hysteresis = <4000>;
108 type = "passive";
109 };
110
111 ethphy_crit: trip2 {
112 temperature = <100000>;
113 hysteresis = <2000>;
114 type = "critical";
115 };
116 };
117
118 cooling-maps {
119 map1 {
120 trip = <&ethphy_alert1>;
121 cooling-device = <&system_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
122 };
123
124 };
125 };
126 };
127
128 gpio_keys {
129 compatible = "gpio-keys";
130 #address-cells = <1>;
131 #size-cells = <0>;
132 pinctrl-0 = <&pmx_buttons>;
133 pinctrl-names = "default";
134
135 power {
136 label = "Power Switch";
137 linux,code = <KEY_POWER>;
138 linux,input-type = <EV_SW>;
139 gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
140 };
141
142 function {
143 label = "Function Button";
144 linux,code = <KEY_CONFIG>;
145 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
146 };
147 };
148
149 gpio_leds {
150 compatible = "gpio-leds";
151 pinctrl-names = "default";
152 pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
153
154 system_red {
155 label = "ls421de:red:system";
156 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
157 };
158
159 led_power: power_white {
160 label = "ls421de:white:power";
161 gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
162 default-state = "on";
163 };
164
165 led_failsafe: power_red {
166 label = "ls421de:red:power";
167 gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
168 };
169
170 led_upgrade: power_orange {
171 label = "ls421de:orange:power";
172 gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
173 };
174
175 led_boot: system_white {
176 label = "ls421de:white:system";
177 gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
178 };
179
180 hdd1_red {
181 label = "ls421de:red:hdd1";
182 gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
183 linux,default-trigger = "ata1";
184 };
185
186 hdd2_red {
187 label = "ls421de:red:hdd2";
188 gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
189 linux,default-trigger = "ata2";
190 };
191 };
192
193 regulators {
194 compatible = "simple-bus";
195 #address-cells = <1>;
196 #size-cells = <0>;
197 pinctrl-0 = <&pmx_power_usb &pmx_power_hdd1 &pmx_power_hdd2>;
198 pinctrl-names = "default";
199
200 usb_power: regulator@0 {
201 compatible = "regulator-fixed";
202 reg = <0>;
203 regulator-name = "USB";
204 regulator-min-microvolt = <5000000>;
205 regulator-max-microvolt = <5000000>;
206 enable-active-high;
207 regulator-always-on;
208 regulator-boot-on;
209 gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>;
210 };
211
212 sata1_power: regulator@1 {
213 compatible = "regulator-fixed";
214 reg = <1>;
215 regulator-name = "HDD1";
216 regulator-min-microvolt = <12000000>;
217 regulator-max-microvolt = <12000000>;
218 startup-delay-us = <2000000>;
219 enable-active-high;
220 regulator-always-on;
221 regulator-boot-on;
222 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
223 };
224
225 sata2_power: regulator@2 {
226 compatible = "regulator-fixed";
227 reg = <2>;
228 regulator-name = "HDD2";
229 regulator-min-microvolt = <12000000>;
230 regulator-max-microvolt = <12000000>;
231 startup-delay-us = <4000000>;
232 enable-active-high;
233 regulator-always-on;
234 regulator-boot-on;
235 gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
236 };
237 };
238 };
239
240 &coherencyfab {
241 broken-idle;
242 };
243
244 &eth1 {
245 pinctrl-0 = <&ge1_rgmii_pins>;
246 pinctrl-names = "default";
247 status = "okay";
248 phy-handle = <&ethphy0>;
249 phy-connection-type = "rgmii-id";
250 };
251
252 &i2c0 {
253 pinctrl-0 = <&i2c0_pins>;
254 pinctrl-names = "default";
255 clock-frequency = <100000>;
256 status = "okay";
257
258 rs5c372a: rs5c372a@32 {
259 compatible = "ricoh,rs5c372a";
260 reg = <0x32>;
261 wakeup-source;
262 };
263 };
264
265 &mdio {
266 pinctrl-0 = <&mdio_pins>;
267 pinctrl-names = "default";
268
269 ethphy0: ethernet-phy@0 { /* Marvell 88E1518 */
270 reg = <0>;
271 marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED function */
272 <0x3 0x11 0x1 0x4401>, /* LED polarity */
273 <0x3 0x12 0x1 0x4905>; /* LED timer */
274 #thermal-sensor-cells = <0>;
275 };
276 };
277
278 &pciec {
279 status = "okay";
280 /* Connected to uPD720202 USB 3.0 Host */
281 pcie@1,0 {
282 status = "okay";
283 };
284 };
285
286 &pmsu {
287 pinctrl-0 = <&pmx_power_cpu>;
288 pinctrl-names = "default";
289 };
290
291 &rtc {
292 status = "disabled";
293 };
294
295 &sata {
296 nr-ports = <2>;
297 status = "okay";
298 #address-cells = <1>;
299 #size-cells = <0>;
300
301 hdd0_temp: sata-port@0 {
302 reg = <0>;
303 #thermal-sensor-cells = <0>;
304 };
305
306 hdd1_temp: sata-port@1 {
307 reg = <1>;
308 #thermal-sensor-cells = <0>;
309 };
310 };
311
312 &sdio {
313 pinctrl-0 = <&sdio_pins2>;
314 pinctrl-names = "default";
315 status = "okay";
316 /* No CD or WP GPIOs */
317 broken-cd;
318 };
319
320 &uart0 {
321 status = "okay";
322 };
323
324 &usb0 {
325 status = "okay";
326 };
327
328 &nand_controller {
329 status = "okay";
330
331 nand@0 {
332 reg = <0>;
333 label = "pxa3xx_nand-0";
334 nand-rb = <0>;
335 marvell,nand-keep-config;
336 nand-on-flash-bbt;
337 nand-ecc-strength = <4>;
338 nand-ecc-step-size = <512>;
339
340 partitions {
341 compatible = "fixed-partitions";
342 #address-cells = <1>;
343 #size-cells = <1>;
344
345 partition@0 {
346 label = "kernel";
347 reg = <0x00000000 0x02000000>; /* 32 MiB */
348 };
349
350 partition@2000000 {
351 label = "ubi";
352 reg = <0x02000000 0x1e000000>; /* 480 MiB */
353 };
354 };
355 };
356 };
357
358 &spi0 {
359 status = "okay";
360 pinctrl-0 = <&spi0_pins2>;
361 pinctrl-names = "default";
362
363 spi-flash@0 {
364 #address-cells = <1>;
365 #size-cells = <1>;
366 compatible = "mxicy,mx25l8005", "jedec,spi-nor";
367 reg = <0>; /* Chip select 0 */
368 spi-max-frequency = <50000000>;
369
370 partitions {
371 compatible = "fixed-partitions";
372 #address-cells = <1>;
373 #size-cells = <1>;
374
375 partition@0 {
376 reg = <0x00000 0xf0000>; /* 960 KiB*/
377 label = "u-boot";
378 read-only;
379 };
380 partition@f0000 {
381 reg = <0xf0000 0x10000>; /* 64 KiB */
382 label = "u-boot-env";
383 };
384 };
385 };
386 };
387
388 &pinctrl {
389 pmx_power_cpu: pmx-power-cpu {
390 marvell,pins = "mpp4";
391 marvell,function = "vdd";
392 };
393 pmx_power_usb: pmx-power-usb {
394 marvell,pins = "mpp5";
395 marvell,function = "gpo";
396 };
397 pmx_power_hdd1: pmx-power-hdd1 {
398 marvell,pins = "mpp8";
399 marvell,function = "gpio";
400 };
401 pmx_power_hdd2: pmx-power-hdd2 {
402 marvell,pins = "mpp9";
403 marvell,function = "gpo";
404 };
405 pmx_fan_lock: pmx-fan-lock {
406 marvell,pins = "mpp10";
407 marvell,function = "gpio";
408 };
409 pmx_hdd_present: pmx-hdd-present {
410 marvell,pins = "mpp11", "mpp12";
411 marvell,function = "gpio";
412 };
413 pmx_fan_high: pmx-fan-high {
414 marvell,pins = "mpp13";
415 marvell,function = "gpio";
416 };
417 pmx_fan_low: pmx-fan-low {
418 marvell,pins = "mpp14";
419 marvell,function = "gpio";
420 };
421 pmx_buttons: pmx-buttons {
422 marvell,pins = "mpp15", "mpp16";
423 marvell,function = "gpio";
424 };
425 pmx_leds1: pmx-leds {
426 marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
427 marvell,function = "gpo";
428 };
429 pmx_leds2: pmx-leds {
430 marvell,pins = "mpp55", "mpp57", "mpp62";
431 marvell,function = "gpio";
432 };
433 };