mvebu: 6.6: copy files, patches & configs from 6.1
[openwrt/openwrt.git] / target / linux / mvebu / files-6.6 / 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 function = LED_FUNCTION_POWER;
138 color = <LED_COLOR_ID_WHITE>;
139 gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
140 default-state = "on";
141 };
142
143 led_failsafe: power_red {
144 function = LED_FUNCTION_POWER;
145 color = <LED_COLOR_ID_RED>;
146 gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
147 };
148
149 led_upgrade: power_orange {
150 function = LED_FUNCTION_POWER;
151 color = <LED_COLOR_ID_AMBER>;
152 gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
153 };
154
155 led_boot: indicator_white {
156 function = LED_FUNCTION_INDICATOR;
157 color = <LED_COLOR_ID_WHITE>;
158 gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
159 };
160
161 hdd1_red {
162 function = LED_FUNCTION_DISK;
163 color = <LED_COLOR_ID_RED>;
164 gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
165 linux,default-trigger = "ata1";
166 function-enumerator = <1>;
167 };
168
169 hdd2_red {
170 function = LED_FUNCTION_DISK;
171 color = <LED_COLOR_ID_RED>;
172 gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
173 linux,default-trigger = "ata2";
174 function-enumerator = <2>;
175 };
176 };
177
178 regulators {
179 compatible = "simple-bus";
180 #address-cells = <1>;
181 #size-cells = <0>;
182 pinctrl-0 = <&pmx_power_hdd1 &pmx_power_hdd2>;
183 pinctrl-names = "default";
184
185 sata1_power: regulator@1 {
186 compatible = "regulator-fixed";
187 reg = <1>;
188 regulator-name = "HDD1";
189 regulator-min-microvolt = <12000000>;
190 regulator-max-microvolt = <12000000>;
191 startup-delay-us = <2000000>;
192 enable-active-high;
193 regulator-always-on;
194 regulator-boot-on;
195 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
196 };
197
198 sata2_power: regulator@2 {
199 compatible = "regulator-fixed";
200 reg = <2>;
201 regulator-name = "HDD2";
202 regulator-min-microvolt = <12000000>;
203 regulator-max-microvolt = <12000000>;
204 startup-delay-us = <4000000>;
205 enable-active-high;
206 regulator-always-on;
207 regulator-boot-on;
208 gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
209 };
210 };
211 };
212
213 &coherencyfab {
214 broken-idle;
215 };
216
217 &eth1 {
218 pinctrl-0 = <&ge1_rgmii_pins>;
219 pinctrl-names = "default";
220 status = "okay";
221 phy-handle = <&ethphy0>;
222 phy-connection-type = "rgmii-id";
223 };
224
225 &mdio {
226 pinctrl-0 = <&mdio_pins>;
227 pinctrl-names = "default";
228
229 ethphy0: ethernet-phy@0 { /* Marvell 88E1318 */
230 reg = <0>;
231 marvell,reg-init = <0x3 0x10 0xf000 0x091A>, /* LED function */
232 <0x3 0x11 0x0000 0x4401>, /* LED polarity */
233 <0x3 0x12 0x0000 0x4905>; /* LED timer */
234 #thermal-sensor-cells = <0>;
235 };
236 };
237
238 &nand_controller {
239 status = "okay";
240
241 nand@0 {
242 reg = <0>;
243 label = "pxa3xx_nand-0";
244 nand-rb = <0>;
245 marvell,nand-keep-config;
246 nand-on-flash-bbt;
247 nand-ecc-strength = <4>;
248 nand-ecc-step-size = <512>;
249
250 partitions {
251 compatible = "fixed-partitions";
252 #address-cells = <1>;
253 #size-cells = <1>;
254
255 partition@0 {
256 label = "ubi_kernel";
257 reg = <0x00000000 0x02000000>; /* 32 MiB */
258 };
259
260 partition@2000000 {
261 label = "ubi";
262 reg = <0x02000000 0x1df00000>; /* 479 MiB */
263 };
264 };
265 };
266 };
267
268 &sata {
269 nr-ports = <2>;
270 status = "okay";
271 #address-cells = <1>;
272 #size-cells = <0>;
273
274 hdd0_temp: sata-port@0 {
275 reg = <0>;
276 #thermal-sensor-cells = <0>;
277 };
278
279 hdd1_temp: sata-port@1 {
280 reg = <1>;
281 #thermal-sensor-cells = <0>;
282 };
283 };
284
285 &spi0 {
286 status = "okay";
287 pinctrl-0 = <&spi0_pins2>;
288 pinctrl-names = "default";
289
290 spi-flash@0 {
291 compatible = "mxicy,mx25l8005", "jedec,spi-nor";
292 reg = <0>;
293 spi-max-frequency = <50000000>;
294
295 partitions {
296 compatible = "fixed-partitions";
297 #address-cells = <1>;
298 #size-cells = <1>;
299
300 partition@0 {
301 reg = <0x00000 0xf0000>; /* 960 KiB*/
302 label = "u-boot";
303 read-only;
304 };
305 partition@f0000 {
306 reg = <0xf0000 0x10000>; /* 64 KiB */
307 label = "u-boot-env";
308 };
309 };
310 };
311 };
312
313 &pmsu {
314 pinctrl-0 = <&pmx_power_cpu>;
315 pinctrl-names = "default";
316 };
317
318 &uart0 {
319 status = "okay";
320 };
321
322 &usb0 {
323 status = "okay";
324 };
325
326 &pinctrl {
327 pmx_power_hdd2: pmx-power-hdd2 {
328 marvell,pins = "mpp2";
329 marvell,function = "gpio";
330 };
331
332 pmx_power_cpu: pmx-power-cpu {
333 marvell,pins = "mpp4";
334 marvell,function = "vdd";
335 };
336
337 pmx_power_hdd1: pmx-power-hdd1 {
338 marvell,pins = "mpp8";
339 marvell,function = "gpio";
340 };
341
342 pmx_fan_lock: pmx-fan-lock {
343 marvell,pins = "mpp10";
344 marvell,function = "gpio";
345 };
346
347 pmx_hdd_present: pmx-hdd-present {
348 marvell,pins = "mpp11", "mpp12";
349 marvell,function = "gpio";
350 };
351
352 pmx_fan_high: pmx-fan-high {
353 marvell,pins = "mpp13";
354 marvell,function = "gpio";
355 };
356
357 pmx_fan_low: pmx-fan-low {
358 marvell,pins = "mpp14";
359 marvell,function = "gpio";
360 };
361
362 pmx_buttons: pmx-buttons {
363 marvell,pins = "mpp15", "mpp16";
364 marvell,function = "gpio";
365 };
366
367 pmx_leds1: pmx-leds {
368 marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
369 marvell,function = "gpo";
370 };
371
372 pmx_leds2: pmx-leds {
373 marvell,pins = "mpp55", "mpp57", "mpp62";
374 marvell,function = "gpio";
375 };
376 };