1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/leds/common.h>
9#include "k3-am642.dtsi"
10
11/ {
12	compatible =  "ti,am642-evm", "ti,am642";
13	model = "Texas Instruments AM642 EVM";
14
15	chosen {
16		stdout-path = "serial2:115200n8";
17		bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
18	};
19
20	memory@80000000 {
21		device_type = "memory";
22		/* 2G RAM */
23		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
24
25	};
26
27	reserved-memory {
28		#address-cells = <2>;
29		#size-cells = <2>;
30		ranges;
31
32		secure_ddr: optee@9e800000 {
33			reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
34			alignment = <0x1000>;
35			no-map;
36		};
37	};
38
39	evm_12v0: fixedregulator-evm12v0 {
40		/* main DC jack */
41		compatible = "regulator-fixed";
42		regulator-name = "evm_12v0";
43		regulator-min-microvolt = <12000000>;
44		regulator-max-microvolt = <12000000>;
45		regulator-always-on;
46		regulator-boot-on;
47	};
48
49	vsys_5v0: fixedregulator-vsys5v0 {
50		/* output of LM5140 */
51		compatible = "regulator-fixed";
52		regulator-name = "vsys_5v0";
53		regulator-min-microvolt = <5000000>;
54		regulator-max-microvolt = <5000000>;
55		vin-supply = <&evm_12v0>;
56		regulator-always-on;
57		regulator-boot-on;
58	};
59
60	vsys_3v3: fixedregulator-vsys3v3 {
61		/* output of LM5140 */
62		compatible = "regulator-fixed";
63		regulator-name = "vsys_3v3";
64		regulator-min-microvolt = <3300000>;
65		regulator-max-microvolt = <3300000>;
66		vin-supply = <&evm_12v0>;
67		regulator-always-on;
68		regulator-boot-on;
69	};
70
71	vdd_mmc1: fixed-regulator-sd {
72		/* TPS2051BD */
73		compatible = "regulator-fixed";
74		regulator-name = "vdd_mmc1";
75		regulator-min-microvolt = <3300000>;
76		regulator-max-microvolt = <3300000>;
77		regulator-boot-on;
78		enable-active-high;
79		vin-supply = <&vsys_3v3>;
80		gpio = <&exp1 6 GPIO_ACTIVE_HIGH>;
81	};
82
83	vddb: fixedregulator-vddb {
84		compatible = "regulator-fixed";
85		regulator-name = "vddb_3v3_display";
86		regulator-min-microvolt = <3300000>;
87		regulator-max-microvolt = <3300000>;
88		vin-supply = <&vsys_3v3>;
89		regulator-always-on;
90		regulator-boot-on;
91	};
92
93	leds {
94		compatible = "gpio-leds";
95
96		led-0 {
97			label = "am64-evm:red:heartbeat";
98			gpios = <&exp1 16 GPIO_ACTIVE_HIGH>;
99			linux,default-trigger = "heartbeat";
100			function = LED_FUNCTION_HEARTBEAT;
101			default-state = "off";
102		};
103	};
104};
105
106&main_pmx0 {
107	main_mmc1_pins_default: main-mmc1-pins-default {
108		pinctrl-single,pins = <
109			AM64X_IOPAD(0x0294, PIN_INPUT_PULLUP, 0) /* (J19) MMC1_CMD */
110			AM64X_IOPAD(0x028c, PIN_INPUT_PULLDOWN, 0) /* (L20) MMC1_CLK */
111			AM64X_IOPAD(0x0288, PIN_INPUT_PULLUP, 0) /* (K21) MMC1_DAT0 */
112			AM64X_IOPAD(0x0284, PIN_INPUT_PULLUP, 0) /* (L21) MMC1_DAT1 */
113			AM64X_IOPAD(0x0280, PIN_INPUT_PULLUP, 0) /* (K19) MMC1_DAT2 */
114			AM64X_IOPAD(0x027c, PIN_INPUT_PULLUP, 0) /* (K18) MMC1_DAT3 */
115			AM64X_IOPAD(0x0298, PIN_INPUT_PULLUP, 0) /* (D19) MMC1_SDCD */
116			AM64X_IOPAD(0x029c, PIN_INPUT, 0) /* (C20) MMC1_SDWP */
117			AM64X_IOPAD(0x0290, PIN_INPUT, 0) /* MMC1_CLKLB */
118		>;
119	};
120
121	main_uart0_pins_default: main-uart0-pins-default {
122		pinctrl-single,pins = <
123			AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */
124			AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */
125			AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */
126			AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */
127		>;
128	};
129
130	main_i2c1_pins_default: main-i2c1-pins-default {
131		pinctrl-single,pins = <
132			AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */
133			AM64X_IOPAD(0x026c, PIN_INPUT_PULLUP, 0) /* (B19) I2C1_SDA */
134		>;
135	};
136};
137
138&main_uart0 {
139	pinctrl-names = "default";
140	pinctrl-0 = <&main_uart0_pins_default>;
141};
142
143/* main_uart1 is reserved for firmware usage */
144&main_uart1 {
145	status = "reserved";
146};
147
148&main_uart2 {
149	status = "disabled";
150};
151
152&main_uart3 {
153	status = "disabled";
154};
155
156&main_uart4 {
157	status = "disabled";
158};
159
160&main_uart5 {
161	status = "disabled";
162};
163
164&main_uart6 {
165	status = "disabled";
166};
167
168&mcu_uart0 {
169	status = "disabled";
170};
171
172&mcu_uart1 {
173	status = "disabled";
174};
175
176&main_i2c1 {
177	pinctrl-names = "default";
178	pinctrl-0 = <&main_i2c1_pins_default>;
179	clock-frequency = <400000>;
180
181	exp1: gpio@22 {
182		compatible = "ti,tca6424";
183		reg = <0x22>;
184		gpio-controller;
185		#gpio-cells = <2>;
186		gpio-line-names = "GPIO_eMMC_RSTn", "CAN_MUX_SEL",
187				  "GPIO_CPSW1_RST", "GPIO_RGMII1_RST",
188				  "GPIO_RGMII2_RST", "GPIO_PCIe_RST_OUT",
189				  "MMC1_SD_EN", "FSI_FET_SEL",
190				  "MCAN0_STB_3V3", "MCAN1_STB_3V3",
191				  "CPSW_FET_SEL", "CPSW_FET2_SEL",
192				  "PRG1_RGMII2_FET_SEL", "TEST_GPIO2",
193				  "GPIO_OLED_RESETn", "VPP_LDO_EN",
194				  "TEST_LED1", "TP92", "TP90", "TP88",
195				  "TP87", "TP86", "TP89", "TP91";
196	};
197
198	/* osd9616p0899-10 */
199	display@3c {
200		compatible = "solomon,ssd1306fb-i2c";
201		reg = <0x3c>;
202		reset-gpios = <&exp1 14 GPIO_ACTIVE_LOW>;
203		vbat-supply = <&vddb>;
204		solomon,height = <16>;
205		solomon,width = <96>;
206		solomon,com-seq;
207		solomon,com-invdir;
208		solomon,page-offset = <0>;
209		solomon,prechargep1 = <2>;
210		solomon,prechargep2 = <13>;
211	};
212};
213
214&mcu_i2c0 {
215	status = "disabled";
216};
217
218&mcu_i2c1 {
219	status = "disabled";
220};
221
222&mcu_spi0 {
223	status = "disabled";
224};
225
226&mcu_spi1 {
227	status = "disabled";
228};
229
230&sdhci0 {
231	/* emmc */
232	bus-width = <8>;
233	non-removable;
234	ti,driver-strength-ohm = <50>;
235	disable-wp;
236};
237
238&sdhci1 {
239	/* SD/MMC */
240	vmmc-supply = <&vdd_mmc1>;
241	pinctrl-names = "default";
242	bus-width = <4>;
243	pinctrl-0 = <&main_mmc1_pins_default>;
244	ti,driver-strength-ohm = <50>;
245	disable-wp;
246};
247