1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Device Tree file for Helios4
4 * based on SolidRun Clearfog revision A1 rev 2.0 (88F6828)
5 *
6 *  Copyright (C) 2017 Aditya Prayoga <aditya@kobol.io>
7 *
8 */
9
10/dts-v1/;
11#include "armada-388.dtsi"
12#include "armada-38x-solidrun-microsom.dtsi"
13
14/ {
15	model = "Helios4";
16	compatible = "kobol,helios4", "marvell,armada388",
17		"marvell,armada385", "marvell,armada380";
18
19	memory {
20		device_type = "memory";
21		reg = <0x00000000 0x80000000>; /* 2 GB */
22	};
23
24	aliases {
25		/* So that mvebu u-boot can update the MAC address */
26		ethernet1 = &eth0;
27		spi1 = &spi1;
28		i2c0 = &i2c0;
29		i2c1 = &i2c1;
30	};
31
32
33	chosen {
34		stdout-path = "serial0:115200n8";
35	};
36
37	reg_12v: regulator-12v {
38		compatible = "regulator-fixed";
39		regulator-name = "power_brick_12V";
40		regulator-min-microvolt = <12000000>;
41		regulator-max-microvolt = <12000000>;
42		regulator-always-on;
43	};
44
45	reg_3p3v: regulator-3p3v {
46		compatible = "regulator-fixed";
47		regulator-name = "3P3V";
48		regulator-min-microvolt = <3300000>;
49		regulator-max-microvolt = <3300000>;
50		regulator-always-on;
51		vin-supply = <&reg_12v>;
52	};
53
54	reg_5p0v_hdd: regulator-5v-hdd {
55		compatible = "regulator-fixed";
56		regulator-name = "5V_HDD";
57		regulator-min-microvolt = <5000000>;
58		regulator-max-microvolt = <5000000>;
59		regulator-always-on;
60		vin-supply = <&reg_12v>;
61	};
62
63	reg_5p0v_usb: regulator-5v-usb {
64		compatible = "regulator-fixed";
65		regulator-name = "USB-PWR";
66		regulator-min-microvolt = <5000000>;
67		regulator-max-microvolt = <5000000>;
68		regulator-boot-on;
69		regulator-always-on;
70		enable-active-high;
71		gpio = <&expander0 6 GPIO_ACTIVE_HIGH>;
72		vin-supply = <&reg_12v>;
73	};
74
75	system-leds {
76		compatible = "gpio-leds";
77		status-led {
78			label = "helios4:green:status";
79			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
80			linux,default-trigger = "heartbeat";
81			default-state = "on";
82		};
83
84		fault-led {
85			label = "helios4:red:fault";
86			gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
87			default-state = "keep";
88		};
89	};
90
91	io-leds {
92		compatible = "gpio-leds";
93		sata1-led {
94			label = "helios4:green:ata1";
95			gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
96			linux,default-trigger = "ata1";
97			default-state = "off";
98		};
99		sata2-led {
100			label = "helios4:green:ata2";
101			gpios = <&gpio1 18 GPIO_ACTIVE_LOW>;
102			linux,default-trigger = "ata2";
103			default-state = "off";
104		};
105		sata3-led {
106			label = "helios4:green:ata3";
107			gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
108			linux,default-trigger = "ata3";
109			default-state = "off";
110		};
111		sata4-led {
112			label = "helios4:green:ata4";
113			gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
114			linux,default-trigger = "ata4";
115			default-state = "off";
116		};
117		usb-led {
118			label = "helios4:green:usb";
119			gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
120			linux,default-trigger = "usb-host";
121			default-state = "off";
122		};
123	};
124
125	fan1: j10-pwm {
126		compatible = "pwm-fan";
127		pwms = <&gpio1 9 40000>;	/* Target freq:25 kHz */
128	};
129
130	fan2: j17-pwm {
131		compatible = "pwm-fan";
132		pwms = <&gpio1 23 40000>;	/* Target freq:25 kHz */
133	};
134
135	usb2_phy: usb2-phy {
136		compatible = "usb-nop-xceiv";
137		vbus-regulator = <&reg_5p0v_usb>;
138	};
139
140	usb3_phy: usb3-phy {
141		compatible = "usb-nop-xceiv";
142	};
143
144	soc {
145		internal-regs {
146			i2c@11000 {
147				/*
148				 * PCA9655 GPIO expander, up to 1MHz clock.
149				 *  0-Board Revision bit 0 #
150				 *  1-Board Revision bit 1 #
151				 *  5-USB3 overcurrent
152				 *  6-USB3 power
153				 */
154				expander0: gpio-expander@20 {
155					/*
156					 * This is how it should be:
157					 * compatible = "onnn,pca9655",
158					 *	 "nxp,pca9555";
159					 * but you can't do this because of
160					 * the way I2C works.
161					 */
162					compatible = "nxp,pca9555";
163					gpio-controller;
164					#gpio-cells = <2>;
165					reg = <0x20>;
166					pinctrl-names = "default";
167					pinctrl-0 = <&pca0_pins>;
168					interrupt-parent = <&gpio0>;
169					interrupts = <23 IRQ_TYPE_EDGE_FALLING>;
170					interrupt-controller;
171					#interrupt-cells = <2>;
172
173					board_rev_bit_0 {
174						gpio-hog;
175						gpios = <0 GPIO_ACTIVE_LOW>;
176						input;
177						line-name = "board-rev-0";
178					};
179					board_rev_bit_1 {
180						gpio-hog;
181						gpios = <1 GPIO_ACTIVE_LOW>;
182						input;
183						line-name = "board-rev-1";
184					};
185					usb3_ilimit {
186						gpio-hog;
187						gpios = <5 GPIO_ACTIVE_HIGH>;
188						input;
189						line-name = "usb-overcurrent-status";
190					};
191				};
192
193				temp_sensor: temp@4c {
194					compatible = "ti,lm75";
195					reg = <0x4c>;
196					vcc-supply = <&reg_3p3v>;
197				};
198			};
199
200			i2c@11100 {
201				/*
202				 * External I2C Bus for user peripheral
203				 */
204				clock-frequency = <400000>;
205				pinctrl-0 = <&helios_i2c1_pins>;
206				pinctrl-names = "default";
207				status = "okay";
208			};
209
210			sata@a8000 {
211				status = "okay";
212				#address-cells = <1>;
213				#size-cells = <0>;
214
215				sata0: sata-port@0 {
216					reg = <0>;
217				};
218
219				sata1: sata-port@1 {
220					reg = <1>;
221				};
222			};
223
224			sata@e0000 {
225				status = "okay";
226				#address-cells = <1>;
227				#size-cells = <0>;
228
229				sata2: sata-port@0 {
230					reg = <0>;
231				};
232
233				sata3: sata-port@1 {
234					reg = <1>;
235				};
236			};
237
238			spi@10680 {
239				pinctrl-0 = <&spi1_pins
240					     &microsom_spi1_cs_pins>;
241				pinctrl-names = "default";
242				status = "okay";
243			};
244
245			sdhci@d8000 {
246				bus-width = <4>;
247				cd-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
248				no-1-8-v;
249				pinctrl-0 = <&helios_sdhci_pins
250					     &helios_sdhci_cd_pins>;
251				pinctrl-names = "default";
252				status = "okay";
253				vmmc = <&reg_3p3v>;
254				wp-inverted;
255			};
256
257			usb@58000 {
258				usb-phy = <&usb2_phy>;
259				status = "okay";
260			};
261
262			usb3@f0000 {
263				status = "okay";
264			};
265
266			usb3@f8000 {
267				status = "okay";
268			};
269
270			pinctrl@18000 {
271				pca0_pins: pca0-pins {
272					marvell,pins = "mpp23";
273					marvell,function = "gpio";
274				};
275				microsom_phy0_int_pins: microsom-phy0-int-pins {
276					marvell,pins = "mpp18";
277					marvell,function = "gpio";
278				};
279				helios_i2c1_pins: i2c1-pins {
280					marvell,pins = "mpp26", "mpp27";
281					marvell,function = "i2c1";
282				};
283				helios_sdhci_cd_pins: helios-sdhci-cd-pins {
284					marvell,pins = "mpp20";
285					marvell,function = "gpio";
286				};
287				helios_sdhci_pins: helios-sdhci-pins {
288					marvell,pins = "mpp21", "mpp28",
289						       "mpp37", "mpp38",
290						       "mpp39", "mpp40";
291					marvell,function = "sd0";
292				};
293				helios_led_pins: helios-led-pins {
294					marvell,pins = "mpp24", "mpp25",
295						       "mpp49", "mpp50",
296						       "mpp52", "mpp53",
297						       "mpp54";
298					marvell,function = "gpio";
299				};
300				helios_fan_pins: helios-fan-pins {
301					marvell,pins = "mpp41", "mpp43",
302						       "mpp48", "mpp55";
303					marvell,function = "gpio";
304				};
305				microsom_spi1_cs_pins: spi1-cs-pins {
306					marvell,pins = "mpp59";
307					marvell,function = "spi1";
308				};
309			};
310		};
311	};
312};
313
314&w25q32 {
315	status = "okay";
316};
317
318&spi1 {
319	status = "okay";
320};
321