xref: /linux/arch/arm64/boot/dts/ti/k3-am625-phyboard-lyra-rdk.dts (revision 3ff78451b8e446e9a548b98a0d4dd8d24dc5780b)
1// SPDX-License-Identifier: GPL-2.0-only OR MIT
2/*
3 * Copyright (C) 2022-2024 PHYTEC Messtechnik GmbH
4 * Author: Wadim Egorov <w.egorov@phytec.de>
5 *
6 * Product homepage:
7 * https://www.phytec.com/product/phyboard-am62x
8 */
9
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/leds/common.h>
13#include <dt-bindings/net/ti-dp83867.h>
14#include "k3-am625.dtsi"
15#include "k3-am62-phycore-som.dtsi"
16
17/ {
18	compatible = "phytec,am625-phyboard-lyra-rdk",
19		     "phytec,am62-phycore-som", "ti,am625";
20	model = "PHYTEC phyBOARD-Lyra AM625";
21
22	aliases {
23		serial2 = &main_uart0;
24		serial3 = &main_uart1;
25		mmc1 = &sdhci1;
26		usb0 = &usb0;
27		usb1 = &usb1;
28		ethernet1 = &cpsw_port2;
29	};
30
31	can_tc1: can-phy0 {
32		compatible = "ti,tcan1042";
33		#phy-cells = <0>;
34		max-bitrate = <8000000>;
35		standby-gpios = <&gpio_exp 1 GPIO_ACTIVE_HIGH>;
36	};
37
38	hdmi0: connector-hdmi {
39		compatible = "hdmi-connector";
40		label = "hdmi";
41		type = "a";
42
43		port {
44			hdmi_connector_in: endpoint {
45				remote-endpoint = <&sii9022_out>;
46			};
47		};
48	};
49
50	keys {
51		compatible = "gpio-keys";
52		autorepeat;
53		pinctrl-names = "default";
54		pinctrl-0 = <&gpio_keys_pins_default>;
55
56		key-home {
57			label = "home";
58			linux,code = <KEY_HOME>;
59			gpios = <&main_gpio1 23 GPIO_ACTIVE_HIGH>;
60		};
61
62		key-menu {
63			label = "menu";
64			linux,code = <KEY_MENU>;
65			gpios = <&gpio_exp 4 GPIO_ACTIVE_HIGH>;
66		};
67	};
68
69	sound {
70		compatible = "simple-audio-card";
71		simple-audio-card,name = "phyBOARD-Lyra";
72		simple-audio-card,widgets =
73			"Microphone",           "Mic Jack",
74			"Headphone",            "Headphone Jack",
75			"Speaker",              "External Speaker";
76		simple-audio-card,routing =
77			"MIC3R",                "Mic Jack",
78			"Mic Jack",             "Mic Bias",
79			"Headphone Jack",       "HPLOUT",
80			"Headphone Jack",       "HPROUT",
81			"External Speaker",     "SPOP",
82			"External Speaker",     "SPOM";
83		simple-audio-card,format = "dsp_b";
84		simple-audio-card,bitclock-master = <&sound_master>;
85		simple-audio-card,frame-master = <&sound_master>;
86		simple-audio-card,bitclock-inversion;
87
88		simple-audio-card,cpu {
89			sound-dai = <&mcasp2>;
90		};
91
92		sound_master: simple-audio-card,codec {
93				sound-dai = <&audio_codec>;
94				clocks = <&audio_refclk1>;
95		};
96	};
97
98	leds {
99		compatible = "gpio-leds";
100		pinctrl-names = "default";
101		pinctrl-0 = <&leds_pins_default>, <&user_leds_pins_default>;
102
103		led-1 {
104			gpios = <&main_gpio0 32 GPIO_ACTIVE_HIGH>;
105			linux,default-trigger = "mmc0";
106		};
107
108		led-2 {
109			gpios = <&gpio_exp 2 GPIO_ACTIVE_HIGH>;
110			linux,default-trigger = "mmc1";
111		};
112	};
113
114	vcc_1v8: regulator-vcc-1v8 {
115		compatible = "regulator-fixed";
116		regulator-name = "VCC_1V8";
117		regulator-min-microvolt = <1800000>;
118		regulator-max-microvolt = <1800000>;
119		regulator-always-on;
120		regulator-boot-on;
121	};
122
123	vcc_3v3_mmc: regulator-vcc-3v3-mmc {
124		compatible = "regulator-fixed";
125		regulator-name = "VCC_3V3_MMC";
126		regulator-min-microvolt = <3300000>;
127		regulator-max-microvolt = <3300000>;
128		regulator-always-on;
129		regulator-boot-on;
130	};
131
132	vcc_3v3_sw: regulator-vcc-3v3-sw {
133		compatible = "regulator-fixed";
134		regulator-name = "VCC_3V3_SW";
135		regulator-min-microvolt = <3300000>;
136		regulator-max-microvolt = <3300000>;
137		regulator-always-on;
138		regulator-boot-on;
139	};
140};
141
142&main_pmx0 {
143	audio_ext_refclk1_pins_default: audio-ext-refclk1-default-pins {
144		pinctrl-single,pins = <
145			AM62X_IOPAD(0x0a0, PIN_OUTPUT, 1) /* (K25) GPMC0_WPn.AUDIO_EXT_REFCLK1 */
146		>;
147	};
148
149	gpio_keys_pins_default: gpio-keys-default-pins {
150		pinctrl-single,pins = <
151			AM62X_IOPAD(0x1d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */
152		>;
153	};
154
155	gpio_exp_int_pins_default: gpio-exp-int-default-pins {
156		pinctrl-single,pins = <
157			AM62X_IOPAD(0x244, PIN_INPUT, 7) /* (C17) MMC1_SDWP.GPIO1_49 */
158		>;
159	};
160
161	hdmi_int_pins_default: hdmi-int-default-pins {
162		pinctrl-single,pins = <
163			AM62X_IOPAD(0x040, PIN_INPUT, 7) /* (N23) GPMC0_AD1.GPIO0_16 */
164		>;
165	};
166
167	main_dss0_pins_default: main-dss0-default-pins {
168		pinctrl-single,pins = <
169			AM62X_IOPAD(0x0b8, PIN_OUTPUT, 0) /* (U22) VOUT0_DATA0 */
170			AM62X_IOPAD(0x0bc, PIN_OUTPUT, 0) /* (V24) VOUT0_DATA1 */
171			AM62X_IOPAD(0x0e0, PIN_OUTPUT, 0) /* (V20) VOUT0_DATA10 */
172			AM62X_IOPAD(0x0e4, PIN_OUTPUT, 0) /* (AA23) VOUT0_DATA11 */
173			AM62X_IOPAD(0x0e8, PIN_OUTPUT, 0) /* (AB25) VOUT0_DATA12 */
174			AM62X_IOPAD(0x0ec, PIN_OUTPUT, 0) /* (AA24) VOUT0_DATA13 */
175			AM62X_IOPAD(0x0f0, PIN_OUTPUT, 0) /* (Y22) VOUT0_DATA14 */
176			AM62X_IOPAD(0x0f4, PIN_OUTPUT, 0) /* (AA21) VOUT0_DATA15 */
177			AM62X_IOPAD(0x0c0, PIN_OUTPUT, 0) /* (W25) VOUT0_DATA2 */
178			AM62X_IOPAD(0x0c4, PIN_OUTPUT, 0) /* (W24) VOUT0_DATA3 */
179			AM62X_IOPAD(0x0c8, PIN_OUTPUT, 0) /* (Y25) VOUT0_DATA4 */
180			AM62X_IOPAD(0x0cc, PIN_OUTPUT, 0) /* (Y24) VOUT0_DATA5 */
181			AM62X_IOPAD(0x0d0, PIN_OUTPUT, 0) /* (Y23) VOUT0_DATA6 */
182			AM62X_IOPAD(0x0d4, PIN_OUTPUT, 0) /* (AA25) VOUT0_DATA7 */
183			AM62X_IOPAD(0x0d8, PIN_OUTPUT, 0) /* (V21) VOUT0_DATA8 */
184			AM62X_IOPAD(0x0dc, PIN_OUTPUT, 0) /* (W21) VOUT0_DATA9 */
185			AM62X_IOPAD(0x0fc, PIN_OUTPUT, 0) /* (Y20) VOUT0_DE */
186			AM62X_IOPAD(0x0f8, PIN_OUTPUT, 0) /* (AB24) VOUT0_HSYNC */
187			AM62X_IOPAD(0x104, PIN_OUTPUT, 0) /* (AC24) VOUT0_PCLK */
188			AM62X_IOPAD(0x100, PIN_OUTPUT, 0) /* (AC25) VOUT0_VSYNC */
189		>;
190	};
191
192	main_i2c1_pins_default: main-i2c1-default-pins {
193		pinctrl-single,pins = <
194			AM62X_IOPAD(0x1e8, PIN_INPUT_PULLUP, 0) /* (B17) I2C1_SCL */
195			AM62X_IOPAD(0x1ec, PIN_INPUT_PULLUP, 0) /* (A17) I2C1_SDA */
196		>;
197	};
198
199	main_mcan0_pins_default: main-mcan0-default-pins {
200		pinctrl-single,pins = <
201			AM62X_IOPAD(0x1dc, PIN_INPUT, 0) /* (E15) MCAN0_RX */
202			AM62X_IOPAD(0x1d8, PIN_OUTPUT, 0) /* (C15) MCAN0_TX */
203		>;
204	};
205
206	main_mcasp2_pins_default: main-mcasp2-default-pins {
207		pinctrl-single,pins = <
208			AM62X_IOPAD(0x070, PIN_INPUT, 3) /* (T24) GPMC0_AD13.MCASP2_ACLKX */
209			AM62X_IOPAD(0x06c, PIN_INPUT, 3) /* (T22) GPMC0_AD12.MCASP2_AFSX */
210			AM62X_IOPAD(0x064, PIN_OUTPUT, 3) /* (T25) GPMC0_AD10.MCASP2_AXR2 */
211			AM62X_IOPAD(0x068, PIN_INPUT, 3) /* (R21) GPMC0_AD11.MCASP2_AXR3 */
212		>;
213	};
214
215	main_mmc1_pins_default: main-mmc1-default-pins {
216		pinctrl-single,pins = <
217			AM62X_IOPAD(0x23c, PIN_INPUT_PULLUP, 0) /* (A21) MMC1_CMD */
218			AM62X_IOPAD(0x234, PIN_INPUT_PULLDOWN, 0) /* (B22) MMC1_CLK */
219			AM62X_IOPAD(0x230, PIN_INPUT_PULLUP, 0) /* (A22) MMC1_DAT0 */
220			AM62X_IOPAD(0x22c, PIN_INPUT_PULLUP, 0) /* (B21) MMC1_DAT1 */
221			AM62X_IOPAD(0x228, PIN_INPUT_PULLUP, 0) /* (C21) MMC1_DAT2 */
222			AM62X_IOPAD(0x224, PIN_INPUT_PULLUP, 0) /* (D22) MMC1_DAT3 */
223			AM62X_IOPAD(0x240, PIN_INPUT_PULLUP, 0) /* (D17) MMC1_SDCD */
224		>;
225	};
226
227	main_rgmii2_pins_default: main-rgmii2-default-pins {
228		pinctrl-single,pins = <
229			AM62X_IOPAD(0x184, PIN_INPUT, 0) /* (AE23) RGMII2_RD0 */
230			AM62X_IOPAD(0x188, PIN_INPUT, 0) /* (AB20) RGMII2_RD1 */
231			AM62X_IOPAD(0x18c, PIN_INPUT, 0) /* (AC21) RGMII2_RD2 */
232			AM62X_IOPAD(0x190, PIN_INPUT, 0) /* (AE22) RGMII2_RD3 */
233			AM62X_IOPAD(0x180, PIN_INPUT, 0) /* (AD23) RGMII2_RXC */
234			AM62X_IOPAD(0x17c, PIN_INPUT, 0) /* (AD22) RGMII2_RX_CTL */
235			AM62X_IOPAD(0x16c, PIN_OUTPUT, 0) /* (Y18) RGMII2_TD0 */
236			AM62X_IOPAD(0x170, PIN_OUTPUT, 0) /* (AA18) RGMII2_TD1 */
237			AM62X_IOPAD(0x174, PIN_OUTPUT, 0) /* (AD21) RGMII2_TD2 */
238			AM62X_IOPAD(0x178, PIN_OUTPUT, 0) /* (AC20) RGMII2_TD3 */
239			AM62X_IOPAD(0x168, PIN_OUTPUT, 0) /* (AE21) RGMII2_TXC */
240			AM62X_IOPAD(0x164, PIN_OUTPUT, 0) /* (AA19) RGMII2_TX_CTL */
241		>;
242	};
243
244	main_uart0_pins_default: main-uart0-default-pins {
245		pinctrl-single,pins = <
246			AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */
247			AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */
248		>;
249	};
250
251	main_uart1_pins_default: main-uart1-default-pins {
252		pinctrl-single,pins = <
253			AM62X_IOPAD(0x194, PIN_INPUT, 2) /* (B19) MCASP0_AXR3.UART1_CTSn */
254			AM62X_IOPAD(0x198, PIN_OUTPUT, 2) /* (A19) MCASP0_AXR2.UART1_RTSn */
255			AM62X_IOPAD(0x1ac, PIN_INPUT, 2) /* (E19) MCASP0_AFSR.UART1_RXD */
256			AM62X_IOPAD(0x1b0, PIN_OUTPUT, 2) /* (A20) MCASP0_ACLKR.UART1_TXD */
257		>;
258	};
259
260	main_usb1_pins_default: main-usb1-default-pins {
261		pinctrl-single,pins = <
262			AM62X_IOPAD(0x258, PIN_OUTPUT, 0) /* (F18) USB1_DRVVBUS */
263		>;
264	};
265
266	user_leds_pins_default: user-leds-default-pins {
267		pinctrl-single,pins = <
268			AM62X_IOPAD(0x084, PIN_OUTPUT, 7) /* (L23) GPMC0_ADVn_ALE.GPIO0_32 */
269		>;
270	};
271};
272
273&cpsw3g {
274	pinctrl-names = "default";
275	pinctrl-0 = <&main_rgmii1_pins_default>, <&main_rgmii2_pins_default>;
276};
277
278&cpsw_port2 {
279	phy-mode = "rgmii-rxid";
280	phy-handle = <&cpsw3g_phy3>;
281};
282
283&cpsw3g_mdio {
284	cpsw3g_phy3: ethernet-phy@3 {
285		compatible = "ethernet-phy-id2000.a231", "ethernet-phy-ieee802.3-c22";
286		reg = <3>;
287		ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
288		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
289		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
290	};
291};
292
293&dss {
294	pinctrl-names = "default";
295	pinctrl-0 = <&main_dss0_pins_default>;
296	status = "okay";
297};
298
299&dss_ports {
300	#address-cells = <1>;
301	#size-cells = <0>;
302
303	/* VP2: DPI/HDMI Output */
304	port@1 {
305		reg = <1>;
306
307		dpi1_out: endpoint {
308			remote-endpoint = <&sii9022_in>;
309		};
310	};
311};
312
313&main_i2c1 {
314	pinctrl-names = "default";
315	pinctrl-0 = <&main_i2c1_pins_default>;
316	clock-frequency = <100000>;
317	status = "okay";
318
319	audio_codec: audio-codec@18 {
320		pinctrl-names = "default";
321		pinctrl-0 = <&audio_ext_refclk1_pins_default>;
322
323		#sound-dai-cells = <0>;
324		compatible = "ti,tlv320aic3007";
325		reg = <0x18>;
326		ai3x-micbias-vg = <2>;
327
328		AVDD-supply = <&vcc_3v3_sw>;
329		IOVDD-supply = <&vcc_3v3_sw>;
330		DRVDD-supply = <&vcc_3v3_sw>;
331		DVDD-supply = <&vcc_1v8>;
332	};
333
334	gpio_exp: gpio-expander@21 {
335		pinctrl-names = "default";
336		pinctrl-0 = <&gpio_exp_int_pins_default>;
337		compatible = "nxp,pcf8574";
338		reg = <0x21>;
339		interrupt-parent = <&main_gpio1>;
340		interrupts = <49 0>;
341		#gpio-cells = <2>;
342		gpio-controller;
343		interrupt-controller;
344		#interrupt-cells = <2>;
345		gpio-line-names = "", "GPIO1_CAN0_nEN",
346				  "GPIO2_LED2", "GPIO3_LVDS_GPIO",
347				  "GPIO4_BUT2", "GPIO5_LVDS_BKLT_EN",
348				  "GPIO6_ETH1_USER_RESET", "GPIO7_AUDIO_USER_RESET";
349	};
350
351	usb-pd@22 {
352		compatible = "ti,tps6598x";
353		reg = <0x22>;
354
355		connector {
356			compatible = "usb-c-connector";
357			label = "USB-C";
358			self-powered;
359			data-role = "dual";
360			power-role = "sink";
361			port {
362				usb_con_hs: endpoint {
363					remote-endpoint = <&typec_hs>;
364				};
365			};
366		};
367	};
368
369	sii9022: bridge-hdmi@39 {
370		compatible = "sil,sii9022";
371		reg = <0x39>;
372
373		interrupt-parent = <&main_gpio0>;
374		interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
375		pinctrl-names = "default";
376		pinctrl-0 = <&hdmi_int_pins_default>;
377
378		ports {
379			#address-cells = <1>;
380			#size-cells = <0>;
381
382			port@0 {
383				reg = <0>;
384
385				sii9022_in: endpoint {
386					remote-endpoint = <&dpi1_out>;
387				};
388			};
389
390			port@1 {
391				reg = <1>;
392
393				sii9022_out: endpoint {
394					remote-endpoint = <&hdmi_connector_in>;
395				};
396			};
397		};
398	};
399
400	eeprom@51 {
401		compatible = "atmel,24c02";
402		pagesize = <16>;
403		reg = <0x51>;
404	};
405};
406
407&main_mcan0 {
408	pinctrl-names = "default";
409	pinctrl-0 = <&main_mcan0_pins_default>;
410	phys = <&can_tc1>;
411	status = "okay";
412};
413
414&main_uart0 {
415	pinctrl-names = "default";
416	pinctrl-0 = <&main_uart0_pins_default>;
417	status = "okay";
418};
419
420&main_uart1 {
421	pinctrl-names = "default";
422	pinctrl-0 = <&main_uart1_pins_default>;
423	/* Main UART1 may be used by TIFS firmware */
424	status = "okay";
425};
426
427&mcasp2 {
428	#sound-dai-cells = <0>;
429
430	pinctrl-names = "default";
431	pinctrl-0 = <&main_mcasp2_pins_default>;
432
433	/* MCASP_IIS_MODE */
434	op-mode = <0>;
435	tdm-slots = <2>;
436
437	/* 0: INACTIVE, 1: TX, 2: RX */
438	serial-dir = <
439			0 0 1 2
440			0 0 0 0
441			0 0 0 0
442			0 0 0 0
443	>;
444	tx-num-evt = <32>;
445	rx-num-evt = <32>;
446	status = "okay";
447};
448
449&sdhci1 {
450	vmmc-supply = <&vcc_3v3_mmc>;
451	vqmmc-supply = <&vddshv5_sdio>;
452	pinctrl-names = "default";
453	pinctrl-0 = <&main_mmc1_pins_default>;
454	disable-wp;
455	no-1-8-v;
456	status = "okay";
457};
458
459&usbss0 {
460	ti,vbus-divider;
461	status = "okay";
462};
463
464&usbss1 {
465	ti,vbus-divider;
466	status = "okay";
467};
468
469&usb0 {
470	usb-role-switch;
471
472	port {
473		typec_hs: endpoint {
474			remote-endpoint = <&usb_con_hs>;
475		};
476	};
477};
478
479&usb1 {
480	dr_mode = "host";
481	pinctrl-names = "default";
482	pinctrl-0 = <&main_usb1_pins_default>;
483};
484