xref: /linux/arch/arm/boot/dts/st/stm32mp135f-dk.dts (revision 0cac5ce06e524755b3dac1e0a060b05992076d93)
1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (C) STMicroelectronics 2021 - All Rights Reserved
4 * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/regulator/st,stm32mp13-regulator.h>
13#include "stm32mp135.dtsi"
14#include "stm32mp13xf.dtsi"
15#include "stm32mp13-pinctrl.dtsi"
16
17/ {
18	model = "STMicroelectronics STM32MP135F-DK Discovery Board";
19	compatible = "st,stm32mp135f-dk", "st,stm32mp135";
20
21	aliases {
22		ethernet0 = &ethernet1;
23		serial0 = &uart4;
24		serial1 = &usart1;
25		serial2 = &uart8;
26		serial3 = &usart2;
27	};
28
29	chosen {
30		stdout-path = "serial0:115200n8";
31	};
32
33	clocks {
34		clk_ext_camera: clk-ext-camera {
35			#clock-cells = <0>;
36			compatible = "fixed-clock";
37			clock-frequency = <24000000>;
38		};
39
40		clk_mco1: clk-mco1 {
41			#clock-cells = <0>;
42			compatible = "fixed-clock";
43			clock-frequency = <24000000>;
44		};
45	};
46
47	memory@c0000000 {
48		device_type = "memory";
49		reg = <0xc0000000 0x20000000>;
50	};
51
52	reserved-memory {
53		#address-cells = <1>;
54		#size-cells = <1>;
55		ranges;
56
57		optee@dd000000 {
58			reg = <0xdd000000 0x3000000>;
59			no-map;
60		};
61	};
62
63	gpio-keys {
64		compatible = "gpio-keys";
65
66		button-user {
67			label = "User-PA13";
68			linux,code = <BTN_1>;
69			gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
70		};
71	};
72
73	leds {
74		compatible = "gpio-leds";
75
76		led-blue {
77			function = LED_FUNCTION_HEARTBEAT;
78			color = <LED_COLOR_ID_BLUE>;
79			gpios = <&gpioa 14 GPIO_ACTIVE_LOW>;
80			linux,default-trigger = "heartbeat";
81			default-state = "off";
82		};
83	};
84
85	panel_backlight: panel-backlight {
86		compatible = "gpio-backlight";
87		gpios = <&gpioe 12 GPIO_ACTIVE_HIGH>;
88		default-on;
89		status = "okay";
90	};
91
92	panel_rgb: panel-rgb {
93		compatible = "rocktech,rk043fn48h";
94		enable-gpios = <&gpioi 7 GPIO_ACTIVE_HIGH>;
95		backlight = <&panel_backlight>;
96		power-supply = <&scmi_v3v3_sw>;
97		status = "okay";
98
99		width-mm = <105>;
100		height-mm = <67>;
101
102		panel-timing {
103			clock-frequency = <10000000>;
104			hactive = <480>;
105			hback-porch = <43>;
106			hfront-porch = <10>;
107			hsync-len = <1>;
108			hsync-active = <0>;
109			vactive = <272>;
110			vback-porch = <26>;
111			vfront-porch = <4>;
112			vsync-len = <10>;
113			vsync-active = <0>;
114			de-active = <1>;
115			pixelclk-active = <1>;
116		};
117
118		port {
119			panel_in_rgb: endpoint {
120				remote-endpoint = <&ltdc_out_rgb>;
121			};
122		};
123	};
124
125	v3v3_ao: v3v3-ao {
126		compatible = "regulator-fixed";
127		regulator-name = "v3v3_ao";
128		regulator-min-microvolt = <3300000>;
129		regulator-max-microvolt = <3300000>;
130		regulator-always-on;
131	};
132
133	wifi_pwrseq: wifi-pwrseq {
134		compatible = "mmc-pwrseq-simple";
135		reset-gpios = <&mcp23017 11 GPIO_ACTIVE_LOW>;
136	};
137};
138
139&adc_1 {
140	pinctrl-names = "default";
141	pinctrl-0 = <&adc1_usb_cc_pins_a>;
142	vdda-supply = <&scmi_vdd_adc>;
143	vref-supply = <&scmi_vdd_adc>;
144	status = "okay";
145	adc1: adc@0 {
146		status = "okay";
147		/*
148		 * Type-C USB_PWR_CC1 & USB_PWR_CC2 on in6 & in12.
149		 * Use at least 5 * RC time, e.g. 5 * (Rp + Rd) * C:
150		 * 5 * (5.1 + 47kOhms) * 5pF => 1.3us.
151		 * Use arbitrary margin here (e.g. 5us).
152		 */
153		channel@6 {
154			reg = <6>;
155			st,min-sample-time-ns = <5000>;
156		};
157		channel@12 {
158			reg = <12>;
159			st,min-sample-time-ns = <5000>;
160		};
161	};
162};
163
164&arm_wdt {
165	timeout-sec = <32>;
166	status = "okay";
167};
168
169&crc1 {
170	status = "okay";
171};
172
173&cryp {
174	status = "okay";
175};
176
177&dcmipp {
178	pinctrl-names = "default", "sleep";
179	pinctrl-0 = <&dcmipp_pins_a>;
180	pinctrl-1 = <&dcmipp_sleep_pins_a>;
181	status = "okay";
182
183	port {
184		dcmipp_0: endpoint {
185			remote-endpoint = <&mipid02_2>;
186			bus-width = <8>;
187			hsync-active = <0>;
188			vsync-active = <0>;
189			pclk-sample = <0>;
190		};
191	};
192};
193
194&ethernet1 {
195	status = "okay";
196	pinctrl-0 = <&eth1_rmii_pins_a>;
197	pinctrl-1 = <&eth1_rmii_sleep_pins_a>;
198	pinctrl-names = "default", "sleep";
199	phy-mode = "rmii";
200	phy-handle = <&phy0_eth1>;
201
202	mdio {
203		#address-cells = <1>;
204		#size-cells = <0>;
205		compatible = "snps,dwmac-mdio";
206
207		phy0_eth1: ethernet-phy@0 {
208			compatible = "ethernet-phy-id0007.c131";
209			reg = <0>;
210			reset-gpios = <&mcp23017 9 GPIO_ACTIVE_LOW>;
211			wakeup-source;
212		};
213	};
214};
215
216&i2c1 {
217	pinctrl-names = "default", "sleep";
218	pinctrl-0 = <&i2c1_pins_a>;
219	pinctrl-1 = <&i2c1_sleep_pins_a>;
220	i2c-scl-rising-time-ns = <96>;
221	i2c-scl-falling-time-ns = <3>;
222	clock-frequency = <1000000>;
223	status = "okay";
224	/* spare dmas for other usage */
225	/delete-property/dmas;
226	/delete-property/dma-names;
227
228	mcp23017: pinctrl@21 {
229		compatible = "microchip,mcp23017";
230		reg = <0x21>;
231		gpio-controller;
232		#gpio-cells = <2>;
233		interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
234		interrupt-parent = <&gpiog>;
235		pinctrl-names = "default";
236		pinctrl-0 = <&mcp23017_pins_a>;
237		interrupt-controller;
238		#interrupt-cells = <2>;
239		microchip,irq-mirror;
240	};
241
242	typec@53 {
243		compatible = "st,stm32g0-typec";
244		reg = <0x53>;
245		/* Alert pin on PI2 */
246		interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
247		interrupt-parent = <&gpioi>;
248		/* Internal pull-up on PI2 */
249		pinctrl-names = "default";
250		pinctrl-0 = <&stm32g0_intn_pins_a>;
251		firmware-name = "stm32g0-ucsi.mp135f-dk.fw";
252		connector {
253			compatible = "usb-c-connector";
254			label = "USB-C";
255
256			port {
257				con_usb_c_g0_ep: endpoint {
258					remote-endpoint = <&usbotg_hs_ep>;
259				};
260			};
261		};
262	};
263};
264
265&i2c5 {
266	pinctrl-names = "default", "sleep";
267	pinctrl-0 = <&i2c5_pins_a>;
268	pinctrl-1 = <&i2c5_sleep_pins_a>;
269	i2c-scl-rising-time-ns = <170>;
270	i2c-scl-falling-time-ns = <5>;
271	clock-frequency = <400000>;
272	status = "okay";
273	/* spare dmas for other usage */
274	/delete-property/dmas;
275	/delete-property/dma-names;
276
277	stmipi: csi2rx@14 {
278		compatible = "st,st-mipid02";
279		reg = <0x14>;
280		clocks = <&clk_mco1>;
281		clock-names = "xclk";
282		VDDE-supply = <&scmi_v1v8_periph>;
283		VDDIN-supply = <&scmi_v1v8_periph>;
284		reset-gpios = <&mcp23017 2 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
285		status = "okay";
286
287		ports {
288			#address-cells = <1>;
289			#size-cells = <0>;
290			port@0 {
291				reg = <0>;
292
293				mipid02_0: endpoint {
294					data-lanes = <1 2>;
295					lane-polarities = <0 0 0>;
296					remote-endpoint = <&gc2145_ep>;
297				};
298			};
299			port@2 {
300				reg = <2>;
301
302				mipid02_2: endpoint {
303					bus-width = <8>;
304					hsync-active = <0>;
305					vsync-active = <0>;
306					pclk-sample = <0>;
307					remote-endpoint = <&dcmipp_0>;
308				};
309			};
310		};
311	};
312
313	gc2145: camera@3c {
314		compatible = "galaxycore,gc2145";
315		reg = <0x3c>;
316		clocks = <&clk_ext_camera>;
317		iovdd-supply = <&scmi_v3v3_sw>;
318		avdd-supply = <&scmi_v3v3_sw>;
319		dvdd-supply = <&scmi_v3v3_sw>;
320		powerdown-gpios = <&mcp23017 3 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
321		reset-gpios = <&mcp23017 4 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
322		status = "okay";
323
324		port {
325			gc2145_ep: endpoint {
326				remote-endpoint = <&mipid02_0>;
327				data-lanes = <1 2>;
328				link-frequencies = /bits/ 64 <120000000 192000000 240000000>;
329			};
330		};
331	};
332
333	goodix: goodix-ts@5d {
334		compatible = "goodix,gt911";
335		reg = <0x5d>;
336		pinctrl-names = "default";
337		pinctrl-0 = <&goodix_pins_a>;
338		interrupt-parent = <&gpiof>;
339		interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
340		AVDD28-supply = <&scmi_v3v3_sw>;
341		VDDIO-supply = <&scmi_v3v3_sw>;
342		touchscreen-size-x = <480>;
343		touchscreen-size-y = <272>;
344		status = "okay" ;
345	};
346};
347
348&iwdg2 {
349	timeout-sec = <32>;
350	status = "okay";
351};
352
353&ltdc {
354	pinctrl-names = "default", "sleep";
355	pinctrl-0 = <&ltdc_pins_a>;
356	pinctrl-1 = <&ltdc_sleep_pins_a>;
357	status = "okay";
358
359	port {
360		ltdc_out_rgb: endpoint {
361			remote-endpoint = <&panel_in_rgb>;
362		};
363	};
364};
365
366&rtc {
367	pinctrl-names = "default";
368	pinctrl-0 = <&rtc_rsvd_pins_a>;
369	status = "okay";
370
371	rtc_lsco_pins_a: rtc-lsco-0 {
372		pins = "out2_rmp";
373		function = "lsco";
374	};
375};
376
377&scmi_regu {
378	scmi_vdd_adc: regulator@10 {
379		reg = <VOLTD_SCMI_STPMIC1_LDO1>;
380		regulator-name = "vdd_adc";
381	};
382	scmi_vdd_usb: regulator@13 {
383		reg = <VOLTD_SCMI_STPMIC1_LDO4>;
384		regulator-name = "vdd_usb";
385	};
386	scmi_vdd_sd: regulator@14 {
387		reg = <VOLTD_SCMI_STPMIC1_LDO5>;
388		regulator-name = "vdd_sd";
389	};
390	scmi_v1v8_periph: regulator@15 {
391		reg = <VOLTD_SCMI_STPMIC1_LDO6>;
392		regulator-name = "v1v8_periph";
393	};
394	scmi_v3v3_sw: regulator@19 {
395		reg = <VOLTD_SCMI_STPMIC1_PWR_SW2>;
396		regulator-name = "v3v3_sw";
397	};
398};
399
400&sdmmc1 {
401	pinctrl-names = "default", "opendrain", "sleep";
402	pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_clk_pins_a>;
403	pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_clk_pins_a>;
404	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
405	cd-gpios = <&gpioh 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
406	disable-wp;
407	st,neg-edge;
408	bus-width = <4>;
409	vmmc-supply = <&scmi_vdd_sd>;
410	status = "okay";
411};
412
413/* Wifi */
414&sdmmc2 {
415	pinctrl-names = "default", "opendrain", "sleep";
416	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_clk_pins_a>;
417	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_clk_pins_a>;
418	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
419	non-removable;
420	cap-sdio-irq;
421	st,neg-edge;
422	bus-width = <4>;
423	vmmc-supply = <&v3v3_ao>;
424	mmc-pwrseq = <&wifi_pwrseq>;
425	#address-cells = <1>;
426	#size-cells = <0>;
427	status = "okay";
428
429	brcmf: wifi@1 {
430		reg = <1>;
431		compatible = "brcm,bcm4329-fmac";
432		pinctrl-names = "default";
433		pinctrl-0 = <&rtc_lsco_pins_a>;
434	};
435};
436
437&spi5 {
438	pinctrl-names = "default", "sleep";
439	pinctrl-0 = <&spi5_pins_a>;
440	pinctrl-1 = <&spi5_sleep_pins_a>;
441	status = "disabled";
442};
443
444&timers3 {
445	/delete-property/dmas;
446	/delete-property/dma-names;
447	status = "disabled";
448	counter {
449		status = "okay";
450	};
451	pwm {
452		/* PWM output on pin 7 of the expansion connector (CN8.7) using TIM3_CH4 func */
453		pinctrl-0 = <&pwm3_pins_a>;
454		pinctrl-1 = <&pwm3_sleep_pins_a>;
455		pinctrl-names = "default", "sleep";
456		status = "okay";
457	};
458	timer@2 {
459		status = "okay";
460	};
461};
462
463&timers4 {
464	/delete-property/dmas;
465	/delete-property/dma-names;
466	status = "disabled";
467	counter {
468		status = "okay";
469	};
470	pwm {
471		/* PWM output on pin 31 of the expansion connector (CN8.31) using TIM4_CH2 func */
472		pinctrl-0 = <&pwm4_pins_a>;
473		pinctrl-1 = <&pwm4_sleep_pins_a>;
474		pinctrl-names = "default", "sleep";
475		status = "okay";
476	};
477	timer@3 {
478		status = "okay";
479	};
480};
481
482&timers8 {
483	/delete-property/dmas;
484	/delete-property/dma-names;
485	status = "disabled";
486	counter {
487		status = "okay";
488	};
489	pwm {
490		/* PWM output on pin 32 of the expansion connector (CN8.32) using TIM8_CH3 func */
491		pinctrl-0 = <&pwm8_pins_a>;
492		pinctrl-1 = <&pwm8_sleep_pins_a>;
493		pinctrl-names = "default", "sleep";
494		status = "okay";
495	};
496	timer@7 {
497		status = "okay";
498	};
499};
500
501&timers14 {
502	status = "disabled";
503	counter {
504		status = "okay";
505	};
506	pwm {
507		/* PWM output on pin 33 of the expansion connector (CN8.33) using TIM14_CH1 func */
508		pinctrl-0 = <&pwm14_pins_a>;
509		pinctrl-1 = <&pwm14_sleep_pins_a>;
510		pinctrl-names = "default", "sleep";
511		status = "okay";
512	};
513	timer@13 {
514		status = "okay";
515	};
516};
517
518&uart4 {
519	pinctrl-names = "default", "sleep", "idle";
520	pinctrl-0 = <&uart4_pins_a>;
521	pinctrl-1 = <&uart4_sleep_pins_a>;
522	pinctrl-2 = <&uart4_idle_pins_a>;
523	/delete-property/dmas;
524	/delete-property/dma-names;
525	status = "okay";
526};
527
528&uart8 {
529	pinctrl-names = "default", "sleep", "idle";
530	pinctrl-0 = <&uart8_pins_a>;
531	pinctrl-1 = <&uart8_sleep_pins_a>;
532	pinctrl-2 = <&uart8_idle_pins_a>;
533	/delete-property/dmas;
534	/delete-property/dma-names;
535	status = "disabled";
536};
537
538&usart1 {
539	pinctrl-names = "default", "sleep", "idle";
540	pinctrl-0 = <&usart1_pins_a>;
541	pinctrl-1 = <&usart1_sleep_pins_a>;
542	pinctrl-2 = <&usart1_idle_pins_a>;
543	uart-has-rtscts;
544	status = "disabled";
545};
546
547/* Bluetooth */
548&usart2 {
549	pinctrl-names = "default", "sleep", "idle";
550	pinctrl-0 = <&usart2_pins_a>;
551	pinctrl-1 = <&usart2_sleep_pins_a>;
552	pinctrl-2 = <&usart2_idle_pins_a>;
553	uart-has-rtscts;
554	status = "okay";
555
556	bluetooth {
557		shutdown-gpios = <&mcp23017 13 GPIO_ACTIVE_HIGH>;
558		compatible = "brcm,bcm43438-bt";
559		max-speed = <3000000>;
560		vbat-supply = <&v3v3_ao>;
561		vddio-supply = <&v3v3_ao>;
562	};
563};
564
565&usbh_ehci {
566	phys = <&usbphyc_port0>;
567	status = "okay";
568	#address-cells = <1>;
569	#size-cells = <0>;
570	/* onboard HUB */
571	hub@1 {
572		compatible = "usb424,2514";
573		reg = <1>;
574		vdd-supply = <&scmi_v3v3_sw>;
575	};
576};
577
578&usbotg_hs {
579	phys = <&usbphyc_port1 0>;
580	phy-names = "usb2-phy";
581	usb-role-switch;
582	status = "okay";
583	port {
584		usbotg_hs_ep: endpoint {
585			remote-endpoint = <&con_usb_c_g0_ep>;
586		};
587	};
588};
589
590&usbphyc {
591	status = "okay";
592};
593
594&usbphyc_port0 {
595	phy-supply = <&scmi_vdd_usb>;
596	st,current-boost-microamp = <1000>;
597	st,decrease-hs-slew-rate;
598	st,tune-hs-dc-level = <2>;
599	st,enable-hs-rftime-reduction;
600	st,trim-hs-current = <11>;
601	st,trim-hs-impedance = <2>;
602	st,tune-squelch-level = <1>;
603	st,enable-hs-rx-gain-eq;
604	st,no-hs-ftime-ctrl;
605	st,no-lsfs-sc;
606};
607
608&usbphyc_port1 {
609	phy-supply = <&scmi_vdd_usb>;
610	st,current-boost-microamp = <1000>;
611	st,decrease-hs-slew-rate;
612	st,tune-hs-dc-level = <2>;
613	st,enable-hs-rftime-reduction;
614	st,trim-hs-current = <11>;
615	st,trim-hs-impedance = <2>;
616	st,tune-squelch-level = <1>;
617	st,enable-hs-rx-gain-eq;
618	st,no-hs-ftime-ctrl;
619	st,no-lsfs-sc;
620};
621