1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
4 *
5 * Base Board: https://www.ti.com/lit/zip/SPRR463
6 */
7
8/dts-v1/;
9
10#include "k3-am68-sk-som.dtsi"
11#include <dt-bindings/net/ti-dp83867.h>
12#include <dt-bindings/phy/phy-cadence.h>
13#include <dt-bindings/phy/phy.h>
14#include <dt-bindings/mux/ti-serdes.h>
15
16/ {
17	compatible = "ti,am68-sk", "ti,j721s2";
18	model = "Texas Instruments AM68 SK";
19
20	chosen {
21		stdout-path = "serial2:115200n8";
22	};
23
24	aliases {
25		serial2 = &main_uart8;
26		mmc1 = &main_sdhci1;
27		can0 = &mcu_mcan0;
28		can1 = &mcu_mcan1;
29		can2 = &main_mcan6;
30		can3 = &main_mcan7;
31	};
32
33	vusb_main: regulator-vusb-main5v0 {
34		/* USB MAIN INPUT 5V DC */
35		compatible = "regulator-fixed";
36		regulator-name = "vusb-main5v0";
37		regulator-min-microvolt = <5000000>;
38		regulator-max-microvolt = <5000000>;
39		regulator-always-on;
40		regulator-boot-on;
41	};
42
43	vsys_3v3: regulator-vsys3v3 {
44		/* Output of LM5141 */
45		compatible = "regulator-fixed";
46		regulator-name = "vsys_3v3";
47		regulator-min-microvolt = <3300000>;
48		regulator-max-microvolt = <3300000>;
49		vin-supply = <&vusb_main>;
50		regulator-always-on;
51		regulator-boot-on;
52	};
53
54	vdd_mmc1: regulator-sd {
55		/* Output of TPS22918 */
56		compatible = "regulator-fixed";
57		regulator-name = "vdd_mmc1";
58		regulator-min-microvolt = <3300000>;
59		regulator-max-microvolt = <3300000>;
60		regulator-boot-on;
61		enable-active-high;
62		vin-supply = <&vsys_3v3>;
63		gpio = <&exp1 10 GPIO_ACTIVE_HIGH>;
64	};
65
66	vdd_sd_dv: regulator-tlv71033 {
67		/* Output of TLV71033 */
68		compatible = "regulator-gpio";
69		regulator-name = "tlv71033";
70		pinctrl-names = "default";
71		pinctrl-0 = <&vdd_sd_dv_pins_default>;
72		regulator-min-microvolt = <1800000>;
73		regulator-max-microvolt = <3300000>;
74		regulator-boot-on;
75		vin-supply = <&vsys_3v3>;
76		gpios = <&main_gpio0 49 GPIO_ACTIVE_HIGH>;
77		states = <1800000 0x0>,
78			 <3300000 0x1>;
79	};
80
81	vsys_io_1v8: regulator-vsys-io-1v8 {
82		compatible = "regulator-fixed";
83		regulator-name = "vsys_io_1v8";
84		regulator-min-microvolt = <1800000>;
85		regulator-max-microvolt = <1800000>;
86		regulator-always-on;
87		regulator-boot-on;
88	};
89
90	vsys_io_1v2: regulator-vsys-io-1v2 {
91		compatible = "regulator-fixed";
92		regulator-name = "vsys_io_1v2";
93		regulator-min-microvolt = <1200000>;
94		regulator-max-microvolt = <1200000>;
95		regulator-always-on;
96		regulator-boot-on;
97	};
98
99	transceiver1: can-phy0 {
100		compatible = "ti,tcan1042";
101		#phy-cells = <0>;
102		max-bitrate = <5000000>;
103	};
104
105	transceiver2: can-phy1 {
106		compatible = "ti,tcan1042";
107		#phy-cells = <0>;
108		max-bitrate = <5000000>;
109	};
110
111	transceiver3: can-phy2 {
112		compatible = "ti,tcan1042";
113		#phy-cells = <0>;
114		max-bitrate = <5000000>;
115	};
116
117	transceiver4: can-phy3 {
118		compatible = "ti,tcan1042";
119		#phy-cells = <0>;
120		max-bitrate = <5000000>;
121	};
122};
123
124&main_pmx0 {
125	main_uart8_pins_default: main-uart8-pins-default {
126		pinctrl-single,pins = <
127			J721S2_IOPAD(0x0d0, PIN_INPUT, 11) /* (AF26) SPI0_CS1.UART8_RXD */
128			J721S2_IOPAD(0x0d4, PIN_OUTPUT, 11) /* (AH27) SPI0_CLK.UART8_TXD */
129		>;
130	};
131
132	main_i2c0_pins_default: main-i2c0-pins-default {
133		pinctrl-single,pins = <
134			J721S2_IOPAD(0x0e0, PIN_INPUT, 0) /* (AH25) I2C0_SCL */
135			J721S2_IOPAD(0x0e4, PIN_INPUT, 0) /* (AE24) I2C0_SDA */
136		>;
137	};
138
139	main_mmc1_pins_default: main-mmc1-pins-default {
140		pinctrl-single,pins = <
141			J721S2_IOPAD(0x104, PIN_INPUT, 0) /* (P23) MMC1_CLK */
142			J721S2_IOPAD(0x108, PIN_INPUT, 0) /* (N24) MMC1_CMD */
143			J721S2_IOPAD(0x0fc, PIN_INPUT, 0) /* (M23) MMC1_DAT0 */
144			J721S2_IOPAD(0x0f8, PIN_INPUT, 0) /* (P24) MMC1_DAT1 */
145			J721S2_IOPAD(0x0f4, PIN_INPUT, 0) /* (R24) MMC1_DAT2 */
146			J721S2_IOPAD(0x0f0, PIN_INPUT, 0) /* (R22) MMC1_DAT3 */
147			J721S2_IOPAD(0x0e8, PIN_INPUT, 8) /* (AE25) TIMER_IO0.MMC1_SDCD */
148		>;
149	};
150
151	vdd_sd_dv_pins_default: vdd-sd-dv-pins-default {
152		pinctrl-single,pins = <
153			J721S2_IOPAD(0x0c4, PIN_INPUT, 7) /* (AB26) ECAP0_IN_APWM_OUT.GPIO0_49 */
154		>;
155	};
156
157	main_usbss0_pins_default: main-usbss0-pins-default {
158		pinctrl-single,pins = <
159			J721S2_IOPAD(0x0ec, PIN_OUTPUT, 6) /* (AG25) TIMER_IO1.USB0_DRVVBUS */
160		>;
161	};
162
163	main_mcan6_pins_default: main-mcan6-pins-default {
164		pinctrl-single,pins = <
165			J721S2_IOPAD(0x098, PIN_INPUT, 0) /* (V25) MCASP0_AXR10.MCAN6_RX */
166			J721S2_IOPAD(0x094, PIN_INPUT, 0) /* (AA25) MCASP0_AXR9.MCAN6_TX */
167		>;
168	};
169
170	main_mcan7_pins_default: main-mcan7-pins-default {
171		pinctrl-single,pins = <
172			J721S2_IOPAD(0x0a0, PIN_INPUT, 0) /* (AB25) MCASP0_AXR12.MCAN7_RX */
173			J721S2_IOPAD(0x09c, PIN_INPUT, 0) /* (T24) MCASP0_AXR11.MCAN7_TX */
174		>;
175	};
176};
177
178&wkup_pmx0 {
179	mcu_cpsw_pins_default: mcu-cpsw-pins-default {
180		pinctrl-single,pins = <
181			J721S2_WKUP_IOPAD(0x094, PIN_INPUT, 0) /* (B22) MCU_RGMII1_RD0 */
182			J721S2_WKUP_IOPAD(0x090, PIN_INPUT, 0) /* (B21) MCU_RGMII1_RD1 */
183			J721S2_WKUP_IOPAD(0x08c, PIN_INPUT, 0) /* (C22) MCU_RGMII1_RD2 */
184			J721S2_WKUP_IOPAD(0x088, PIN_INPUT, 0) /* (D23) MCU_RGMII1_RD3 */
185			J721S2_WKUP_IOPAD(0x084, PIN_INPUT, 0) /* (D22) MCU_RGMII1_RXC */
186			J721S2_WKUP_IOPAD(0x06c, PIN_INPUT, 0) /* (E23) MCU_RGMII1_RX_CTL */
187			J721S2_WKUP_IOPAD(0x07c, PIN_OUTPUT, 0) /* (F23) MCU_RGMII1_TD0 */
188			J721S2_WKUP_IOPAD(0x078, PIN_OUTPUT, 0) /* (G22) MCU_RGMII1_TD1 */
189			J721S2_WKUP_IOPAD(0x074, PIN_OUTPUT, 0) /* (E21) MCU_RGMII1_TD2 */
190			J721S2_WKUP_IOPAD(0x070, PIN_OUTPUT, 0) /* (E22) MCU_RGMII1_TD3 */
191			J721S2_WKUP_IOPAD(0x080, PIN_OUTPUT, 0) /* (F21) MCU_RGMII1_TXC */
192			J721S2_WKUP_IOPAD(0x068, PIN_OUTPUT, 0) /* (F22) MCU_RGMII1_TX_CTL */
193		>;
194	};
195
196	mcu_mdio_pins_default: mcu-mdio-pins-default {
197		pinctrl-single,pins = <
198			J721S2_WKUP_IOPAD(0x09c, PIN_OUTPUT, 0) /* (A21) MCU_MDIO0_MDC */
199			J721S2_WKUP_IOPAD(0x098, PIN_INPUT, 0) /* (A22) MCU_MDIO0_MDIO */
200		>;
201	};
202
203	mcu_mcan0_pins_default: mcu-mcan0-pins-default {
204		pinctrl-single,pins = <
205			J721S2_WKUP_IOPAD(0x0bc, PIN_INPUT, 0) /* (E28) MCU_MCAN0_RX */
206			J721S2_WKUP_IOPAD(0x0b8, PIN_OUTPUT, 0) /* (E27) MCU_MCAN0_TX */
207		>;
208	};
209
210	mcu_mcan1_pins_default: mcu-mcan1-pins-default {
211		pinctrl-single,pins = <
212			J721S2_WKUP_IOPAD(0x0d4, PIN_INPUT, 0) /* (F26) WKUP_GPIO0_5.MCU_MCAN1_RX */
213			J721S2_WKUP_IOPAD(0x0d0, PIN_OUTPUT, 0) /* (C23) WKUP_GPIO0_4.MCU_MCAN1_TX*/
214		>;
215	};
216
217	mcu_i2c1_pins_default: mcu-i2c1-pins-default {
218		pinctrl-single,pins = <
219			J721S2_WKUP_IOPAD(0x0e0, PIN_INPUT, 0) /* (F24) WKUP_GPIO0_8.MCU_I2C1_SCL */
220			J721S2_WKUP_IOPAD(0x0e4, PIN_INPUT, 0) /* (H26) WKUP_GPIO0_9.MCU_I2C1_SDA */
221		>;
222	};
223};
224
225&main_gpio2 {
226	status = "disabled";
227};
228
229&main_gpio4 {
230	status = "disabled";
231};
232
233&main_gpio6 {
234	status = "disabled";
235};
236
237&wkup_gpio0 {
238	status = "disabled";
239};
240
241&wkup_gpio1 {
242	status = "disabled";
243};
244
245&wkup_uart0 {
246	status = "reserved";
247};
248
249&main_uart8 {
250	status = "okay";
251	pinctrl-names = "default";
252	pinctrl-0 = <&main_uart8_pins_default>;
253	/* Shared with TFA on this platform */
254	power-domains = <&k3_pds 357 TI_SCI_PD_SHARED>;
255};
256
257&main_i2c0 {
258	pinctrl-names = "default";
259	pinctrl-0 = <&main_i2c0_pins_default>;
260	clock-frequency = <400000>;
261
262	exp1: gpio@21 {
263		compatible = "ti,tca6416";
264		reg = <0x21>;
265		gpio-controller;
266		#gpio-cells = <2>;
267		gpio-line-names = "CSI_VIO_SEL", "CSI_SEL_FPC_EXPn", "HDMI_PDn",
268					"HDMI_LS_OE", "DP0_3V3 _EN", "BOARDID_EEPROM_WP",
269					"CAN_STB", " ", "GPIO_uSD_PWR_EN", "eDP_ENABLE",
270					"IO_EXP_PCIe1_M.2_RTSz", "IO_EXP_MCU_RGMII_RSTz",
271					"IO_EXP_CSI2_EXP_RSTz", " ", "CSI0_B_GPIO1",
272					"CSI1_B_GPIO1";
273	};
274};
275
276&main_sdhci0 {
277	/* Unused */
278	status = "disabled";
279};
280
281&main_sdhci1 {
282	/* SD card */
283	pinctrl-0 = <&main_mmc1_pins_default>;
284	pinctrl-names = "default";
285	disable-wp;
286	vmmc-supply = <&vdd_mmc1>;
287	vqmmc-supply = <&vdd_sd_dv>;
288};
289
290&mcu_cpsw {
291	pinctrl-names = "default";
292	pinctrl-0 = <&mcu_cpsw_pins_default &mcu_mdio_pins_default>;
293};
294
295&davinci_mdio {
296	phy0: ethernet-phy@0 {
297		reg = <0>;
298		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
299		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
300		ti,min-output-impedance;
301	};
302};
303
304&cpsw_port1 {
305	phy-mode = "rgmii-rxid";
306	phy-handle = <&phy0>;
307};
308
309&mcu_mcan0 {
310	status = "okay";
311	pinctrl-names = "default";
312	pinctrl-0 = <&mcu_mcan0_pins_default>;
313	phys = <&transceiver1>;
314};
315
316&mcu_mcan1 {
317	status = "okay";
318	pinctrl-names = "default";
319	pinctrl-0 = <&mcu_mcan1_pins_default>;
320	phys = <&transceiver2>;
321};
322
323&main_mcan6 {
324	status = "okay";
325	pinctrl-names = "default";
326	pinctrl-0 = <&main_mcan6_pins_default>;
327	phys = <&transceiver3>;
328};
329
330&main_mcan7 {
331	status = "okay";
332	pinctrl-names = "default";
333	pinctrl-0 = <&main_mcan7_pins_default>;
334	phys = <&transceiver4>;
335};
336