1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) 2019 Marek Vasut <marex@denx.de>
4 */
5/dts-v1/;
6
7#include "stm32mp157.dtsi"
8#include "stm32mp15xc.dtsi"
9#include "stm32mp15-pinctrl.dtsi"
10#include "stm32mp15xxaa-pinctrl.dtsi"
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/mfd/st,stpmic1.h>
13
14/ {
15	aliases {
16		eeprom0 = &eeprom0;
17		ethernet0 = &ethernet0;
18	};
19
20	memory@c0000000 {
21		device_type = "memory";
22		reg = <0xC0000000 0x40000000>;
23	};
24
25	ethernet_vio: vioregulator {
26		compatible = "regulator-fixed";
27		regulator-name = "vio";
28		regulator-min-microvolt = <3300000>;
29		regulator-max-microvolt = <3300000>;
30		gpio = <&gpiog 3 GPIO_ACTIVE_LOW>;
31		regulator-always-on;
32		regulator-boot-on;
33	};
34};
35
36&cec {
37	pinctrl-names = "default";
38	pinctrl-0 = <&cec_pins_a>;
39	status = "okay";
40};
41
42&dcmi {
43	status = "okay";
44	pinctrl-names = "default", "sleep";
45	pinctrl-0 = <&dcmi_pins_a>;
46	pinctrl-1 = <&dcmi_sleep_pins_a>;
47};
48
49&dts {
50	status = "okay";
51};
52
53&ethernet0 {
54	status = "okay";
55	pinctrl-0 = <&ethernet0_rmii_pins_a>;
56	pinctrl-1 = <&ethernet0_rmii_pins_sleep_a>;
57	pinctrl-names = "default", "sleep";
58	phy-mode = "rmii";
59	max-speed = <100>;
60	phy-handle = <&phy0>;
61	phy-reset-gpios = <&gpioh 15 GPIO_ACTIVE_LOW>;
62
63	mdio0 {
64		#address-cells = <1>;
65		#size-cells = <0>;
66		compatible = "snps,dwmac-mdio";
67
68		phy0: ethernet-phy@1 {
69			reg = <1>;
70		};
71	};
72};
73
74&i2c2 {
75	pinctrl-names = "default";
76	pinctrl-0 = <&i2c2_pins_a>;
77	i2c-scl-rising-time-ns = <185>;
78	i2c-scl-falling-time-ns = <20>;
79	status = "okay";
80};
81
82&i2c4 {
83	pinctrl-names = "default";
84	pinctrl-0 = <&i2c4_pins_a>;
85	i2c-scl-rising-time-ns = <185>;
86	i2c-scl-falling-time-ns = <20>;
87	status = "okay";
88	/* spare dmas for other usage */
89	/delete-property/dmas;
90	/delete-property/dma-names;
91
92	pmic: stpmic@33 {
93		compatible = "st,stpmic1";
94		reg = <0x33>;
95		interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
96		interrupt-controller;
97		#interrupt-cells = <2>;
98		status = "okay";
99
100		regulators {
101			compatible = "st,stpmic1-regulators";
102			ldo1-supply = <&v3v3>;
103			ldo2-supply = <&v3v3>;
104			ldo3-supply = <&vdd_ddr>;
105			ldo5-supply = <&v3v3>;
106			ldo6-supply = <&v3v3>;
107			pwr_sw1-supply = <&bst_out>;
108			pwr_sw2-supply = <&bst_out>;
109
110			vddcore: buck1 {
111				regulator-name = "vddcore";
112				regulator-min-microvolt = <800000>;
113				regulator-max-microvolt = <1350000>;
114				regulator-always-on;
115				regulator-initial-mode = <0>;
116				regulator-over-current-protection;
117			};
118
119			vdd_ddr: buck2 {
120				regulator-name = "vdd_ddr";
121				regulator-min-microvolt = <1350000>;
122				regulator-max-microvolt = <1350000>;
123				regulator-always-on;
124				regulator-initial-mode = <0>;
125				regulator-over-current-protection;
126			};
127
128			vdd: buck3 {
129				regulator-name = "vdd";
130				regulator-min-microvolt = <3300000>;
131				regulator-max-microvolt = <3300000>;
132				regulator-always-on;
133				st,mask-reset;
134				regulator-initial-mode = <0>;
135				regulator-over-current-protection;
136			};
137
138			v3v3: buck4 {
139				regulator-name = "v3v3";
140				regulator-min-microvolt = <3300000>;
141				regulator-max-microvolt = <3300000>;
142				regulator-always-on;
143				regulator-over-current-protection;
144				regulator-initial-mode = <0>;
145			};
146
147			vdda: ldo1 {
148				regulator-name = "vdda";
149				regulator-min-microvolt = <2900000>;
150				regulator-max-microvolt = <2900000>;
151				interrupts = <IT_CURLIM_LDO1 0>;
152			};
153
154			v2v8: ldo2 {
155				regulator-name = "v2v8";
156				regulator-min-microvolt = <2800000>;
157				regulator-max-microvolt = <2800000>;
158				interrupts = <IT_CURLIM_LDO2 0>;
159			};
160
161			vtt_ddr: ldo3 {
162				regulator-name = "vtt_ddr";
163				regulator-min-microvolt = <500000>;
164				regulator-max-microvolt = <750000>;
165				regulator-always-on;
166				regulator-over-current-protection;
167			};
168
169			vdd_usb: ldo4 {
170				regulator-name = "vdd_usb";
171				regulator-min-microvolt = <3300000>;
172				regulator-max-microvolt = <3300000>;
173				interrupts = <IT_CURLIM_LDO4 0>;
174			};
175
176			vdd_sd: ldo5 {
177				regulator-name = "vdd_sd";
178				regulator-min-microvolt = <2900000>;
179				regulator-max-microvolt = <2900000>;
180				interrupts = <IT_CURLIM_LDO5 0>;
181				regulator-boot-on;
182			};
183
184			v1v8: ldo6 {
185				regulator-name = "v1v8";
186				regulator-min-microvolt = <1800000>;
187				regulator-max-microvolt = <1800000>;
188				interrupts = <IT_CURLIM_LDO6 0>;
189			};
190
191			vref_ddr: vref_ddr {
192				regulator-name = "vref_ddr";
193				regulator-always-on;
194				regulator-over-current-protection;
195			};
196
197			 bst_out: boost {
198				regulator-name = "bst_out";
199				interrupts = <IT_OCP_BOOST 0>;
200			 };
201
202			vbus_otg: pwr_sw1 {
203				regulator-name = "vbus_otg";
204				interrupts = <IT_OCP_OTG 0>;
205			 };
206
207			 vbus_sw: pwr_sw2 {
208				regulator-name = "vbus_sw";
209				interrupts = <IT_OCP_SWOUT 0>;
210				regulator-active-discharge;
211			 };
212		};
213
214		onkey {
215			compatible = "st,stpmic1-onkey";
216			interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
217			interrupt-names = "onkey-falling", "onkey-rising";
218			power-off-time-sec = <10>;
219			status = "okay";
220		};
221
222		watchdog {
223			compatible = "st,stpmic1-wdt";
224			status = "disabled";
225		};
226	};
227
228	eeprom0: eeprom@50 {
229		compatible = "atmel,24c02";
230		reg = <0x50>;
231		pagesize = <16>;
232	};
233};
234
235&i2c5 {
236	pinctrl-names = "default";
237	pinctrl-0 = <&i2c5_pins_a>;
238	i2c-scl-rising-time-ns = <185>;
239	i2c-scl-falling-time-ns = <20>;
240	status = "okay";
241};
242
243&ipcc {
244	status = "okay";
245};
246
247&iwdg2 {
248	timeout-sec = <32>;
249	status = "okay";
250};
251
252&m4_rproc {
253	mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
254	mbox-names = "vq0", "vq1", "shutdown";
255	status = "okay";
256};
257
258&pwr_regulators {
259	vdd-supply = <&vdd>;
260	vdd_3v3_usbfs-supply = <&vdd_usb>;
261};
262
263&pinctrl {
264	ethernet0_rmii_pins_a: rmii-0 {
265		pins1 {
266			pinmux = <STM32_PINMUX('G', 13, AF11)>, /* ETH1_RMII_TXD0 */
267				 <STM32_PINMUX('G', 14, AF11)>, /* ETH1_RMII_TXD1 */
268				 <STM32_PINMUX('B', 11, AF11)>, /* ETH1_RMII_TX_EN */
269				 <STM32_PINMUX('A', 1, AF11)>,  /* ETH1_RMII_REF_CLK */
270				 <STM32_PINMUX('A', 2, AF11)>,  /* ETH1_MDIO */
271				 <STM32_PINMUX('C', 1, AF11)>;  /* ETH1_MDC */
272			bias-disable;
273			drive-push-pull;
274			slew-rate = <2>;
275		};
276		pins2 {
277			pinmux = <STM32_PINMUX('C', 4, AF11)>,  /* ETH1_RMII_RXD0 */
278				 <STM32_PINMUX('C', 5, AF11)>,  /* ETH1_RMII_RXD1 */
279				 <STM32_PINMUX('A', 7, AF11)>;  /* ETH1_RMII_CRS_DV */
280			bias-disable;
281		};
282	};
283
284	ethernet0_rmii_pins_sleep_a: rmii-sleep-0 {
285		pins1 {
286			pinmux = <STM32_PINMUX('G', 13, ANALOG)>, /* ETH1_RMII_TXD0 */
287				 <STM32_PINMUX('G', 14, ANALOG)>, /* ETH1_RMII_TXD1 */
288				 <STM32_PINMUX('B', 11, ANALOG)>, /* ETH1_RMII_TX_EN */
289				 <STM32_PINMUX('A', 2, ANALOG)>,  /* ETH1_MDIO */
290				 <STM32_PINMUX('C', 1, ANALOG)>,  /* ETH1_MDC */
291				 <STM32_PINMUX('C', 4, ANALOG)>,  /* ETH1_RMII_RXD0 */
292				 <STM32_PINMUX('C', 5, ANALOG)>,  /* ETH1_RMII_RXD1 */
293				 <STM32_PINMUX('A', 1, ANALOG)>,  /* ETH1_RMII_REF_CLK */
294				 <STM32_PINMUX('A', 7, ANALOG)>;  /* ETH1_RMII_CRS_DV */
295		};
296	};
297};
298
299&qspi {
300	pinctrl-names = "default", "sleep";
301	pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>;
302	pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>;
303	reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
304	#address-cells = <1>;
305	#size-cells = <0>;
306	status = "okay";
307
308	flash0: mx66l51235l@0 {
309		compatible = "jedec,spi-nor";
310		reg = <0>;
311		spi-rx-bus-width = <4>;
312		spi-max-frequency = <108000000>;
313		#address-cells = <1>;
314		#size-cells = <1>;
315	};
316};
317
318&rng1 {
319	status = "okay";
320};
321
322&rtc {
323	status = "okay";
324};
325
326&sdmmc1 {
327	pinctrl-names = "default", "opendrain", "sleep";
328	pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
329	pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
330	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
331	cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
332	disable-wp;
333	st,sig-dir;
334	st,neg-edge;
335	bus-width = <4>;
336	vmmc-supply = <&vdd_sd>;
337	status = "okay";
338};
339
340&sdmmc1_b4_pins_a {
341	/*
342	 * SD bus pull-up resistors:
343	 * - optional on SoMs with SD voltage translator
344	 * - mandatory on SoMs without SD voltage translator
345	 */
346	pins1 {
347		bias-pull-up;
348	};
349	pins2 {
350		bias-pull-up;
351	};
352};
353
354&sdmmc2 {
355	pinctrl-names = "default";
356	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
357	non-removable;
358	no-sd;
359	no-sdio;
360	st,sig-dir;
361	st,neg-edge;
362	bus-width = <8>;
363	vmmc-supply = <&v3v3>;
364	status = "okay";
365};
366
367&spi1 {
368	pinctrl-names = "default";
369	pinctrl-0 = <&spi1_pins_a>;
370	status = "disabled";
371};
372
373&timers2 {
374	/* spare dmas for other usage (un-delete to enable pwm capture) */
375	/delete-property/dmas;
376	/delete-property/dma-names;
377	status = "disabled";
378	pwm {
379		pinctrl-0 = <&pwm2_pins_a>;
380		pinctrl-names = "default";
381		status = "okay";
382	};
383	timer@1 {
384		status = "okay";
385	};
386};
387
388&timers6 {
389	status = "okay";
390	/* spare dmas for other usage */
391	/delete-property/dmas;
392	/delete-property/dma-names;
393	timer@5 {
394		status = "okay";
395	};
396};
397
398&timers8 {
399	/delete-property/dmas;
400	/delete-property/dma-names;
401	status = "disabled";
402	pwm {
403		pinctrl-0 = <&pwm8_pins_a>;
404		pinctrl-names = "default";
405		status = "okay";
406	};
407	timer@7 {
408		status = "okay";
409	};
410};
411
412&timers12 {
413	/delete-property/dmas;
414	/delete-property/dma-names;
415	status = "disabled";
416	pwm {
417		pinctrl-0 = <&pwm12_pins_a>;
418		pinctrl-names = "default";
419		status = "okay";
420	};
421	timer@11 {
422		status = "okay";
423	};
424};
425
426&uart4 {
427	pinctrl-names = "default";
428	pinctrl-0 = <&uart4_pins_a>;
429	status = "okay";
430};
431
432&usbh_ehci {
433	phys = <&usbphyc_port0>;
434	phy-names = "usb";
435	status = "okay";
436};
437
438&usbotg_hs {
439	dr_mode = "peripheral";
440	phys = <&usbphyc_port1 0>;
441	phy-names = "usb2-phy";
442	vbus-supply = <&vbus_otg>;
443	status = "okay";
444};
445
446&usbphyc {
447	status = "okay";
448};
449
450&usbphyc_port0 {
451	phy-supply = <&vdd_usb>;
452};
453
454&usbphyc_port1 {
455	phy-supply = <&vdd_usb>;
456};
457