xref: /linux/arch/arm64/boot/dts/ti/k3-am642-phyboard-electra-rdk.dts (revision a3a02a52bcfcbcc4a637d4b68bf1bc391c9fad02)
1// SPDX-License-Identifier: GPL-2.0-only OR MIT
2/*
3 * Copyright (C) 2021-2024 PHYTEC America, LLC - https://www.phytec.com
4 * Author: Matt McKee <mmckee@phytec.com>
5 *
6 * Copyright (C) 2022-2024 PHYTEC Messtechnik GmbH
7 * Author: Wadim Egorov <w.egorov@phytec.de>
8 *
9 * Product homepage:
10 * https://www.phytec.com/product/phyboard-am64x
11 */
12
13/dts-v1/;
14
15#include <dt-bindings/gpio/gpio.h>
16#include <dt-bindings/input/input.h>
17#include <dt-bindings/leds/common.h>
18#include <dt-bindings/leds/leds-pca9532.h>
19#include <dt-bindings/phy/phy.h>
20#include "k3-am642.dtsi"
21#include "k3-am64-phycore-som.dtsi"
22
23#include "k3-serdes.h"
24
25/ {
26	compatible = "phytec,am642-phyboard-electra-rdk",
27		     "phytec,am64-phycore-som", "ti,am642";
28	model = "PHYTEC phyBOARD-Electra-AM64x RDK";
29
30	aliases {
31		mmc1 = &sdhci1;
32		serial2 = &main_uart0;
33		serial3 = &main_uart1;
34	};
35
36	chosen {
37		stdout-path = &main_uart0;
38	};
39
40	can_tc1: can-phy0 {
41		compatible = "ti,tcan1042";
42		pinctrl-names = "default";
43		pinctrl-0 = <&can_tc1_pins_default>;
44		#phy-cells = <0>;
45		max-bitrate = <8000000>;
46		standby-gpios = <&main_gpio0 32 GPIO_ACTIVE_HIGH>;
47	};
48
49	can_tc2: can-phy1 {
50		compatible = "ti,tcan1042";
51		pinctrl-names = "default";
52		pinctrl-0 = <&can_tc2_pins_default>;
53		#phy-cells = <0>;
54		max-bitrate = <8000000>;
55		standby-gpios = <&main_gpio0 35 GPIO_ACTIVE_HIGH>;
56	};
57
58	keys {
59		compatible = "gpio-keys";
60		autorepeat;
61		pinctrl-names = "default";
62		pinctrl-0 = <&gpio_keys_pins_default>;
63
64		key-home {
65			label = "home";
66			linux,code = <KEY_HOME>;
67			gpios = <&main_gpio0 17 GPIO_ACTIVE_HIGH>;
68		};
69
70		key-menu {
71			label = "menu";
72			linux,code = <KEY_MENU>;
73			gpios = <&main_gpio0 21 GPIO_ACTIVE_HIGH>;
74		};
75	};
76
77	leds {
78		compatible = "gpio-leds";
79		pinctrl-names = "default";
80		pinctrl-0 = <&leds_pins_default>, <&user_leds_pins_default>;
81
82		led-1 {
83			color = <LED_COLOR_ID_RED>;
84			gpios = <&main_gpio0 15 GPIO_ACTIVE_HIGH>;
85			linux,default-trigger = "mmc0";
86			function = LED_FUNCTION_DISK;
87		};
88
89		led-2 {
90			color = <LED_COLOR_ID_GREEN>;
91			gpios = <&main_gpio0 16 GPIO_ACTIVE_HIGH>;
92			linux,default-trigger = "mmc1";
93			function = LED_FUNCTION_DISK;
94		};
95	};
96
97	vcc_3v3_mmc: regulator-sd {
98		/* TPS22963C */
99		compatible = "regulator-fixed";
100		regulator-name = "VCC_3V3_MMC";
101		regulator-min-microvolt = <3300000>;
102		regulator-max-microvolt = <3300000>;
103		regulator-boot-on;
104		regulator-always-on;
105	};
106};
107
108&main_pmx0 {
109	can_tc1_pins_default: can-tc1-default-pins {
110		pinctrl-single,pins = <
111			AM64X_IOPAD(0x0084, PIN_OUTPUT, 7)	/* (P16) GPMC0_ADVn_ALE.GPIO0_32 */
112		>;
113	};
114
115	can_tc2_pins_default: can-tc2-default-pins {
116		pinctrl-single,pins = <
117			AM64X_IOPAD(0x0090, PIN_OUTPUT, 7)	/* (P17) GPMC0_BE0n_CLE.GPIO0_35 */
118		>;
119	};
120
121	gpio_keys_pins_default: gpio-keys-default-pins {
122		pinctrl-single,pins = <
123			AM64X_IOPAD(0x0044, PIN_INPUT, 7)	/* (T18) GPMC0_AD2.GPIO0_17 */
124			AM64X_IOPAD(0x0054, PIN_INPUT, 7)	/* (V20) GPMC0_AD6.GPIO0_21 */
125		>;
126	};
127
128	main_i2c1_pins_default: main-i2c1-default-pins {
129		pinctrl-single,pins = <
130			AM64X_IOPAD(0x0268, PIN_INPUT, 0)	/* (C18) I2C1_SCL */
131			AM64X_IOPAD(0x026c, PIN_INPUT, 0)	/* (B19) I2C1_SDA */
132		>;
133	};
134
135	main_mcan0_pins_default: main-mcan0-default-pins {
136		pinctrl-single,pins = <
137			AM64X_IOPAD(0x0250, PIN_OUTPUT, 0)	/* (A17) MCAN0_TX */
138			AM64X_IOPAD(0x0254, PIN_INPUT, 0)	/* (B17) MCAN0_RX */
139		>;
140	};
141
142	main_mcan1_pins_default: main-mcan1-default-pins {
143		pinctrl-single,pins = <
144			AM64X_IOPAD(0x0258, PIN_OUTPUT, 0)	/* (C17) MCAN1_TX */
145			AM64X_IOPAD(0x025c, PIN_INPUT, 0)	/* (D17) MCAN1_RX */
146		>;
147	};
148
149	main_mmc1_pins_default: main-mmc1-default-pins {
150		pinctrl-single,pins = <
151			AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0)	/* (K18) MMC1_DAT3 */
152			AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0)	/* (K19) MMC1_DAT2 */
153			AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0)	/* (L21) MMC1_DAT1 */
154			AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0)	/* (K21) MMC1_DAT0 */
155			AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0)	/* (L20) MMC1_CLK */
156			AM64X_IOPAD(0x0290, PIN_INPUT, 0)		/* MMC1_CLKLB */
157			AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0)	/* (J19) MMC1_CMD */
158			AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0)	/* (D19) MMC1_SDCD */
159		>;
160	};
161
162	main_spi0_pins_default: main-spi0-default-pins {
163		pinctrl-single,pins = <
164			AM64X_IOPAD(0x020c, PIN_OUTPUT, 7)	/* (C13) SPI0_CS1.GPIO1_43 */
165			AM64X_IOPAD(0x0210, PIN_INPUT, 0)	/* (D13) SPI0_CLK */
166			AM64X_IOPAD(0x0214, PIN_OUTPUT, 0)	/* (A13) SPI0_D0 */
167			AM64X_IOPAD(0x0218, PIN_INPUT, 0)	/* (A14) SPI0_D1 */
168		>;
169	};
170
171	main_uart0_pins_default: main-uart0-default-pins {
172		pinctrl-single,pins = <
173			AM64X_IOPAD(0x0230, PIN_INPUT, 0)	/* (D15) UART0_RXD */
174			AM64X_IOPAD(0x0234, PIN_OUTPUT, 0)	/* (C16) UART0_TXD */
175		>;
176	};
177
178	main_uart1_pins_default: main-uart1-default-pins {
179		pinctrl-single,pins = <
180			AM64X_IOPAD(0x0248, PIN_INPUT, 0)	/* (D16) UART1_CTSn */
181			AM64X_IOPAD(0x024C, PIN_OUTPUT, 0)	/* (E16) UART1_RTSn */
182			AM64X_IOPAD(0x0240, PIN_INPUT, 0)	/* (E15) UART1_RXD */
183			AM64X_IOPAD(0x0244, PIN_OUTPUT, 0)	/* (E14) UART1_TXD */
184		>;
185	};
186
187	main_usb0_pins_default: main-usb0-default-pins {
188		pinctrl-single,pins = <
189			AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0)	/* (E19) USB0_DRVVBUS */
190		>;
191	};
192
193	user_leds_pins_default: user-leds-default-pins {
194		pinctrl-single,pins = <
195			AM64X_IOPAD(0x003c, PIN_OUTPUT, 7)	/* (T20) GPMC0_AD0.GPIO0_15 */
196			AM64X_IOPAD(0x0040, PIN_OUTPUT, 7)	/* (U21) GPMC0_AD1.GPIO0_16 */
197		>;
198	};
199};
200
201&main_i2c1 {
202	status = "okay";
203	pinctrl-names = "default";
204	pinctrl-0 = <&main_i2c1_pins_default>;
205	clock-frequency = <400000>;
206
207	eeprom@51 {
208		compatible = "atmel,24c02";
209		pagesize = <16>;
210		reg = <0x51>;
211	};
212
213	led-controller@62 {
214		compatible = "nxp,pca9533";
215		reg = <0x62>;
216
217		led-3 {
218			label = "red:user";
219			type = <PCA9532_TYPE_LED>;
220		};
221
222		led-4 {
223			label = "green:user";
224			type = <PCA9532_TYPE_LED>;
225		};
226
227		led-5 {
228			label = "blue:user";
229			type = <PCA9532_TYPE_LED>;
230		};
231	};
232};
233
234&main_mcan0 {
235	status = "okay";
236	pinctrl-names = "default";
237	pinctrl-0 = <&main_mcan0_pins_default>;
238	phys = <&can_tc1>;
239};
240
241&main_mcan1 {
242	status = "okay";
243	pinctrl-names = "default";
244	pinctrl-0 = <&main_mcan1_pins_default>;
245	phys = <&can_tc2>;
246};
247
248&main_spi0 {
249	status = "okay";
250	pinctrl-names = "default";
251	pinctrl-0 = <&main_spi0_pins_default>;
252	cs-gpios = <0>, <&main_gpio1 43 GPIO_ACTIVE_LOW>;
253	ti,pindir-d0-out-d1-in;
254
255	tpm@1 {
256		compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
257		reg = <1>;
258		spi-max-frequency = <10000000>;
259	};
260};
261
262&main_uart0 {
263	status = "okay";
264	pinctrl-names = "default";
265	pinctrl-0 = <&main_uart0_pins_default>;
266};
267
268&main_uart1 {
269	status = "okay";
270	pinctrl-names = "default";
271	pinctrl-0 = <&main_uart1_pins_default>;
272	uart-has-rtscts;
273};
274
275&sdhci1 {
276	status = "okay";
277	vmmc-supply = <&vcc_3v3_mmc>;
278	pinctrl-names = "default";
279	pinctrl-0 = <&main_mmc1_pins_default>;
280	bus-width = <4>;
281	disable-wp;
282	no-1-8-v;
283};
284
285&serdes0 {
286	serdes0_pcie_usb_link: phy@0 {
287		reg = <0>;
288		cdns,num-lanes = <1>;
289		#phy-cells = <0>;
290		cdns,phy-type = <PHY_TYPE_USB3>;
291		resets = <&serdes_wiz0 1>;
292	};
293};
294
295&serdes_ln_ctrl {
296	idle-states = <AM64_SERDES0_LANE0_USB>;
297};
298
299&usbss0 {
300	ti,vbus-divider;
301};
302
303&usb0 {
304	pinctrl-names = "default";
305	pinctrl-0 = <&main_usb0_pins_default>;
306	dr_mode = "host";
307	maximum-speed = "super-speed";
308	phys = <&serdes0_pcie_usb_link>;
309	phy-names = "cdns3,usb3-phy";
310};
311