xref: /optee_os/core/arch/arm/dts/stm32mp15xx-dhcom-som.dtsi (revision 234a510d622818c8dce21cd189c805faac10e32d)
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) 2019-2020 Marek Vasut <marex@denx.de>
4 * Copyright (C) 2022 DH electronics GmbH
5 */
6
7#include "stm32mp15-pinctrl.dtsi"
8#include "stm32mp15xxaa-pinctrl.dtsi"
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/mfd/st,stpmic1.h>
11
12/ {
13	aliases {
14		ethernet0 = &ethernet0;
15		ethernet1 = &ksz8851;
16		rtc0 = &hwrtc;
17		rtc1 = &rtc;
18	};
19
20	memory@c0000000 {
21		device_type = "memory";
22		reg = <0xC0000000 0x40000000>;
23	};
24
25	reserved-memory {
26		#address-cells = <1>;
27		#size-cells = <1>;
28		ranges;
29
30		mcuram2: mcuram2@10000000 {
31			compatible = "shared-dma-pool";
32			reg = <0x10000000 0x40000>;
33			no-map;
34		};
35
36		vdev0vring0: vdev0vring0@10040000 {
37			compatible = "shared-dma-pool";
38			reg = <0x10040000 0x1000>;
39			no-map;
40		};
41
42		vdev0vring1: vdev0vring1@10041000 {
43			compatible = "shared-dma-pool";
44			reg = <0x10041000 0x1000>;
45			no-map;
46		};
47
48		vdev0buffer: vdev0buffer@10042000 {
49			compatible = "shared-dma-pool";
50			reg = <0x10042000 0x4000>;
51			no-map;
52		};
53
54		mcuram: mcuram@30000000 {
55			compatible = "shared-dma-pool";
56			reg = <0x30000000 0x40000>;
57			no-map;
58		};
59
60		retram: retram@38000000 {
61			compatible = "shared-dma-pool";
62			reg = <0x38000000 0x10000>;
63			no-map;
64		};
65	};
66
67	ethernet_vio: vioregulator {
68		compatible = "regulator-fixed";
69		regulator-name = "vio";
70		regulator-min-microvolt = <3300000>;
71		regulator-max-microvolt = <3300000>;
72		gpio = <&gpiog 3 GPIO_ACTIVE_LOW>;
73		regulator-always-on;
74		regulator-boot-on;
75		vin-supply = <&vdd>;
76	};
77};
78
79&adc {
80	vdd-supply = <&vdd>;
81	vdda-supply = <&vdda>;
82	vref-supply = <&vdda>;
83	status = "okay";
84
85	adc1: adc@0 {
86		st,min-sample-time-nsecs = <5000>;
87		st,adc-channels = <0>;
88		status = "okay";
89	};
90
91	adc2: adc@100 {
92		st,adc-channels = <1>;
93		st,min-sample-time-nsecs = <5000>;
94		status = "okay";
95	};
96};
97
98&crc1 {
99	status = "okay";
100};
101
102&dac {
103	pinctrl-names = "default";
104	pinctrl-0 = <&dac_ch1_pins_a &dac_ch2_pins_a>;
105	vref-supply = <&vdda>;
106	status = "okay";
107
108	dac1: dac@1 {
109		status = "okay";
110	};
111	dac2: dac@2 {
112		status = "okay";
113	};
114};
115
116&dts {
117	status = "okay";
118};
119
120&ethernet0 {
121	status = "okay";
122	pinctrl-0 = <&ethernet0_rmii_pins_c &mco2_pins_a>;
123	pinctrl-1 = <&ethernet0_rmii_sleep_pins_c &mco2_sleep_pins_a>;
124	pinctrl-names = "default", "sleep";
125	phy-mode = "rmii";
126	max-speed = <100>;
127	phy-handle = <&phy0>;
128
129	mdio0 {
130		#address-cells = <1>;
131		#size-cells = <0>;
132		compatible = "snps,dwmac-mdio";
133
134		phy0: ethernet-phy@1 {
135			reg = <1>;
136			/* LAN8710Ai */
137			compatible = "ethernet-phy-id0007.c0f0",
138				     "ethernet-phy-ieee802.3-c22";
139			clocks = <&rcc CK_MCO2>;
140			reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>;
141			reset-assert-us = <500>;
142			reset-deassert-us = <500>;
143			smsc,disable-energy-detect;
144			interrupt-parent = <&gpioi>;
145			interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
146		};
147	};
148};
149
150&etzpc {
151	st,decprot =
152		<DECPROT(STM32MP1_ETZPC_USART1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
153		<DECPROT(STM32MP1_ETZPC_SPI6_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
154		<DECPROT(STM32MP1_ETZPC_I2C4_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
155		<DECPROT(STM32MP1_ETZPC_I2C6_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
156		<DECPROT(STM32MP1_ETZPC_RNG1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
157		<DECPROT(STM32MP1_ETZPC_HASH1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
158		<DECPROT(STM32MP1_ETZPC_CRYP1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)>,
159		<DECPROT(STM32MP1_ETZPC_DDRCTRL_ID, DECPROT_NS_R_S_W, DECPROT_LOCK)>,
160		<DECPROT(STM32MP1_ETZPC_DDRPHYC_ID, DECPROT_NS_R_S_W, DECPROT_LOCK)>,
161		<DECPROT(STM32MP1_ETZPC_STGENC_ID, DECPROT_S_RW, DECPROT_LOCK)>,
162		<DECPROT(STM32MP1_ETZPC_BKPSRAM_ID, DECPROT_S_RW, DECPROT_LOCK)>,
163		<DECPROT(STM32MP1_ETZPC_IWDG1_ID, DECPROT_NS_RW, DECPROT_LOCK)>;
164};
165
166&fmc {
167	pinctrl-names = "default", "sleep";
168	pinctrl-0 = <&fmc_pins_b>;
169	pinctrl-1 = <&fmc_sleep_pins_b>;
170	status = "okay";
171
172	ksz8851: ethernet@1,0 {
173		compatible = "micrel,ks8851-mll";
174		reg = <1 0x0 0x2>, <1 0x2 0x20000>;
175		interrupt-parent = <&gpioc>;
176		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
177		bank-width = <2>;
178
179		/* Timing values are in nS */
180		st,fmc2-ebi-cs-mux-enable;
181		st,fmc2-ebi-cs-transaction-type = <4>;
182		st,fmc2-ebi-cs-buswidth = <16>;
183		st,fmc2-ebi-cs-address-setup-ns = <5>;
184		st,fmc2-ebi-cs-address-hold-ns = <5>;
185		st,fmc2-ebi-cs-bus-turnaround-ns = <5>;
186		st,fmc2-ebi-cs-data-setup-ns = <45>;
187		st,fmc2-ebi-cs-data-hold-ns = <1>;
188		st,fmc2-ebi-cs-write-address-setup-ns = <5>;
189		st,fmc2-ebi-cs-write-address-hold-ns = <5>;
190		st,fmc2-ebi-cs-write-bus-turnaround-ns = <5>;
191		st,fmc2-ebi-cs-write-data-setup-ns = <45>;
192		st,fmc2-ebi-cs-write-data-hold-ns = <1>;
193	};
194};
195
196&gpioa {
197	gpio-line-names = "", "", "", "",
198			  "", "", "DHCOM-K", "",
199			  "", "", "", "",
200			  "", "", "", "";
201};
202
203&gpiob {
204	gpio-line-names = "", "", "", "",
205			  "", "", "", "",
206			  "DHCOM-Q", "", "", "",
207			  "", "", "", "";
208};
209
210&gpioc {
211	gpio-line-names = "", "", "", "",
212			  "", "", "DHCOM-E", "",
213			  "", "", "", "",
214			  "", "", "", "";
215};
216
217&gpiod {
218	gpio-line-names = "", "", "", "",
219			  "", "", "DHCOM-B", "",
220			  "", "", "", "DHCOM-F",
221			  "DHCOM-D", "", "", "";
222};
223
224&gpioe {
225	gpio-line-names = "", "", "", "",
226			  "", "", "DHCOM-P", "",
227			  "", "", "", "",
228			  "", "", "", "";
229};
230
231&gpiof {
232	gpio-line-names = "", "", "", "DHCOM-A",
233			  "", "", "", "",
234			  "", "", "", "",
235			  "", "", "", "";
236};
237
238&gpiog {
239	gpio-line-names = "DHCOM-C", "", "", "",
240			  "", "", "", "",
241			  "DHCOM-L", "", "", "",
242			  "", "", "", "";
243};
244
245&gpioh {
246	gpio-line-names = "", "", "", "",
247			  "", "", "", "DHCOM-N",
248			  "DHCOM-J", "DHCOM-W", "DHCOM-V", "DHCOM-U",
249			  "DHCOM-T", "", "DHCOM-S", "";
250};
251
252&gpioi {
253	gpio-line-names = "DHCOM-G", "DHCOM-O", "DHCOM-H", "DHCOM-I",
254			  "DHCOM-R", "DHCOM-M", "", "",
255			  "", "", "", "",
256			  "", "", "", "";
257};
258
259&i2c4 {
260	compatible = "st,stm32mp15-i2c-non-secure";
261	pinctrl-names = "default";
262	pinctrl-0 = <&i2c4_pins_a>;
263	i2c-scl-rising-time-ns = <185>;
264	i2c-scl-falling-time-ns = <20>;
265	status = "okay";
266	/* spare dmas for other usage */
267	/delete-property/dmas;
268	/delete-property/dma-names;
269
270	hwrtc: rtc@32 {
271		compatible = "microcrystal,rv8803";
272		reg = <0x32>;
273	};
274
275	pmic: stpmic@33 {
276		compatible = "st,stpmic1";
277		reg = <0x33>;
278		interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
279		interrupt-controller;
280		#interrupt-cells = <2>;
281		status = "okay";
282
283		regulators {
284			compatible = "st,stpmic1-regulators";
285			ldo1-supply = <&v3v3>;
286			ldo2-supply = <&v3v3>;
287			ldo3-supply = <&vdd_ddr>;
288			ldo5-supply = <&v3v3>;
289			ldo6-supply = <&v3v3>;
290			pwr_sw1-supply = <&bst_out>;
291			pwr_sw2-supply = <&bst_out>;
292
293			vddcore: buck1 {
294				regulator-name = "vddcore";
295				regulator-min-microvolt = <800000>;
296				regulator-max-microvolt = <1350000>;
297				regulator-always-on;
298				regulator-initial-mode = <0>;
299				regulator-over-current-protection;
300			};
301
302			vdd_ddr: buck2 {
303				regulator-name = "vdd_ddr";
304				regulator-min-microvolt = <1350000>;
305				regulator-max-microvolt = <1350000>;
306				regulator-always-on;
307				regulator-initial-mode = <0>;
308				regulator-over-current-protection;
309			};
310
311			vdd: buck3 {
312				regulator-name = "vdd";
313				regulator-min-microvolt = <3300000>;
314				regulator-max-microvolt = <3300000>;
315				regulator-always-on;
316				st,mask-reset;
317				regulator-initial-mode = <0>;
318				regulator-over-current-protection;
319			};
320
321			v3v3: buck4 {
322				regulator-name = "v3v3";
323				regulator-min-microvolt = <3300000>;
324				regulator-max-microvolt = <3300000>;
325				regulator-always-on;
326				regulator-over-current-protection;
327				regulator-initial-mode = <0>;
328			};
329
330			vdda: ldo1 {
331				regulator-name = "vdda";
332				regulator-always-on;
333				regulator-min-microvolt = <2900000>;
334				regulator-max-microvolt = <2900000>;
335				interrupts = <IT_CURLIM_LDO1 0>;
336			};
337
338			v2v8: ldo2 {
339				regulator-name = "v2v8";
340				regulator-min-microvolt = <2800000>;
341				regulator-max-microvolt = <2800000>;
342				interrupts = <IT_CURLIM_LDO2 0>;
343			};
344
345			vtt_ddr: ldo3 {
346				regulator-name = "vtt_ddr";
347				regulator-min-microvolt = <500000>;
348				regulator-max-microvolt = <750000>;
349				regulator-always-on;
350				regulator-over-current-protection;
351			};
352
353			vdd_usb: ldo4 {
354				regulator-name = "vdd_usb";
355				interrupts = <IT_CURLIM_LDO4 0>;
356			};
357
358			vdd_sd: ldo5 {
359				regulator-name = "vdd_sd";
360				regulator-min-microvolt = <2900000>;
361				regulator-max-microvolt = <2900000>;
362				interrupts = <IT_CURLIM_LDO5 0>;
363				regulator-boot-on;
364			};
365
366			v1v8: ldo6 {
367				regulator-name = "v1v8";
368				regulator-min-microvolt = <1800000>;
369				regulator-max-microvolt = <1800000>;
370				interrupts = <IT_CURLIM_LDO6 0>;
371			};
372
373			vref_ddr: vref_ddr {
374				regulator-name = "vref_ddr";
375				regulator-always-on;
376			};
377
378			bst_out: boost {
379				regulator-name = "bst_out";
380				interrupts = <IT_OCP_BOOST 0>;
381			};
382
383			vbus_otg: pwr_sw1 {
384				regulator-name = "vbus_otg";
385				interrupts = <IT_OCP_OTG 0>;
386			};
387
388			vbus_sw: pwr_sw2 {
389				regulator-name = "vbus_sw";
390				interrupts = <IT_OCP_SWOUT 0>;
391				regulator-active-discharge = <1>;
392			};
393		};
394
395		onkey {
396			compatible = "st,stpmic1-onkey";
397			interrupts = <IT_PONKEY_F 0>, <IT_PONKEY_R 0>;
398			interrupt-names = "onkey-falling", "onkey-rising";
399			power-off-time-sec = <10>;
400			status = "okay";
401		};
402
403		watchdog {
404			compatible = "st,stpmic1-wdt";
405			status = "disabled";
406		};
407	};
408
409	touchscreen@49 {
410		compatible = "ti,tsc2004";
411		reg = <0x49>;
412		vio-supply = <&v3v3>;
413		interrupts-extended = <&gpioh 15 IRQ_TYPE_EDGE_FALLING>;
414	};
415
416	eeprom@50 {
417		compatible = "atmel,24c02";
418		reg = <0x50>;
419		pagesize = <16>;
420	};
421};
422
423&ipcc {
424	status = "okay";
425};
426
427&iwdg2 {
428	timeout-sec = <32>;
429	status = "okay";
430	secure-status = "disabled";
431};
432
433&m4_rproc {
434	memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
435			<&vdev0vring1>, <&vdev0buffer>;
436	mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
437	mbox-names = "vq0", "vq1", "shutdown";
438	interrupt-parent = <&exti>;
439	interrupts = <68 1>;
440	status = "okay";
441};
442
443&pwr_regulators {
444	vdd-supply = <&vdd>;
445	vdd_3v3_usbfs-supply = <&vdd_usb>;
446};
447
448&qspi {
449	pinctrl-names = "default", "sleep";
450	pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>;
451	pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>;
452	reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
453	#address-cells = <1>;
454	#size-cells = <0>;
455	status = "okay";
456
457	flash0: flash@0 {
458		compatible = "jedec,spi-nor";
459		reg = <0>;
460		spi-rx-bus-width = <4>;
461		spi-max-frequency = <108000000>;
462		#address-cells = <1>;
463		#size-cells = <1>;
464	};
465};
466
467&rcc {
468	/* Connect MCO2 output to ETH_RX_CLK input via pad-pad connection */
469	/* clocks = <&rcc CK_MCO2>; Not supported in OP-TEE OS */
470	/* clock-names = "ETH_RX_CLK/ETH_REF_CLK"; Not supported */
471
472	/*
473	 * Set PLL4P output to 100 MHz to supply SDMMC with faster clock,
474	 * set MCO2 output to 50 MHz to supply ETHRX clock with PLL4P/2,
475	 * so that MCO2 behaves as a divider for the ETHRX clock here.
476	 */
477	/* assigned-clocks = <&rcc CK_MCO2>, <&rcc PLL4_P>; Not supported */
478	/* assigned-clock-parents = <&rcc PLL4_P>; Not supported */
479	/* assigned-clock-rates = <50000000>, <100000000>; Not supported */
480
481	status = "okay";
482};
483
484&rng1 {
485	status = "okay";
486};
487
488&rtc {
489	status = "okay";
490};
491
492&sdmmc1 {
493	pinctrl-names = "default", "opendrain", "sleep", "init";
494	pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_a>;
495	pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_a>;
496	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_a>;
497	pinctrl-3 = <&sdmmc1_b4_init_pins_a &sdmmc1_dir_init_pins_a>;
498	cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
499	disable-wp;
500	st,sig-dir;
501	st,neg-edge;
502	st,use-ckin;
503	st,cmd-gpios = <&gpiod 2 0>;
504	st,ck-gpios = <&gpioc 12 0>;
505	st,ckin-gpios = <&gpioe 4 0>;
506	bus-width = <4>;
507	vmmc-supply = <&vdd_sd>;
508	status = "okay";
509};
510
511&sdmmc1_b4_pins_a {
512	/*
513	 * SD bus pull-up resistors:
514	 * - optional on SoMs with SD voltage translator
515	 * - mandatory on SoMs without SD voltage translator
516	 */
517	pins1 {
518		bias-pull-up;
519	};
520	pins2 {
521		bias-pull-up;
522	};
523};
524
525&sdmmc2 {
526	pinctrl-names = "default", "opendrain", "sleep";
527	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_a>;
528	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_a>;
529	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_a>;
530	non-removable;
531	no-sd;
532	no-sdio;
533	st,neg-edge;
534	bus-width = <8>;
535	vmmc-supply = <&v3v3>;
536	vqmmc-supply = <&v3v3>;
537	mmc-ddr-3_3v;
538	status = "okay";
539};
540
541&sdmmc3 {
542	pinctrl-names = "default", "opendrain", "sleep";
543	pinctrl-0 = <&sdmmc3_b4_pins_a>;
544	pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
545	pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
546	broken-cd;
547	st,neg-edge;
548	bus-width = <4>;
549	vmmc-supply = <&v3v3>;
550	vqmmc-supply = <&v3v3>;
551	mmc-ddr-3_3v;
552	status = "okay";
553};
554
555&uart4 {
556	pinctrl-names = "default";
557	pinctrl-0 = <&uart4_pins_a>;
558	/delete-property/dmas;
559	/delete-property/dma-names;
560	status = "okay";
561};
562