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