• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2/*
3 * Copyright (C) Linaro Ltd 2019 - All Rights Reserved
4 * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
5 * Copyright (C) 2020 Marek Vasut <marex@denx.de>
6 */
7
8/* Avenger96 uses DHCOR SoM configured for 1V8 IO operation */
9#include "stm32mp15xx-dhcor-io1v8.dtsi"
10
11/ {
12	aliases {
13		ethernet0 = &ethernet0;
14		mmc0 = &sdmmc1;
15		serial0 = &uart4;
16		serial1 = &uart7;
17		serial2 = &usart2;
18		spi0 = &qspi;
19	};
20
21	/* XTal Q1 */
22	cec_clock: clk-cec-fixed {
23		#clock-cells = <0>;
24		compatible = "fixed-clock";
25		clock-frequency = <24000000>;
26	};
27
28	chosen {
29		stdout-path = "serial0:115200n8";
30	};
31
32	hdmi-out {
33		compatible = "hdmi-connector";
34		type = "a";
35
36		port {
37			hdmi_con: endpoint {
38				remote-endpoint = <&adv7513_out>;
39			};
40		};
41	};
42
43	led {
44		compatible = "gpio-leds";
45		led1 {
46			label = "green:user0";
47			gpios = <&gpioz 7 GPIO_ACTIVE_HIGH>;
48			linux,default-trigger = "heartbeat";
49			default-state = "off";
50		};
51
52		led2 {
53			label = "green:user1";
54			gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>;
55			linux,default-trigger = "mmc0";
56			default-state = "off";
57		};
58
59		led3 {
60			label = "green:user2";
61			gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
62			linux,default-trigger = "mmc1";
63			default-state = "off";
64		};
65
66		led4 {
67			label = "green:user3";
68			gpios = <&gpiog 1 GPIO_ACTIVE_HIGH>;
69			linux,default-trigger = "none";
70			default-state = "off";
71			panic-indicator;
72		};
73	};
74
75	sd_switch: regulator-sd_switch {
76		compatible = "regulator-gpio";
77		regulator-name = "sd_switch";
78		regulator-min-microvolt = <1800000>;
79		regulator-max-microvolt = <2900000>;
80		regulator-type = "voltage";
81		regulator-always-on;
82
83		gpios = <&gpioi 5 GPIO_ACTIVE_HIGH>;
84		gpios-states = <0>;
85		states = <1800000 0x1>,
86			 <2900000 0x0>;
87	};
88
89	sound {
90		compatible = "audio-graph-card";
91		label = "STM32-AV96-HDMI";
92		dais = <&sai2a_port>;
93		status = "okay";
94	};
95
96	wlan_pwr: regulator-wlan {
97		compatible = "regulator-fixed";
98
99		regulator-name = "wl-reg";
100		regulator-min-microvolt = <3300000>;
101		regulator-max-microvolt = <3300000>;
102
103		gpio = <&gpioz 3 GPIO_ACTIVE_HIGH>;
104		enable-active-high;
105	};
106};
107
108&adc {
109	pinctrl-names = "default";
110	pinctrl-0 = <&adc12_ain_pins_b>;
111	vdd-supply = <&vdd>;
112	vdda-supply = <&vdda>;
113	vref-supply = <&vdda>;
114	status = "okay";
115
116	adc1: adc@0 {
117		st,adc-channels = <0 1 6>;
118		st,min-sample-time-nsecs = <5000>;
119		status = "okay";
120	};
121
122	adc2: adc@100 {
123		st,adc-channels = <0 1 2>;
124		st,min-sample-time-nsecs = <5000>;
125		status = "okay";
126	};
127};
128
129&ethernet0 {
130	status = "okay";
131	pinctrl-0 = <&ethernet0_rgmii_pins_c>;
132	pinctrl-1 = <&ethernet0_rgmii_sleep_pins_c>;
133	pinctrl-names = "default", "sleep";
134	phy-mode = "rgmii";
135	max-speed = <1000>;
136	phy-handle = <&phy0>;
137
138	mdio0 {
139		#address-cells = <1>;
140		#size-cells = <0>;
141		compatible = "snps,dwmac-mdio";
142		reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
143		reset-delay-us = <1000>;
144		reset-post-delay-us = <1000>;
145
146		phy0: ethernet-phy@7 {
147			reg = <7>;
148
149			rxc-skew-ps = <1500>;
150			rxdv-skew-ps = <540>;
151			rxd0-skew-ps = <420>;
152			rxd1-skew-ps = <420>;
153			rxd2-skew-ps = <420>;
154			rxd3-skew-ps = <420>;
155
156			txc-skew-ps = <1440>;
157			txen-skew-ps = <540>;
158			txd0-skew-ps = <420>;
159			txd1-skew-ps = <420>;
160			txd2-skew-ps = <420>;
161			txd3-skew-ps = <420>;
162		};
163	};
164};
165
166&gpioa {
167	gpio-line-names = "", "", "", "",
168			  "", "", "", "",
169			  "", "", "", "AV96-K",
170			  "AV96-I", "", "AV96-A", "";
171};
172
173&gpiob {
174	gpio-line-names = "", "", "", "",
175			  "", "AV96-J", "", "",
176			  "", "", "", "AV96-B",
177			  "", "AV96-L", "", "";
178};
179
180&gpioc {
181	gpio-line-names = "", "", "", "AV96-C",
182			  "", "", "", "",
183			  "", "", "", "",
184			  "", "", "", "";
185};
186
187&gpiod {
188	gpio-line-names = "", "", "", "",
189			  "", "", "", "",
190			  "AV96-D", "", "", "",
191			  "", "", "AV96-E", "AV96-F";
192};
193
194&gpiof {
195	gpio-line-names = "", "", "", "",
196			  "", "", "", "",
197			  "", "", "", "",
198			  "AV96-G", "AV96-H", "", "";
199};
200
201&i2c1 {	/* X6 I2C1 */
202	pinctrl-names = "default";
203	pinctrl-0 = <&i2c1_pins_b>;
204	i2c-scl-rising-time-ns = <185>;
205	i2c-scl-falling-time-ns = <20>;
206	status = "okay";
207	/delete-property/dmas;
208	/delete-property/dma-names;
209};
210
211&i2c2 {	/* X6 I2C2 */
212	pinctrl-names = "default";
213	pinctrl-0 = <&i2c2_pins_c>;
214	i2c-scl-rising-time-ns = <185>;
215	i2c-scl-falling-time-ns = <20>;
216	status = "okay";
217	/delete-property/dmas;
218	/delete-property/dma-names;
219};
220
221&i2c4 {
222	hdmi-transmitter@3d {
223		compatible = "adi,adv7513";
224		reg = <0x3d>, <0x4d>, <0x2d>, <0x5d>;
225		reg-names = "main", "edid", "cec", "packet";
226		clocks = <&cec_clock>;
227		clock-names = "cec";
228
229		avdd-supply = <&v3v3>;
230		dvdd-supply = <&v3v3>;
231		pvdd-supply = <&v3v3>;
232		dvdd-3v-supply = <&v3v3>;
233		bgvdd-supply = <&v3v3>;
234
235		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
236		interrupt-parent = <&gpiog>;
237
238		status = "okay";
239
240		adi,input-depth = <8>;
241		adi,input-colorspace = "rgb";
242		adi,input-clock = "1x";
243
244		ports {
245			#address-cells = <1>;
246			#size-cells = <0>;
247
248			port@0 {
249				reg = <0>;
250				adv7513_in: endpoint {
251					remote-endpoint = <&ltdc_ep0_out>;
252				};
253			};
254
255			port@1 {
256				reg = <1>;
257				adv7513_out: endpoint {
258					remote-endpoint = <&hdmi_con>;
259				};
260			};
261
262			port@2 {
263				reg = <2>;
264				adv7513_i2s0: endpoint {
265					remote-endpoint = <&sai2a_endpoint>;
266				};
267			};
268		};
269	};
270
271	dh_mac_eeprom: eeprom@53 {
272		compatible = "atmel,24c02";
273		reg = <0x53>;
274		pagesize = <16>;
275	};
276};
277
278&ltdc {
279	pinctrl-names = "default", "sleep";
280	pinctrl-0 = <&ltdc_pins_d>;
281	pinctrl-1 = <&ltdc_sleep_pins_d>;
282	status = "okay";
283
284	port {
285		#address-cells = <1>;
286		#size-cells = <0>;
287
288		ltdc_ep0_out: endpoint@0 {
289			reg = <0>;
290			remote-endpoint = <&adv7513_in>;
291		};
292	};
293};
294
295&sai2 {
296	clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
297	pinctrl-names = "default", "sleep";
298	pinctrl-0 = <&sai2a_pins_c>;
299	pinctrl-1 = <&sai2a_sleep_pins_c>;
300	clock-names = "pclk", "x8k", "x11k";
301	status = "okay";
302
303	sai2a: audio-controller@4400b004 {
304		#clock-cells = <0>;
305		dma-names = "tx";
306		clocks = <&rcc SAI2_K>;
307		clock-names = "sai_ck";
308		status = "okay";
309
310		sai2a_port: port {
311			sai2a_endpoint: endpoint {
312				remote-endpoint = <&adv7513_i2s0>;
313				format = "i2s";
314				mclk-fs = <256>;
315			};
316		};
317	};
318};
319
320&sdmmc1 {
321	pinctrl-names = "default", "opendrain", "sleep";
322	pinctrl-0 = <&sdmmc1_b4_pins_a &sdmmc1_dir_pins_b>;
323	pinctrl-1 = <&sdmmc1_b4_od_pins_a &sdmmc1_dir_pins_b>;
324	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a &sdmmc1_dir_sleep_pins_b>;
325	cd-gpios = <&gpioi 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
326	disable-wp;
327	st,sig-dir;
328	st,neg-edge;
329	st,use-ckin;
330	bus-width = <4>;
331	vmmc-supply = <&vdd_sd>;
332	vqmmc-supply = <&sd_switch>;
333	status = "okay";
334};
335
336&sdmmc2 {
337	pinctrl-names = "default", "opendrain", "sleep";
338	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_c>;
339	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_c>;
340	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_c>;
341	bus-width = <8>;
342	mmc-ddr-1_8v;
343	no-sd;
344	no-sdio;
345	non-removable;
346	st,neg-edge;
347	vmmc-supply = <&v3v3>;
348	vqmmc-supply = <&vdd_io>;
349	status = "okay";
350};
351
352&sdmmc3 {
353	pinctrl-names = "default", "opendrain", "sleep";
354	pinctrl-0 = <&sdmmc3_b4_pins_b>;
355	pinctrl-1 = <&sdmmc3_b4_od_pins_b>;
356	pinctrl-2 = <&sdmmc3_b4_sleep_pins_b>;
357	broken-cd;
358	non-removable;
359	st,neg-edge;
360	bus-width = <4>;
361	vmmc-supply = <&wlan_pwr>;
362	status = "okay";
363
364	#address-cells = <1>;
365	#size-cells = <0>;
366	brcmf: bcrmf@1 {
367		reg = <1>;
368		compatible = "brcm,bcm4329-fmac";
369	};
370};
371
372&spi2 {
373	pinctrl-names = "default";
374	pinctrl-0 = <&spi2_pins_a>;
375	cs-gpios = <&gpioi 0 0>;
376	status = "disabled";
377	/delete-property/dmas;
378	/delete-property/dma-names;
379};
380
381&uart4 {
382	/* On Low speed expansion header */
383	label = "LS-UART1";
384	pinctrl-names = "default";
385	pinctrl-0 = <&uart4_pins_b>;
386	status = "okay";
387};
388
389&uart7 {
390	/* On Low speed expansion header */
391	label = "LS-UART0";
392	pinctrl-names = "default";
393	pinctrl-0 = <&uart7_pins_a>;
394	uart-has-rtscts;
395	status = "okay";
396};
397
398/* Bluetooth */
399&usart2 {
400	pinctrl-names = "default", "sleep";
401	pinctrl-0 = <&usart2_pins_a>;
402	pinctrl-1 = <&usart2_sleep_pins_a>;
403	st,hw-flow-ctrl;
404	status = "okay";
405
406	bluetooth {
407		compatible = "brcm,bcm43438-bt";
408		max-speed = <3000000>;
409		shutdown-gpios = <&gpioz 6 GPIO_ACTIVE_HIGH>;
410	};
411};
412
413&usbh_ehci {
414	phys = <&usbphyc_port0>;
415	phy-names = "usb";
416	status = "okay";
417};
418
419&usbotg_hs {
420	pinctrl-0 = <&usbotg_hs_pins_a>;
421	pinctrl-names = "default";
422	phy-names = "usb2-phy";
423	phys = <&usbphyc_port1 0>;
424	status = "okay";
425	vbus-supply = <&vbus_otg>;
426};
427
428&usbphyc {
429	status = "okay";
430};
431
432&usbphyc_port0 {
433	phy-supply = <&vdd_usb>;
434};
435
436&usbphyc_port1 {
437	phy-supply = <&vdd_usb>;
438};
439