1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
4 *
5 * EVM Board Schematics: https://www.ti.com/lit/zip/sprr458
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/net/ti-dp83867.h>
11#include <dt-bindings/gpio/gpio.h>
12#include "k3-j784s4.dtsi"
13
14/ {
15	compatible = "ti,j784s4-evm", "ti,j784s4";
16	model = "Texas Instruments J784S4 EVM";
17
18	chosen {
19		stdout-path = "serial2:115200n8";
20	};
21
22	aliases {
23		serial2 = &main_uart8;
24		mmc0 = &main_sdhci0;
25		mmc1 = &main_sdhci1;
26		i2c0 = &main_i2c0;
27	};
28
29	memory@80000000 {
30		device_type = "memory";
31		/* 32G RAM */
32		reg = <0x00 0x80000000 0x00 0x80000000>,
33		      <0x08 0x80000000 0x07 0x80000000>;
34	};
35
36	reserved_memory: reserved-memory {
37		#address-cells = <2>;
38		#size-cells = <2>;
39		ranges;
40
41		secure_ddr: optee@9e800000 {
42			reg = <0x00 0x9e800000 0x00 0x01800000>;
43			no-map;
44		};
45	};
46
47	evm_12v0: regulator-evm12v0 {
48		/* main supply */
49		compatible = "regulator-fixed";
50		regulator-name = "evm_12v0";
51		regulator-min-microvolt = <12000000>;
52		regulator-max-microvolt = <12000000>;
53		regulator-always-on;
54		regulator-boot-on;
55	};
56
57	vsys_3v3: regulator-vsys3v3 {
58		/* Output of LM5140 */
59		compatible = "regulator-fixed";
60		regulator-name = "vsys_3v3";
61		regulator-min-microvolt = <3300000>;
62		regulator-max-microvolt = <3300000>;
63		vin-supply = <&evm_12v0>;
64		regulator-always-on;
65		regulator-boot-on;
66	};
67
68	vsys_5v0: regulator-vsys5v0 {
69		/* Output of LM5140 */
70		compatible = "regulator-fixed";
71		regulator-name = "vsys_5v0";
72		regulator-min-microvolt = <5000000>;
73		regulator-max-microvolt = <5000000>;
74		vin-supply = <&evm_12v0>;
75		regulator-always-on;
76		regulator-boot-on;
77	};
78
79	vdd_mmc1: regulator-sd {
80		/* Output of TPS22918 */
81		compatible = "regulator-fixed";
82		regulator-name = "vdd_mmc1";
83		regulator-min-microvolt = <3300000>;
84		regulator-max-microvolt = <3300000>;
85		regulator-boot-on;
86		enable-active-high;
87		vin-supply = <&vsys_3v3>;
88		gpio = <&exp2 2 GPIO_ACTIVE_HIGH>;
89	};
90
91	vdd_sd_dv: regulator-TLV71033 {
92		/* Output of TLV71033 */
93		compatible = "regulator-gpio";
94		regulator-name = "tlv71033";
95		pinctrl-names = "default";
96		pinctrl-0 = <&vdd_sd_dv_pins_default>;
97		regulator-min-microvolt = <1800000>;
98		regulator-max-microvolt = <3300000>;
99		regulator-boot-on;
100		vin-supply = <&vsys_5v0>;
101		gpios = <&main_gpio0 8 GPIO_ACTIVE_HIGH>;
102		states = <1800000 0x0>,
103			 <3300000 0x1>;
104	};
105};
106
107&main_pmx0 {
108	main_uart8_pins_default: main-uart8-pins-default {
109		pinctrl-single,pins = <
110			J784S4_IOPAD(0x040, PIN_INPUT, 14) /* (AF37) MCASP0_AXR0.UART8_CTSn */
111			J784S4_IOPAD(0x044, PIN_OUTPUT, 14) /* (AG37) MCASP0_AXR1.UART8_RTSn */
112			J784S4_IOPAD(0x0d0, PIN_INPUT, 11) /* (AP38) SPI0_CS1.UART8_RXD */
113			J784S4_IOPAD(0x0d4, PIN_OUTPUT, 11) /* (AN38) SPI0_CLK.UART8_TXD */
114		>;
115	};
116
117	main_i2c0_pins_default: main-i2c0-pins-default {
118		pinctrl-single,pins = <
119			J784S4_IOPAD(0x0e0, PIN_INPUT_PULLUP, 0) /* (AN36) I2C0_SCL */
120			J784S4_IOPAD(0x0e4, PIN_INPUT_PULLUP, 0) /* (AP37) I2C0_SDA */
121		>;
122	};
123
124	main_mmc1_pins_default: main-mmc1-pins-default {
125		pinctrl-single,pins = <
126			J784S4_IOPAD(0x104, PIN_INPUT, 0) /* (AB38) MMC1_CLK */
127			J784S4_IOPAD(0x108, PIN_INPUT, 0) /* (AB36) MMC1_CMD */
128			J784S4_IOPAD(0x100, PIN_INPUT, 0) /* (No Pin) MMC1_CLKLB */
129			J784S4_IOPAD(0x0fc, PIN_INPUT, 0) /* (AA33) MMC1_DAT0 */
130			J784S4_IOPAD(0x0f8, PIN_INPUT, 0) /* (AB34) MMC1_DAT1 */
131			J784S4_IOPAD(0x0f4, PIN_INPUT, 0) /* (AA32) MMC1_DAT2 */
132			J784S4_IOPAD(0x0f0, PIN_INPUT, 0) /* (AC38) MMC1_DAT3 */
133			J784S4_IOPAD(0x0e8, PIN_INPUT, 8) /* (AR38) TIMER_IO0.MMC1_SDCD */
134		>;
135	};
136
137	vdd_sd_dv_pins_default: vdd-sd-dv-pins-default {
138		pinctrl-single,pins = <
139			J784S4_IOPAD(0x020, PIN_INPUT, 7) /* (AJ35) MCAN15_RX.GPIO0_8 */
140		>;
141	};
142};
143
144&wkup_pmx0 {
145	mcu_cpsw_pins_default: mcu-cpsw-pins-default {
146		pinctrl-single,pins = <
147			J784S4_WKUP_IOPAD(0x094, PIN_INPUT, 0) /* (A35) MCU_RGMII1_RD0 */
148			J784S4_WKUP_IOPAD(0x090, PIN_INPUT, 0) /* (B36) MCU_RGMII1_RD1 */
149			J784S4_WKUP_IOPAD(0x08c, PIN_INPUT, 0) /* (C36) MCU_RGMII1_RD2 */
150			J784S4_WKUP_IOPAD(0x088, PIN_INPUT, 0) /* (D36) MCU_RGMII1_RD3 */
151			J784S4_WKUP_IOPAD(0x084, PIN_INPUT, 0) /* (B37) MCU_RGMII1_RXC */
152			J784S4_WKUP_IOPAD(0x06c, PIN_INPUT, 0) /* (C37) MCU_RGMII1_RX_CTL */
153			J784S4_WKUP_IOPAD(0x07c, PIN_OUTPUT, 0) /* (D37) MCU_RGMII1_TD0 */
154			J784S4_WKUP_IOPAD(0x078, PIN_OUTPUT, 0) /* (D38) MCU_RGMII1_TD1 */
155			J784S4_WKUP_IOPAD(0x074, PIN_OUTPUT, 0) /* (E37) MCU_RGMII1_TD2 */
156			J784S4_WKUP_IOPAD(0x070, PIN_OUTPUT, 0) /* (E38) MCU_RGMII1_TD3 */
157			J784S4_WKUP_IOPAD(0x080, PIN_OUTPUT, 0) /* (E36) MCU_RGMII1_TXC */
158			J784S4_WKUP_IOPAD(0x068, PIN_OUTPUT, 0) /* (C38) MCU_RGMII1_TX_CTL */
159		>;
160	};
161
162	mcu_mdio_pins_default: mcu-mdio-pins-default {
163		pinctrl-single,pins = <
164			J784S4_WKUP_IOPAD(0x09c, PIN_OUTPUT, 0) /* (A36) MCU_MDIO0_MDC */
165			J784S4_WKUP_IOPAD(0x098, PIN_INPUT, 0) /* (B35) MCU_MDIO0_MDIO */
166		>;
167	};
168};
169
170&main_uart8 {
171	status = "okay";
172	pinctrl-names = "default";
173	pinctrl-0 = <&main_uart8_pins_default>;
174};
175
176&main_i2c0 {
177	status = "okay";
178	pinctrl-names = "default";
179	pinctrl-0 = <&main_i2c0_pins_default>;
180
181	clock-frequency = <400000>;
182
183	exp1: gpio@20 {
184		compatible = "ti,tca6416";
185		reg = <0x20>;
186		gpio-controller;
187		#gpio-cells = <2>;
188		gpio-line-names = "PCIE1_2L_MODE_SEL", "PCIE1_4L_PERSTZ", "PCIE1_2L_RC_RSTZ",
189				  "PCIE1_2L_EP_RST_EN", "PCIE0_4L_MODE_SEL", "PCIE0_4L_PERSTZ",
190				  "PCIE0_4L_RC_RSTZ", "PCIE0_4L_EP_RST_EN", "PCIE1_4L_PRSNT#",
191				  "PCIE0_4L_PRSNT#", "CDCI1_OE1/OE4", "CDCI1_OE2/OE3",
192				  "AUDIO_MUX_SEL", "EXP_MUX2", "EXP_MUX3", "GESI_EXP_PHY_RSTZ";
193	};
194
195	exp2: gpio@22 {
196		compatible = "ti,tca6424";
197		reg = <0x22>;
198		gpio-controller;
199		#gpio-cells = <2>;
200		gpio-line-names = "R_GPIO_RGMII1_RST", "ENET2_I2CMUX_SEL", "GPIO_USD_PWR_EN",
201				  "USBC_PWR_EN", "USBC_MODE_SEL1", "USBC_MODE_SEL0",
202				  "GPIO_LIN_EN", "R_CAN_STB", "CTRL_PM_I2C_OE#",
203				  "ENET2_EXP_PWRDN", "ENET2_EXP_SPARE2", "CDCI2_RSTZ",
204				  "USB2.0_MUX_SEL", "CANUART_MUX_SEL0", "CANUART_MUX2_SEL1",
205				  "CANUART_MUX1_SEL1", "ENET1_EXP_PWRDN", "ENET1_EXP_RESETZ",
206				  "ENET1_I2CMUX_SEL", "ENET1_EXP_SPARE2", "ENET2_EXP_RESETZ",
207				  "USER_INPUT1", "USER_LED1", "USER_LED2";
208	};
209};
210
211&main_sdhci0 {
212	/* eMMC */
213	status = "okay";
214	non-removable;
215	ti,driver-strength-ohm = <50>;
216	disable-wp;
217};
218
219&main_sdhci1 {
220	/* SD card */
221	status = "okay";
222	pinctrl-0 = <&main_mmc1_pins_default>;
223	pinctrl-names = "default";
224	disable-wp;
225	vmmc-supply = <&vdd_mmc1>;
226	vqmmc-supply = <&vdd_sd_dv>;
227};
228
229&main_gpio0 {
230	status = "okay";
231};
232
233&mcu_cpsw {
234	status = "okay";
235	pinctrl-names = "default";
236	pinctrl-0 = <&mcu_cpsw_pins_default>;
237};
238
239&davinci_mdio {
240	pinctrl-names = "default";
241	pinctrl-0 = <&mcu_mdio_pins_default>;
242
243	mcu_phy0: ethernet-phy@0 {
244		reg = <0>;
245		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
246		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
247		ti,min-output-impedance;
248	};
249};
250
251&mcu_cpsw_port1 {
252	status = "okay";
253	phy-mode = "rgmii-rxid";
254	phy-handle = <&mcu_phy0>;
255};
256