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 "k3-am62a7.dtsi"
13
14/ {
15	compatible =  "ti,am62a7-sk", "ti,am62a7";
16	model = "Texas Instruments AM62A7 SK";
17
18	aliases {
19		serial2 = &main_uart0;
20		mmc1 = &sdhci1;
21	};
22
23	chosen {
24		stdout-path = "serial2:115200n8";
25	};
26
27	memory@80000000 {
28		device_type = "memory";
29		/* 2G RAM */
30		reg = <0x00000000 0x80000000 0x00000000 0x80000000>;
31	};
32
33	reserved-memory {
34		#address-cells = <2>;
35		#size-cells = <2>;
36		ranges;
37
38		secure_tfa_ddr: tfa@9e780000 {
39			reg = <0x00 0x9e780000 0x00 0x80000>;
40			alignment = <0x1000>;
41			no-map;
42		};
43
44		secure_ddr: optee@9e800000 {
45			reg = <0x00 0x9e800000 0x00 0x01800000>; /* for OP-TEE */
46			alignment = <0x1000>;
47			no-map;
48		};
49
50		wkup_r5fss0_core0_memory_region: r5f-dma-memory@9c900000 {
51			compatible = "shared-dma-pool";
52			reg = <0x00 0x9c900000 0x00 0x01e00000>;
53			no-map;
54		};
55	};
56
57	vmain_pd: regulator-0 {
58		/* TPS25750 PD CONTROLLER OUTPUT */
59		compatible = "regulator-fixed";
60		regulator-name = "vmain_pd";
61		regulator-min-microvolt = <5000000>;
62		regulator-max-microvolt = <5000000>;
63		regulator-always-on;
64		regulator-boot-on;
65	};
66
67	vcc_5v0: regulator-1 {
68		/* Output of TPS63070 */
69		compatible = "regulator-fixed";
70		regulator-name = "vcc_5v0";
71		regulator-min-microvolt = <5000000>;
72		regulator-max-microvolt = <5000000>;
73		vin-supply = <&vmain_pd>;
74		regulator-always-on;
75		regulator-boot-on;
76	};
77
78	vcc_3v3_sys: regulator-2 {
79		/* output of LM5141-Q1 */
80		compatible = "regulator-fixed";
81		regulator-name = "vcc_3v3_sys";
82		regulator-min-microvolt = <3300000>;
83		regulator-max-microvolt = <3300000>;
84		vin-supply = <&vmain_pd>;
85		regulator-always-on;
86		regulator-boot-on;
87	};
88
89	vdd_mmc1: regulator-3 {
90		/* TPS22918DBVR */
91		compatible = "regulator-fixed";
92		regulator-name = "vdd_mmc1";
93		regulator-min-microvolt = <3300000>;
94		regulator-max-microvolt = <3300000>;
95		regulator-boot-on;
96		enable-active-high;
97		gpio = <&exp1 3 GPIO_ACTIVE_HIGH>;
98	};
99
100	leds {
101		compatible = "gpio-leds";
102		pinctrl-names = "default";
103		pinctrl-0 = <&usr_led_pins_default>;
104
105		led-0 {
106			label = "am62a-sk:green:heartbeat";
107			gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>;
108			linux,default-trigger = "heartbeat";
109			function = LED_FUNCTION_HEARTBEAT;
110			default-state = "off";
111		};
112	};
113};
114
115&main_pmx0 {
116	main_uart0_pins_default: main-uart0-pins-default {
117		pinctrl-single,pins = <
118			AM62AX_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14) UART0_RXD */
119			AM62AX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14) UART0_TXD */
120		>;
121	};
122
123	main_i2c0_pins_default: main-i2c0-pins-default {
124		pinctrl-single,pins = <
125			AM62AX_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
126			AM62AX_IOPAD(0x1e4, PIN_INPUT_PULLUP, 0) /* (A16) I2C0_SDA */
127		>;
128	};
129
130	main_i2c1_pins_default: main-i2c1-pins-default {
131		pinctrl-single,pins = <
132			AM62AX_IOPAD(0x1e8, PIN_INPUT_PULLUP, 0) /* (B17) I2C1_SCL */
133			AM62AX_IOPAD(0x1ec, PIN_INPUT_PULLUP, 0) /* (A17) I2C1_SDA */
134		>;
135	};
136
137	main_i2c2_pins_default: main-i2c2-pins-default {
138		pinctrl-single,pins = <
139			AM62AX_IOPAD(0x0b0, PIN_INPUT_PULLUP, 1) /* (K22) GPMC0_CSn2.I2C2_SCL */
140			AM62AX_IOPAD(0x0b4, PIN_INPUT_PULLUP, 1) /* (K24) GPMC0_CSn3.I2C2_SDA */
141		>;
142	};
143
144	main_mmc1_pins_default: main-mmc1-pins-default {
145		pinctrl-single,pins = <
146			AM62AX_IOPAD(0x23c, PIN_INPUT, 0) /* (A21) MMC1_CMD */
147			AM62AX_IOPAD(0x234, PIN_INPUT, 0) /* (B22) MMC1_CLK */
148			AM62AX_IOPAD(0x230, PIN_INPUT, 0) /* (A22) MMC1_DAT0 */
149			AM62AX_IOPAD(0x22c, PIN_INPUT, 0) /* (B21) MMC1_DAT1 */
150			AM62AX_IOPAD(0x228, PIN_INPUT, 0) /* (C21) MMC1_DAT2 */
151			AM62AX_IOPAD(0x224, PIN_INPUT, 0) /* (D22) MMC1_DAT3 */
152			AM62AX_IOPAD(0x240, PIN_INPUT, 0) /* (D17) MMC1_SDCD */
153		>;
154	};
155
156	usr_led_pins_default: usr-led-pins-default {
157		pinctrl-single,pins = <
158			AM62AX_IOPAD(0x244, PIN_OUTPUT, 7) /* (D18) MMC1_SDWP.GPIO1_49 */
159		>;
160	};
161};
162
163&main_i2c0 {
164	status = "okay";
165	pinctrl-names = "default";
166	pinctrl-0 = <&main_i2c0_pins_default>;
167	clock-frequency = <400000>;
168};
169
170&main_i2c1 {
171	status = "okay";
172	pinctrl-names = "default";
173	pinctrl-0 = <&main_i2c1_pins_default>;
174	clock-frequency = <400000>;
175
176	exp1: gpio@22 {
177		compatible = "ti,tca6424";
178		reg = <0x22>;
179		gpio-controller;
180		#gpio-cells = <2>;
181
182		gpio-line-names = "GPIO_CPSW2_RST", "GPIO_CPSW1_RST",
183				   "BT_EN_SOC", "MMC1_SD_EN",
184				   "VPP_EN", "EXP_PS_3V3_En",
185				   "EXP_PS_5V0_En", "EXP_HAT_DETECT",
186				   "GPIO_AUD_RSTn", "GPIO_eMMC_RSTn",
187				   "UART1_FET_BUF_EN", "BT_UART_WAKE_SOC",
188				   "GPIO_HDMI_RSTn", "CSI_GPIO0",
189				   "CSI_GPIO1", "WLAN_ALERTn",
190				   "HDMI_INTn", "TEST_GPIO2",
191				   "MCASP1_FET_EN", "MCASP1_BUF_BT_EN",
192				   "MCASP1_FET_SEL", "UART1_FET_SEL",
193				   "PD_I2C_IRQ", "IO_EXP_TEST_LED";
194	};
195};
196
197&sdhci1 {
198	/* SD/MMC */
199	status = "okay";
200	vmmc-supply = <&vdd_mmc1>;
201	pinctrl-names = "default";
202	pinctrl-0 = <&main_mmc1_pins_default>;
203	ti,driver-strength-ohm = <50>;
204	disable-wp;
205};
206
207&main_gpio0 {
208	status = "okay";
209};
210
211&main_gpio1 {
212	status = "okay";
213};
214
215&main_gpio_intr {
216	status = "okay";
217};
218
219&main_uart0 {
220	status = "okay";
221	pinctrl-names = "default";
222	pinctrl-0 = <&main_uart0_pins_default>;
223};
224