1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4 * Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
5 */
6/dts-v1/;
7
8#include "stm32mp157c.dtsi"
9#include "stm32mp157-pinctrl.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/mfd/st,stpmu1.h>
12
13/ {
14	model = "STMicroelectronics STM32MP157C eval daughter";
15	compatible = "st,stm32mp157c-ed1", "st,stm32mp157";
16
17	chosen {
18		stdout-path = "serial3:115200n8";
19	};
20
21	memory@c0000000 {
22		reg = <0xC0000000 0x40000000>;
23	};
24
25	sd_switch: regulator-sd_switch {
26		compatible = "regulator-gpio";
27		regulator-name = "sd_switch";
28		regulator-min-microvolt = <1800000>;
29		regulator-max-microvolt = <2900000>;
30		regulator-type = "voltage";
31		regulator-always-on;
32
33		gpios = <&gpiof 14 GPIO_ACTIVE_HIGH>;
34		gpios-states = <0>;
35		states = <1800000 0x1 2900000 0x0>;
36	};
37};
38
39&rng1 {
40	status = "okay";
41};
42
43&timers6 {
44	status = "okay";
45	timer@5 {
46		status = "okay";
47	};
48};
49
50&i2c4 {
51	pinctrl-names = "default";
52	pinctrl-0 = <&i2c4_pins_a>;
53	i2c-scl-rising-time-ns = <185>;
54	i2c-scl-falling-time-ns = <20>;
55	status = "okay";
56
57	pmic: stpmu1@33 {
58		compatible = "st,stpmu1";
59		reg = <0x33>;
60		interrupts = <0 2>;
61		interrupt-parent = <&gpioa>;
62		interrupt-controller;
63		#interrupt-cells = <2>;
64		status = "okay";
65
66		st,main_control_register = <0x04>;
67		st,vin_control_register = <0xc0>;
68		st,usb_control_register = <0x30>;
69
70		regulators {
71			compatible = "st,stpmu1-regulators";
72
73			ldo1-supply = <&v3v3>;
74			ldo2-supply = <&v3v3>;
75			ldo3-supply = <&vdd_ddr>;
76			ldo5-supply = <&v3v3>;
77			ldo6-supply = <&v3v3>;
78			pwr_sw1-supply = <&bst_out>;
79			pwr_sw2-supply = <&bst_out>;
80
81			vddcore: buck1 {
82				regulator-name = "vddcore";
83				regulator-min-microvolt = <800000>;
84				regulator-max-microvolt = <1350000>;
85				regulator-always-on;
86				regulator-initial-mode = <2>;
87				regulator-over-current-protection;
88
89				regulator-state-standby {
90					regulator-on-in-suspend;
91					regulator-suspend-microvolt = <1200000>;
92					regulator-mode = <8>;
93				};
94				regulator-state-mem {
95					regulator-off-in-suspend;
96				};
97				regulator-state-disk {
98					regulator-off-in-suspend;
99				};
100			};
101
102			vdd_ddr: buck2 {
103				regulator-name = "vdd_ddr";
104				regulator-min-microvolt = <1350000>;
105				regulator-max-microvolt = <1350000>;
106				regulator-always-on;
107				regulator-initial-mode = <2>;
108				regulator-over-current-protection;
109
110				regulator-state-standby {
111					regulator-suspend-microvolt = <1350000>;
112					regulator-on-in-suspend;
113					regulator-mode = <8>;
114				};
115				regulator-state-mem {
116					regulator-suspend-microvolt = <1350000>;
117					regulator-on-in-suspend;
118					regulator-mode = <8>;
119				};
120				regulator-state-disk {
121					regulator-off-in-suspend;
122				};
123			};
124
125			vdd: buck3 {
126				regulator-name = "vdd";
127				regulator-min-microvolt = <3300000>;
128				regulator-max-microvolt = <3300000>;
129				regulator-always-on;
130				st,mask_reset;
131				regulator-initial-mode = <8>;
132				regulator-over-current-protection;
133
134				regulator-state-standby {
135					regulator-suspend-microvolt = <3300000>;
136					regulator-on-in-suspend;
137					regulator-mode = <8>;
138				};
139				regulator-state-mem {
140					regulator-suspend-microvolt = <3300000>;
141					regulator-on-in-suspend;
142					regulator-mode = <8>;
143				};
144				regulator-state-disk {
145					regulator-suspend-microvolt = <3300000>;
146					regulator-on-in-suspend;
147					regulator-mode = <8>;
148				};
149			};
150
151			v3v3: buck4 {
152				regulator-name = "v3v3";
153				regulator-min-microvolt = <3300000>;
154				regulator-max-microvolt = <3300000>;
155				regulator-boot-on;
156				regulator-over-current-protection;
157				regulator-initial-mode = <8>;
158
159				regulator-state-standby {
160					regulator-suspend-microvolt = <3300000>;
161					regulator-unchanged-in-suspend;
162					regulator-mode = <8>;
163				};
164				regulator-state-mem {
165					regulator-off-in-suspend;
166				};
167				regulator-state-disk {
168					regulator-off-in-suspend;
169				};
170			};
171
172			vdda: ldo1 {
173				regulator-name = "vdda";
174				regulator-min-microvolt = <2900000>;
175				regulator-max-microvolt = <2900000>;
176				interrupts = <IT_CURLIM_LDO1 0>;
177				interrupt-parent = <&pmic>;
178
179				regulator-state-standby {
180					regulator-suspend-microvolt = <2900000>;
181					regulator-unchanged-in-suspend;
182				};
183				regulator-state-mem {
184					regulator-off-in-suspend;
185				};
186				regulator-state-disk {
187					regulator-off-in-suspend;
188				};
189			};
190
191			v2v8: ldo2 {
192				regulator-name = "v2v8";
193				regulator-min-microvolt = <2800000>;
194				regulator-max-microvolt = <2800000>;
195				interrupts = <IT_CURLIM_LDO2 0>;
196				interrupt-parent = <&pmic>;
197
198				regulator-state-standby {
199					regulator-suspend-microvolt = <2800000>;
200					regulator-unchanged-in-suspend;
201				};
202				regulator-state-mem {
203					regulator-off-in-suspend;
204				};
205				regulator-state-disk {
206					regulator-off-in-suspend;
207				};
208			};
209
210			vtt_ddr: ldo3 {
211				regulator-name = "vtt_ddr";
212				regulator-min-microvolt = <0000000>;
213				regulator-max-microvolt = <1000000>;
214				regulator-always-on;
215				regulator-over-current-protection;
216
217				regulator-state-standby {
218					regulator-off-in-suspend;
219				};
220				regulator-state-mem {
221					regulator-off-in-suspend;
222				};
223				regulator-state-disk {
224					regulator-off-in-suspend;
225				};
226			};
227
228			vdd_usb: ldo4 {
229				regulator-name = "vdd_usb";
230				regulator-min-microvolt = <3300000>;
231				regulator-max-microvolt = <3300000>;
232				interrupts = <IT_CURLIM_LDO4 0>;
233				interrupt-parent = <&pmic>;
234
235				regulator-state-standby {
236					regulator-unchanged-in-suspend;
237				};
238				regulator-state-mem {
239					regulator-off-in-suspend;
240				};
241				regulator-state-disk {
242					regulator-off-in-suspend;
243				};
244			};
245
246			vdd_sd: ldo5 {
247				regulator-name = "vdd_sd";
248				regulator-min-microvolt = <2900000>;
249				regulator-max-microvolt = <2900000>;
250				interrupts = <IT_CURLIM_LDO5 0>;
251				interrupt-parent = <&pmic>;
252				regulator-boot-on;
253
254				regulator-state-standby {
255					regulator-suspend-microvolt = <2900000>;
256					regulator-unchanged-in-suspend;
257				};
258				regulator-state-mem {
259					regulator-off-in-suspend;
260				};
261				regulator-state-disk {
262					regulator-off-in-suspend;
263				};
264			};
265
266			v1v8: ldo6 {
267				regulator-name = "v1v8";
268				regulator-min-microvolt = <1800000>;
269				regulator-max-microvolt = <1800000>;
270				interrupts = <IT_CURLIM_LDO6 0>;
271				interrupt-parent = <&pmic>;
272
273				regulator-state-standby {
274					regulator-suspend-microvolt = <1800000>;
275					regulator-unchanged-in-suspend;
276				};
277				regulator-state-mem {
278					regulator-off-in-suspend;
279				};
280				regulator-state-disk {
281					regulator-off-in-suspend;
282				};
283			};
284
285			vref_ddr: vref_ddr {
286				regulator-name = "vref_ddr";
287				regulator-always-on;
288				regulator-over-current-protection;
289
290				regulator-state-standby {
291					regulator-on-in-suspend;
292				};
293				regulator-state-mem {
294					regulator-on-in-suspend;
295				};
296				regulator-state-disk {
297					regulator-off-in-suspend;
298				};
299			};
300
301			 bst_out: boost {
302				regulator-name = "bst_out";
303				interrupts = <IT_OCP_BOOST 0>;
304				interrupt-parent = <&pmic>;
305			 };
306
307			vbus_otg: pwr_sw1 {
308				regulator-name = "vbus_otg";
309				interrupts = <IT_OCP_OTG 0>;
310				interrupt-parent = <&pmic>;
311				regulator-active-discharge;
312			 };
313
314			 vbus_sw: pwr_sw2 {
315				regulator-name = "vbus_sw";
316				interrupts = <IT_OCP_SWOUT 0>;
317				interrupt-parent = <&pmic>;
318				regulator-active-discharge;
319			 };
320		};
321	};
322};
323
324&pwr {
325	pwr-supply = <&vdd>;
326};
327
328&sdmmc1 {
329	pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
330	broken-cd;
331	st,dirpol;
332	st,negedge;
333	st,pin-ckin;
334	bus-width = <4>;
335	vmmc-supply = <&vdd_sd>;
336	vqmmc-supply = <&sd_switch>;
337	sd-uhs-sdr12;
338	sd-uhs-sdr25;
339	sd-uhs-sdr50;
340	sd-uhs-ddr50;
341	sd-uhs-sdr104;
342	status = "okay";
343};
344
345&sdmmc2 {
346	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
347	non-removable;
348	no-sd;
349	no-sdio;
350	st,dirpol;
351	st,negedge;
352	bus-width = <8>;
353	vmmc-supply = <&v3v3>;
354	vqmmc-supply = <&vdd>;
355	status = "okay";
356};
357
358&uart4 {
359	pinctrl-names = "default";
360	pinctrl-0 = <&uart4_pins_a>;
361	status = "okay";
362};
363
364&usbphyc_port0 {
365	phy-supply = <&vdd_usb>;
366	vdda1v1-supply = <&reg11>;
367	vdda1v8-supply = <&reg18>;
368};
369
370&usbphyc_port1 {
371	phy-supply = <&vdd_usb>;
372	vdda1v1-supply = <&reg11>;
373	vdda1v8-supply = <&reg18>;
374};
375