sunxi: move KERNEL_LOADADDR into subtargets
[openwrt/openwrt.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 #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 chassis-thermal {
54 polling-delay = <20000>;
55 polling-delay-passive = <2000>;
56
57 thermal-sensors = <&hdd0_temp>, <&hdd1_temp>;
58 coefficients = <1 1>;
59
60 trips {
61 chassis_alert1: chassis-alert1 {
62 temperature = <36000>;
63 hysteresis = <2000>;
64 type = "active";
65 };
66 chassis_alert2: chassis-alert2 {
67 temperature = <46000>;
68 hysteresis = <2000>;
69 type = "active";
70 };
71 chassis_alert3: chassis-alert3 {
72 temperature = <56000>;
73 hysteresis = <2000>;
74 type = "passive";
75 };
76 chassis_crit: chassis-crit {
77 temperature = <66000>;
78 hysteresis = <2000>;
79 type = "critical";
80 };
81 };
82
83 cooling-maps {
84 map1 {
85 trip = <&chassis_alert1>;
86 cooling-device = <&system_fan THERMAL_NO_LIMIT 1>;
87 };
88 map2 {
89 trip = <&chassis_alert2>;
90 cooling-device = <&system_fan 2 2>;
91 };
92 map3 {
93 trip = <&chassis_alert3>;
94 cooling-device = <&system_fan 3 THERMAL_NO_LIMIT>;
95 };
96 };
97 };
98 };
99
100 gpio_keys {
101 compatible = "gpio-keys";
102 #address-cells = <1>;
103 #size-cells = <0>;
104 pinctrl-0 = <&pmx_buttons>;
105 pinctrl-names = "default";
106
107 power {
108 label = "Power Switch";
109 linux,code = <KEY_POWER>;
110 linux,input-type = <EV_SW>;
111 gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
112 };
113
114 function {
115 label = "Function Button";
116 linux,code = <KEY_CONFIG>;
117 gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
118 };
119 };
120
121 gpio_leds {
122 compatible = "gpio-leds";
123 pinctrl-names = "default";
124 pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
125
126 system_red {
127 label = "ls421de:red:system";
128 gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
129 };
130
131 led_power: power_white {
132 label = "ls421de:white:power";
133 gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
134 default-state = "on";
135 };
136
137 led_failsafe: power_red {
138 label = "ls421de:red:power";
139 gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
140 };
141
142 led_upgrade: power_orange {
143 label = "ls421de:orange:power";
144 gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
145 };
146
147 led_boot: system_white {
148 label = "ls421de:white:system";
149 gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
150 };
151
152 hdd1_red {
153 label = "ls421de:red:hdd1";
154 gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
155 default-state = "off";
156 linux,default-trigger = "disk-activity";
157 };
158
159 hdd2_red {
160 label = "ls421de:red:hdd2";
161 gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
162 default-state = "off";
163 linux,default-trigger = "disk-activity";
164 };
165 };
166
167 regulators {
168 compatible = "simple-bus";
169 #address-cells = <1>;
170 #size-cells = <0>;
171 pinctrl-0 = <&pmx_power_usb &pmx_power_hdd1 &pmx_power_hdd2>;
172 pinctrl-names = "default";
173
174 usb_power: regulator@0 {
175 compatible = "regulator-fixed";
176 reg = <0>;
177 regulator-name = "USB";
178 regulator-min-microvolt = <5000000>;
179 regulator-max-microvolt = <5000000>;
180 enable-active-high;
181 regulator-always-on;
182 regulator-boot-on;
183 gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>;
184 };
185
186 sata1_power: regulator@1 {
187 compatible = "regulator-fixed";
188 reg = <1>;
189 regulator-name = "HDD1";
190 regulator-min-microvolt = <12000000>;
191 regulator-max-microvolt = <12000000>;
192 startup-delay-us = <2000000>;
193 enable-active-high;
194 regulator-always-on;
195 regulator-boot-on;
196 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
197 };
198
199 sata2_power: regulator@2 {
200 compatible = "regulator-fixed";
201 reg = <2>;
202 regulator-name = "HDD2";
203 regulator-min-microvolt = <12000000>;
204 regulator-max-microvolt = <12000000>;
205 startup-delay-us = <4000000>;
206 enable-active-high;
207 regulator-always-on;
208 regulator-boot-on;
209 gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
210 };
211 };
212
213 /* FIXME: this driver needs to be aware of the LED2 eth phy use,
214 which must be set to off state before shutting down the machine */
215 restart_poweroff {
216 compatible = "restart-poweroff";
217 };
218 };
219
220 &eth1 {
221 pinctrl-0 = <&ge1_rgmii_pins>;
222 pinctrl-names = "default";
223 status = "okay";
224 phy-handle = <&ethphy0>;
225 phy-connection-type = "rgmii-id";
226 };
227
228 &i2c0 {
229 pinctrl-0 = <&i2c0_pins>;
230 pinctrl-names = "default";
231 clock-frequency = <100000>;
232 status = "okay";
233
234 rs5c372a: rs5c372a@32 {
235 compatible = "ricoh,rs5c372a";
236 reg = <0x32>;
237 };
238 };
239
240 &mdio {
241 pinctrl-0 = <&mdio_pins>;
242 pinctrl-names = "default";
243
244 ethphy0: ethernet-phy@0 { /* Marvell 88E1518 */
245 reg = <0>;
246 /*
247 * LED2 is used to inform, at restart time, if the power
248 * switch was slided to the "off" position.
249 * Page 0x3, Register 0x10, bits 8-11:
250 * 0x800: LED2 off, power off the machine
251 * 0x900: LED2 on, boot the machine
252 */
253 marvell,reg-init = <0x3 0x10 0x1 0x1991>, /* LED function */
254 <0x3 0x11 0x1 0x4401>, /* LED polarity */
255 <0x3 0x12 0x1 0x4905>; /* LED timer */
256 };
257 };
258
259 &pciec {
260 status = "okay";
261 /* Connected to uPD720202 USB 3.0 Host */
262 pcie@1,0 {
263 status = "okay";
264 };
265 };
266
267 &pmsu {
268 pinctrl-0 = <&pmx_power_cpu>;
269 pinctrl-names = "default";
270 };
271
272 &rtc {
273 status = "disabled";
274 };
275
276 &sata {
277 nr-ports = <2>;
278 status = "okay";
279 #address-cells = <1>;
280 #size-cells = <0>;
281
282 hdd0_temp: sata-port@0 {
283 reg = <0>;
284 #thermal-sensor-cells = <0>;
285 };
286
287 hdd1_temp: sata-port@1 {
288 reg = <1>;
289 #thermal-sensor-cells = <0>;
290 };
291 };
292
293 &sdio {
294 pinctrl-0 = <&sdio_pins2>;
295 pinctrl-names = "default";
296 status = "okay";
297 /* No CD or WP GPIOs */
298 broken-cd;
299 };
300
301 &uart0 {
302 status = "okay";
303 };
304
305 &usb0 {
306 status = "okay";
307 };
308
309 &nand_controller {
310 status = "okay";
311
312 nand@0 {
313 reg = <0>;
314 label = "pxa3xx_nand-0";
315 nand-rb = <0>;
316 marvell,nand-keep-config;
317 nand-on-flash-bbt;
318 nand-ecc-strength = <4>;
319 nand-ecc-step-size = <512>;
320
321 partitions {
322 compatible = "fixed-partitions";
323 #address-cells = <1>;
324 #size-cells = <1>;
325
326 partition@0 {
327 label = "kernel";
328 reg = <0x00000000 0x02000000>; /* 32 MiB */
329 };
330
331 partition@2000000 {
332 label = "ubi";
333 reg = <0x02000000 0x1e000000>; /* 480 MiB */
334 };
335 };
336 };
337 };
338
339 &spi0 {
340 status = "okay";
341 pinctrl-0 = <&spi0_pins2>;
342 pinctrl-names = "default";
343
344 spi-flash@0 {
345 #address-cells = <1>;
346 #size-cells = <1>;
347 compatible = "mxicy,mx25l8005", "jedec,spi-nor";
348 reg = <0>; /* Chip select 0 */
349 spi-max-frequency = <50000000>;
350
351 partitions {
352 compatible = "fixed-partitions";
353 #address-cells = <1>;
354 #size-cells = <1>;
355
356 partition@0 {
357 reg = <0x00000 0xf0000>; /* 960 KiB*/
358 label = "u-boot";
359 read-only;
360 };
361 partition@f0000 {
362 reg = <0xf0000 0x10000>; /* 64 KiB */
363 label = "u-boot-env";
364 };
365 };
366 };
367 };
368
369 &pinctrl {
370 pmx_power_cpu: pmx-power-cpu {
371 marvell,pins = "mpp4";
372 marvell,function = "vdd";
373 };
374 pmx_power_usb: pmx-power-usb {
375 marvell,pins = "mpp5";
376 marvell,function = "gpo";
377 };
378 pmx_power_hdd1: pmx-power-hdd1 {
379 marvell,pins = "mpp8";
380 marvell,function = "gpio";
381 };
382 pmx_power_hdd2: pmx-power-hdd2 {
383 marvell,pins = "mpp9";
384 marvell,function = "gpo";
385 };
386 pmx_fan_lock: pmx-fan-lock {
387 marvell,pins = "mpp10";
388 marvell,function = "gpio";
389 };
390 pmx_hdd_present: pmx-hdd-present {
391 marvell,pins = "mpp11", "mpp12";
392 marvell,function = "gpio";
393 };
394 pmx_fan_high: pmx-fan-high {
395 marvell,pins = "mpp13";
396 marvell,function = "gpio";
397 };
398 pmx_fan_low: pmx-fan-low {
399 marvell,pins = "mpp14";
400 marvell,function = "gpio";
401 };
402 pmx_buttons: pmx-buttons {
403 marvell,pins = "mpp15", "mpp16";
404 marvell,function = "gpio";
405 };
406 pmx_leds1: pmx-leds {
407 marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
408 marvell,function = "gpo";
409 };
410 pmx_leds2: pmx-leds {
411 marvell,pins = "mpp55", "mpp57", "mpp62";
412 marvell,function = "gpio";
413 };
414 };