xref: /linux/arch/arm/boot/dts/st/stm32mp153c-lxa-fairytux2.dtsi (revision 2f24482304ebd32c5aa374f31465b9941a860b92)
1// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
2/*
3 * Copyright (C) 2020 STMicroelectronics - All Rights Reserved
4 * Copyright (C) 2021 Rouven Czerwinski, Pengutronix
5 * Copyright (C) 2023, 2024 Leonard Göhrs, Pengutronix
6 */
7
8#include "stm32mp153.dtsi"
9#include "stm32mp15xc.dtsi"
10#include "stm32mp15xx-osd32.dtsi"
11#include "stm32mp15xxac-pinctrl.dtsi"
12
13#include <dt-bindings/gpio/gpio.h>
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/leds/common.h>
16#include <dt-bindings/pwm/pwm.h>
17
18/ {
19	aliases {
20		can0 = &m_can1;
21		ethernet0 = &ethernet0;
22		i2c0 = &i2c1;
23		i2c1 = &i2c4;
24		mmc1 = &sdmmc2;
25		serial0 = &uart4;
26		serial1 = &usart3;
27		spi0 = &spi4;
28	};
29
30	chosen {
31		stdout-path = &uart4;
32	};
33
34	backlight: backlight {
35		compatible = "pwm-backlight";
36		power-supply = <&v3v3>;
37
38		brightness-levels = <0 31 63 95 127 159 191 223 255>;
39		default-brightness-level = <7>;
40		pwms = <&led_pwm 3 1000000 0>;
41	};
42
43	led-controller-cpu {
44		compatible = "gpio-leds";
45
46		led-0 {
47			color = <LED_COLOR_ID_GREEN>;
48			function = LED_FUNCTION_HEARTBEAT;
49			gpios = <&gpioa 13 GPIO_ACTIVE_HIGH>;
50			linux,default-trigger = "heartbeat";
51		};
52	};
53
54	led_controller_io: led-controller-io {
55		compatible = "gpio-leds";
56
57		/*
58		 * led-0 and led-1 are internally connected antiparallel to one
59		 * another inside the ethernet jack like this:
60		 * GPIO0 ---+---|led-0|>--+--- GPIO2
61		 *          +--<|led-1|---+
62		 * E.g. only one of the LEDs can be illuminated at a time while
63		 * the other output must be driven low.
64		 * This should likely be implemented using a multi color LED
65		 * driver for antiparallel LEDs.
66		 */
67		led-0 {
68			color = <LED_COLOR_ID_GREEN>;
69			function = LED_FUNCTION_LAN;
70			gpios = <&io_board_gpio 0 GPIO_ACTIVE_HIGH>;
71		};
72
73		led-1 {
74			color = <LED_COLOR_ID_ORANGE>;
75			function = LED_FUNCTION_LAN;
76			gpios = <&io_board_gpio 2 GPIO_ACTIVE_HIGH>;
77		};
78	};
79
80	reg_5v: regulator-5v {
81		compatible = "regulator-fixed";
82		regulator-name = "5V";
83		regulator-min-microvolt = <5000000>;
84		regulator-max-microvolt = <5000000>;
85		regulator-always-on;
86	};
87
88	reg_1v2: regulator-1v2 {
89		compatible = "regulator-fixed";
90		regulator-name = "1V2";
91		regulator-min-microvolt = <1200000>;
92		regulator-max-microvolt = <1200000>;
93		regulator-always-on;
94		vin-supply = <&reg_5v>;
95	};
96};
97
98baseboard_eeprom: &sip_eeprom {
99};
100
101&crc1 {
102	status = "okay";
103};
104
105&cryp1 {
106	status = "okay";
107};
108
109&dts {
110	status = "okay";
111};
112
113&ethernet0 {
114	assigned-clocks = <&rcc ETHCK_K>, <&rcc PLL4_P>;
115	assigned-clock-parents = <&rcc PLL4_P>;
116	assigned-clock-rates = <125000000>; /* Clock PLL4 to 750Mhz in ATF */
117
118	pinctrl-names = "default", "sleep";
119	pinctrl-0 = <&ethernet0_rgmii_pins_b>;
120	pinctrl-1 = <&ethernet0_rgmii_sleep_pins_b>;
121
122	st,eth-clk-sel;
123	phy-mode = "rgmii-id";
124	phy-handle = <&ethphy>;
125	status = "okay";
126
127	mdio {
128		compatible = "snps,dwmac-mdio";
129		#address-cells = <1>;
130		#size-cells = <0>;
131
132		ethphy: ethernet-phy@3 { /* KSZ9031RN */
133			reg = <3>;
134			reset-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>; /* ETH_RST# */
135			interrupt-parent = <&gpioa>;
136			interrupts = <6 IRQ_TYPE_EDGE_FALLING>; /* ETH_MDINT# */
137			reset-assert-us = <10000>;
138			reset-deassert-us = <300>;
139			micrel,force-master;
140		};
141	};
142};
143
144&gpioa {
145	gpio-line-names = "", "", "", "", "",				/*  0 */
146			  "", "ETH_INT", "", "", "",			/*  5 */
147			  "", "", "", "BOOTROM_LED", "",		/* 10 */
148			  "";						/* 15 */
149};
150
151&gpiob {
152	gpio-line-names = "", "", "", "", "",				/*  0 */
153			  "", "", "", "", "",				/*  5 */
154			  "", "", "", "", "",				/* 10 */
155			  "";						/* 15 */
156};
157
158&gpioc {
159	gpio-line-names = "", "", "", "", "",				/*  0 */
160			  "", "", "", "", "",				/*  5 */
161			  "", "";					/* 10 */
162};
163
164&gpiod {
165	gpio-line-names = "", "", "", "", "",				/*  0 */
166			  "", "", "LCD_TE", "", "",			/*  5 */
167			  "LCD_DC", "", "", "", "",			/* 10 */
168			  "";						/* 15 */
169};
170
171&gpioe {
172	gpio-line-names = "LCD_CS", "", "", "", "",			/*  0 */
173			  "", "", "", "", "",				/*  5 */
174			  "", "", "", "", "",				/* 10 */
175			  "";						/* 15 */
176};
177
178&gpiof {
179	gpio-line-names = "GPIO1", "GPIO2", "", "", "",			/*  0 */
180			  "", "", "", "", "",				/*  5 */
181			  "", "", "", "", "",				/* 10 */
182			  "";						/* 15 */
183};
184
185&gpiog {
186	gpio-line-names = "", "", "", "", "",				/*  0 */
187			  "", "", "", "", "",				/*  5 */
188			  "", "", "", "", "",				/* 10 */
189			  "";						/* 15 */
190};
191
192&gpioz {
193	gpio-line-names = "HWID0", "HWID1", "HWID2", "HWID3", "",	/*  0 */
194			  "", "HWID4", "HWID5";				/*  5 */
195};
196
197&hash1 {
198	status = "okay";
199};
200
201&iwdg2 {
202	timeout-sec = <8>;
203	status = "okay";
204};
205
206&m_can1 {
207	pinctrl-names = "default", "sleep";
208	pinctrl-0 = <&m_can1_pins_b>;
209	pinctrl-1 = <&m_can1_sleep_pins_b>;
210	status = "okay";
211	termination-gpios = <&io_board_gpio 7 GPIO_ACTIVE_HIGH>;
212	termination-ohms = <120>;
213};
214
215&pmic {
216	regulators {
217		buck1-supply = <&reg_5v>;	/* VIN */
218		buck2-supply = <&reg_5v>;	/* VIN */
219		buck3-supply = <&reg_5v>;	/* VIN */
220		buck4-supply = <&reg_5v>;	/* VIN */
221		ldo2-supply = <&reg_5v>;	/* PMIC_LDO25IN */
222		ldo4-supply = <&reg_5v>;	/* VIN */
223		ldo5-supply = <&reg_5v>;	/* PMIC_LDO25IN */
224		vref_ddr-supply = <&reg_5v>;	/* VIN */
225		boost-supply = <&reg_5v>;	/* PMIC_BSTIN */
226		pwr_sw2-supply = <&bst_out>;	/* PMIC_SWIN */
227	};
228};
229
230&pwr_regulators {
231	vdd-supply = <&vdd>;
232	vdd_3v3_usbfs-supply = <&vdd_usb>;
233};
234
235&sdmmc2 {
236	pinctrl-names = "default", "opendrain", "sleep";
237	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_b>;
238	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_b>;
239	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_b>;
240	vmmc-supply = <&v3v3>;
241
242	bus-width = <8>;
243	mmc-ddr-3_3v;
244	no-1-8-v;
245	non-removable;
246	no-sd;
247	no-sdio;
248	st,neg-edge;
249
250	status = "okay";
251};
252
253&spi4 {
254	pinctrl-names = "default";
255	pinctrl-0 = <&spi4_pins_a>;
256	cs-gpios = <&gpioe 0 GPIO_ACTIVE_LOW>;
257	status = "okay";
258
259	lcd: display@0 {
260		compatible = "shineworld,lh133k", "panel-mipi-dbi-spi";
261		reg = <0>;
262		power-supply = <&v3v3>;
263		io-supply = <&v3v3>;
264		backlight = <&backlight>;
265		dc-gpios = <&gpiod 10 GPIO_ACTIVE_HIGH>;
266		reset-gpios = <&gpioh 4 GPIO_ACTIVE_HIGH>;
267		spi-3wire;
268		spi-max-frequency = <32000000>;
269
270		width-mm = <23>;
271		height-mm = <23>;
272		rotation = <180>;
273
274		panel-timing {
275			hactive = <240>;
276			vactive = <240>;
277			hback-porch = <0>;
278			vback-porch = <0>;
279
280			clock-frequency = <0>;
281			hfront-porch = <0>;
282			hsync-len = <0>;
283			vfront-porch = <0>;
284			vsync-len = <0>;
285		};
286	};
287};
288
289&timers2 {
290	/* spare dmas for other usage */
291	/delete-property/dmas;
292	/delete-property/dma-names;
293
294	status = "okay";
295
296	timer@1 {
297		status = "okay";
298	};
299};
300
301&timers3 {
302	/* spare dmas for other usage */
303	/delete-property/dmas;
304	/delete-property/dma-names;
305
306	status = "okay";
307
308	timer@2 {
309		status = "okay";
310	};
311};
312
313&timers4 {
314	/* spare dmas for other usage */
315	/delete-property/dmas;
316	/delete-property/dma-names;
317
318	status = "okay";
319
320	timer@3 {
321		status = "okay";
322	};
323};
324
325&timers8 {
326	/* spare dmas for other usage */
327	/delete-property/dmas;
328	/delete-property/dma-names;
329
330	status = "okay";
331
332	led_pwm: pwm {
333		pinctrl-names = "default", "sleep";
334		pinctrl-0 = <&pwm8_pins_b>;
335		pinctrl-1 = <&pwm8_sleep_pins_b>;
336		status = "okay";
337	};
338};
339
340&uart4 {
341	label = "debug";
342
343	pinctrl-names = "default";
344	pinctrl-0 = <&uart4_pins_a>;
345
346	/* spare dmas for other usage */
347	/delete-property/dmas;
348	/delete-property/dma-names;
349
350	status = "okay";
351};
352
353&usart3 {
354	label = "external";
355
356	pinctrl-names = "default";
357	pinctrl-0 = <&usart3_pins_a>;
358
359	/* spare dmas for other usage */
360	/delete-property/dmas;
361	/delete-property/dma-names;
362
363	status = "okay";
364};
365
366&usbh_ehci {
367	phys = <&usbphyc_port0>;
368	phy-names = "usb";
369
370	status = "okay";
371};
372
373&usbotg_hs {
374	phys = <&usbphyc_port1 0>;
375	phy-names = "usb2-phy";
376
377	vusb_d-supply = <&vdd_usb>;
378	vusb_a-supply = <&reg18>;
379
380	status = "okay";
381};
382
383&usbphyc {
384	status = "okay";
385};
386
387&usbphyc_port0 {
388	phy-supply = <&vdd_usb>;
389};
390
391&usbphyc_port1 {
392	phy-supply = <&vdd_usb>;
393};
394
395&v3v3_hdmi {
396	regulator-enable-ramp-delay = <1000>;
397};
398