1// SPDX-License-Identifier: GPL-2.0
2/*
3 * AM62A SK: https://www.ti.com/lit/zip/sprr459
4 *
5 * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/leds/common.h>
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/net/ti-dp83867.h>
13#include "k3-am62a7.dtsi"
14
15/ {
16	compatible =  "ti,am62a7-sk", "ti,am62a7";
17	model = "Texas Instruments AM62A7 SK";
18
19	aliases {
20		serial2 = &main_uart0;
21		mmc1 = &sdhci1;
22	};
23
24	chosen {
25		stdout-path = "serial2:115200n8";
26	};
27
28	memory@80000000 {
29		device_type = "memory";
30		/* 2G RAM */
31		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
32	};
33
34	reserved-memory {
35		#address-cells = <2>;
36		#size-cells = <2>;
37		ranges;
38
39		secure_tfa_ddr: tfa@9e780000 {
40			reg = <0x00 0x9e780000 0x00 0x80000>;
41			alignment = <0x1000>;
42			no-map;
43		};
44
45		secure_ddr: optee@9e800000 {
46			reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
47			alignment = <0x1000>;
48			no-map;
49		};
50
51		wkup_r5fss0_core0_memory_region: r5f-dma-memory@9c900000 {
52			compatible = "shared-dma-pool";
53			reg = <0x00 0x9c900000 0x00 0x01e00000>;
54			no-map;
55		};
56	};
57
58	vmain_pd: regulator-0 {
59		/* TPS25750 PD CONTROLLER OUTPUT */
60		compatible = "regulator-fixed";
61		regulator-name = "vmain_pd";
62		regulator-min-microvolt = <5000000>;
63		regulator-max-microvolt = <5000000>;
64		regulator-always-on;
65		regulator-boot-on;
66	};
67
68	vcc_5v0: regulator-1 {
69		/* Output of TPS63070 */
70		compatible = "regulator-fixed";
71		regulator-name = "vcc_5v0";
72		regulator-min-microvolt = <5000000>;
73		regulator-max-microvolt = <5000000>;
74		vin-supply = <&vmain_pd>;
75		regulator-always-on;
76		regulator-boot-on;
77	};
78
79	vcc_3v3_sys: regulator-2 {
80		/* output of LM5141-Q1 */
81		compatible = "regulator-fixed";
82		regulator-name = "vcc_3v3_sys";
83		regulator-min-microvolt = <3300000>;
84		regulator-max-microvolt = <3300000>;
85		vin-supply = <&vmain_pd>;
86		regulator-always-on;
87		regulator-boot-on;
88	};
89
90	vdd_mmc1: regulator-3 {
91		/* TPS22918DBVR */
92		compatible = "regulator-fixed";
93		regulator-name = "vdd_mmc1";
94		regulator-min-microvolt = <3300000>;
95		regulator-max-microvolt = <3300000>;
96		regulator-boot-on;
97		enable-active-high;
98		gpio = <&exp1 3 GPIO_ACTIVE_HIGH>;
99	};
100
101	leds {
102		compatible = "gpio-leds";
103		pinctrl-names = "default";
104		pinctrl-0 = <&usr_led_pins_default>;
105
106		led-0 {
107			label = "am62a-sk:green:heartbeat";
108			gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>;
109			linux,default-trigger = "heartbeat";
110			function = LED_FUNCTION_HEARTBEAT;
111			default-state = "off";
112		};
113	};
114};
115
116&main_pmx0 {
117	main_uart0_pins_default: main-uart0-pins-default {
118		pinctrl-single,pins = <
119			AM62AX_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */
120			AM62AX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */
121		>;
122	};
123
124	main_i2c0_pins_default: main-i2c0-pins-default {
125		pinctrl-single,pins = <
126			AM62AX_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
127			AM62AX_IOPAD(0x1e4, PIN_INPUT_PULLUP, 0) /* (A16) I2C0_SDA */
128		>;
129	};
130
131	main_i2c1_pins_default: main-i2c1-pins-default {
132		pinctrl-single,pins = <
133			AM62AX_IOPAD(0x1e8, PIN_INPUT_PULLUP, 0) /* (B17) I2C1_SCL */
134			AM62AX_IOPAD(0x1ec, PIN_INPUT_PULLUP, 0) /* (A17) I2C1_SDA */
135		>;
136	};
137
138	main_i2c2_pins_default: main-i2c2-pins-default {
139		pinctrl-single,pins = <
140			AM62AX_IOPAD(0x0b0, PIN_INPUT_PULLUP, 1) /* (K22) GPMC0_CSn2.I2C2_SCL */
141			AM62AX_IOPAD(0x0b4, PIN_INPUT_PULLUP, 1) /* (K24) GPMC0_CSn3.I2C2_SDA */
142		>;
143	};
144
145	main_mmc1_pins_default: main-mmc1-pins-default {
146		pinctrl-single,pins = <
147			AM62AX_IOPAD(0x23c, PIN_INPUT, 0) /* (A21) MMC1_CMD */
148			AM62AX_IOPAD(0x234, PIN_INPUT, 0) /* (B22) MMC1_CLK */
149			AM62AX_IOPAD(0x230, PIN_INPUT, 0) /* (A22) MMC1_DAT0 */
150			AM62AX_IOPAD(0x22c, PIN_INPUT, 0) /* (B21) MMC1_DAT1 */
151			AM62AX_IOPAD(0x228, PIN_INPUT, 0) /* (C21) MMC1_DAT2 */
152			AM62AX_IOPAD(0x224, PIN_INPUT, 0) /* (D22) MMC1_DAT3 */
153			AM62AX_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */
154		>;
155	};
156
157	usr_led_pins_default: usr-led-pins-default {
158		pinctrl-single,pins = <
159			AM62AX_IOPAD(0x244, PIN_OUTPUT, 7) /* (D18) MMC1_SDWP.GPIO1_49 */
160		>;
161	};
162
163	main_usb1_pins_default: main-usb1-pins-default {
164		pinctrl-single,pins = <
165			AM62AX_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18) USB1_DRVVBUS */
166		>;
167	};
168
169	main_mdio1_pins_default: main-mdio1-pins-default {
170		pinctrl-single,pins = <
171			AM62AX_IOPAD(0x160, PIN_OUTPUT, 0) /* (V12) MDIO0_MDC */
172			AM62AX_IOPAD(0x15c, PIN_INPUT, 0) /* (V13) MDIO0_MDIO */
173		>;
174	};
175
176	main_rgmii1_pins_default: main-rgmii1-pins-default {
177		pinctrl-single,pins = <
178			AM62AX_IOPAD(0x14c, PIN_INPUT, 0) /* (AB16) RGMII1_RD0 */
179			AM62AX_IOPAD(0x150, PIN_INPUT, 0) /* (V15) RGMII1_RD1 */
180			AM62AX_IOPAD(0x154, PIN_INPUT, 0) /* (W15) RGMII1_RD2 */
181			AM62AX_IOPAD(0x158, PIN_INPUT, 0) /* (V14) RGMII1_RD3 */
182			AM62AX_IOPAD(0x148, PIN_INPUT, 0) /* (AA16) RGMII1_RXC */
183			AM62AX_IOPAD(0x144, PIN_INPUT, 0) /* (AA15) RGMII1_RX_CTL */
184			AM62AX_IOPAD(0x134, PIN_INPUT, 0) /* (Y17) RGMII1_TD0 */
185			AM62AX_IOPAD(0x138, PIN_INPUT, 0) /* (V16) RGMII1_TD1 */
186			AM62AX_IOPAD(0x13c, PIN_INPUT, 0) /* (Y16) RGMII1_TD2 */
187			AM62AX_IOPAD(0x140, PIN_INPUT, 0) /* (AA17) RGMII1_TD3 */
188			AM62AX_IOPAD(0x130, PIN_INPUT, 0) /* (AB17) RGMII1_TXC */
189			AM62AX_IOPAD(0x12c, PIN_INPUT, 0) /* (W16) RGMII1_TX_CTL */
190		>;
191	};
192};
193
194&main_i2c0 {
195	status = "okay";
196	pinctrl-names = "default";
197	pinctrl-0 = <&main_i2c0_pins_default>;
198	clock-frequency = <400000>;
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	exp1: gpio@22 {
208		compatible = "ti,tca6424";
209		reg = <0x22>;
210		gpio-controller;
211		#gpio-cells = <2>;
212
213		gpio-line-names = "GPIO_CPSW2_RST", "GPIO_CPSW1_RST",
214				   "BT_EN_SOC", "MMC1_SD_EN",
215				   "VPP_EN", "EXP_PS_3V3_En",
216				   "EXP_PS_5V0_En", "EXP_HAT_DETECT",
217				   "GPIO_AUD_RSTn", "GPIO_eMMC_RSTn",
218				   "UART1_FET_BUF_EN", "BT_UART_WAKE_SOC",
219				   "GPIO_HDMI_RSTn", "CSI_GPIO0",
220				   "CSI_GPIO1", "WLAN_ALERTn",
221				   "HDMI_INTn", "TEST_GPIO2",
222				   "MCASP1_FET_EN", "MCASP1_BUF_BT_EN",
223				   "MCASP1_FET_SEL", "UART1_FET_SEL",
224				   "PD_I2C_IRQ", "IO_EXP_TEST_LED";
225	};
226};
227
228&sdhci1 {
229	/* SD/MMC */
230	status = "okay";
231	vmmc-supply = <&vdd_mmc1>;
232	pinctrl-names = "default";
233	pinctrl-0 = <&main_mmc1_pins_default>;
234	ti,driver-strength-ohm = <50>;
235	disable-wp;
236};
237
238&main_gpio0 {
239	status = "okay";
240};
241
242&main_gpio1 {
243	status = "okay";
244};
245
246&main_gpio_intr {
247	status = "okay";
248};
249
250&main_uart0 {
251	status = "okay";
252	pinctrl-names = "default";
253	pinctrl-0 = <&main_uart0_pins_default>;
254};
255
256&usbss1 {
257	status = "okay";
258};
259
260&usb1 {
261	dr_mode = "host";
262	pinctrl-names = "default";
263	pinctrl-0 = <&main_usb1_pins_default>;
264};
265
266&cpsw3g {
267	status = "okay";
268	pinctrl-names = "default";
269	pinctrl-0 = <&main_rgmii1_pins_default>;
270};
271
272&cpsw_port1 {
273	status = "okay";
274	phy-mode = "rgmii-rxid";
275	phy-handle = <&cpsw3g_phy0>;
276};
277
278&cpsw_port2 {
279	status = "disabled";
280};
281
282&cpsw3g_mdio {
283	status = "okay";
284	pinctrl-names = "default";
285	pinctrl-0 = <&main_mdio1_pins_default>;
286
287	cpsw3g_phy0: ethernet-phy@0 {
288		reg = <0>;
289		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
290		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
291		ti,min-output-impedance;
292	};
293};
294