1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/
4 *
5 * Design Files: https://www.ti.com/lit/zip/SPRR466
6 * TRM: https://www.ti.com/lit/zip/spruj52
7 */
8
9/dts-v1/;
10
11#include <dt-bindings/net/ti-dp83867.h>
12#include <dt-bindings/gpio/gpio.h>
13#include "k3-j784s4.dtsi"
14
15/ {
16	compatible = "ti,am69-sk", "ti,j784s4";
17	model = "Texas Instruments AM69 SK";
18
19	chosen {
20		stdout-path = "serial2:115200n8";
21	};
22
23	aliases {
24		serial2 = &main_uart8;
25		mmc0 = &main_sdhci0;
26		mmc1 = &main_sdhci1;
27		i2c3 = &main_i2c0;
28	};
29
30	memory@80000000 {
31		device_type = "memory";
32		/* 32G RAM */
33		reg = <0x00 0x80000000 0x00 0x80000000>,
34		      <0x08 0x80000000 0x07 0x80000000>;
35	};
36
37	reserved_memory: reserved-memory {
38		#address-cells = <2>;
39		#size-cells = <2>;
40		ranges;
41
42		secure_ddr: optee@9e800000 {
43			reg = <0x00 0x9e800000 0x00 0x01800000>;
44			no-map;
45		};
46	};
47
48	vusb_main: regulator-vusb-main5v0 {
49		/* USB MAIN INPUT 5V DC */
50		compatible = "regulator-fixed";
51		regulator-name = "vusb-main5v0";
52		regulator-min-microvolt = <5000000>;
53		regulator-max-microvolt = <5000000>;
54		regulator-always-on;
55		regulator-boot-on;
56	};
57
58	vsys_5v0: regulator-vsys5v0 {
59		/* Output of LM61460 */
60		compatible = "regulator-fixed";
61		regulator-name = "vsys_5v0";
62		regulator-min-microvolt = <5000000>;
63		regulator-max-microvolt = <5000000>;
64		vin-supply = <&vusb_main>;
65		regulator-always-on;
66		regulator-boot-on;
67	};
68
69	vsys_3v3: regulator-vsys3v3 {
70		/* Output of LM5143 */
71		compatible = "regulator-fixed";
72		regulator-name = "vsys_3v3";
73		regulator-min-microvolt = <3300000>;
74		regulator-max-microvolt = <3300000>;
75		vin-supply = <&vusb_main>;
76		regulator-always-on;
77		regulator-boot-on;
78	};
79
80	vdd_mmc1: regulator-sd {
81		/* Output of TPS22918 */
82		compatible = "regulator-fixed";
83		regulator-name = "vdd_mmc1";
84		regulator-min-microvolt = <3300000>;
85		regulator-max-microvolt = <3300000>;
86		regulator-boot-on;
87		enable-active-high;
88		vin-supply = <&vsys_3v3>;
89		gpio = <&exp1 2 GPIO_ACTIVE_HIGH>;
90	};
91
92	vdd_sd_dv: regulator-tlv71033 {
93		/* Output of TLV71033 */
94		compatible = "regulator-gpio";
95		regulator-name = "tlv71033";
96		pinctrl-names = "default";
97		pinctrl-0 = <&vdd_sd_dv_pins_default>;
98		regulator-min-microvolt = <1800000>;
99		regulator-max-microvolt = <3300000>;
100		regulator-boot-on;
101		vin-supply = <&vsys_5v0>;
102		gpios = <&main_gpio0 49 GPIO_ACTIVE_HIGH>;
103		states = <1800000 0x0>,
104			 <3300000 0x1>;
105	};
106};
107
108&main_pmx0 {
109	main_uart8_pins_default: main-uart8-pins-default {
110		pinctrl-single,pins = <
111			J784S4_IOPAD(0x0d0, PIN_INPUT, 11) /* (AP38) SPI0_CS1.UART8_RXD */
112			J784S4_IOPAD(0x0d4, PIN_OUTPUT, 11) /* (AN38) SPI0_CLK.UART8_TXD */
113		>;
114	};
115
116	main_i2c0_pins_default: main-i2c0-pins-default {
117		pinctrl-single,pins = <
118			J784S4_IOPAD(0x0e0, PIN_INPUT_PULLUP, 0) /* (AN36) I2C0_SCL */
119			J784S4_IOPAD(0x0e4, PIN_INPUT_PULLUP, 0) /* (AP37) I2C0_SDA */
120		>;
121	};
122
123	main_mmc1_pins_default: main-mmc1-pins-default {
124		pinctrl-single,pins = <
125			J784S4_IOPAD(0x104, PIN_INPUT, 0) /* (AB38) MMC1_CLK */
126			J784S4_IOPAD(0x108, PIN_INPUT, 0) /* (AB36) MMC1_CMD */
127			J784S4_IOPAD(0x100, PIN_INPUT, 0) /* (No Pin) MMC1_CLKLB */
128			J784S4_IOPAD(0x0fc, PIN_INPUT, 0) /* (AA33) MMC1_DAT0 */
129			J784S4_IOPAD(0x0f8, PIN_INPUT, 0) /* (AB34) MMC1_DAT1 */
130			J784S4_IOPAD(0x0f4, PIN_INPUT, 0) /* (AA32) MMC1_DAT2 */
131			J784S4_IOPAD(0x0f0, PIN_INPUT, 0) /* (AC38) MMC1_DAT3 */
132			J784S4_IOPAD(0x0e8, PIN_INPUT, 8) /* (AR38) TIMER_IO0.MMC1_SDCD */
133		>;
134	};
135
136	vdd_sd_dv_pins_default: vdd-sd-dv-pins-default {
137		pinctrl-single,pins = <
138			J784S4_IOPAD(0x0C4, PIN_INPUT, 7) /* (AD36) ECAP0_IN_APWM_OUT.GPIO0_49 */
139		>;
140	};
141};
142
143&main_uart8 {
144	status = "okay";
145	pinctrl-names = "default";
146	pinctrl-0 = <&main_uart8_pins_default>;
147};
148
149&main_i2c0 {
150	status = "okay";
151	pinctrl-names = "default";
152	pinctrl-0 = <&main_i2c0_pins_default>;
153	clock-frequency = <400000>;
154
155	exp1: gpio@21 {
156		compatible = "ti,tca6416";
157		reg = <0x21>;
158		gpio-controller;
159		#gpio-cells = <2>;
160		gpio-line-names	= "BOARDID_EEPROM_WP", "CAN_STB", "GPIO_uSD_PWR_EN",
161				"IO_EXP_MCU_RGMII_RST#", "IO_EXP_PCIe0_4L_PERST#",
162				"IO_EXP_PCIe1_M.2_RTSz", "IO_EXP_PCIe3_M.2_RTSz",
163				"PM_INA_BUS_EN", "ENET1_EXP_PWRDN", "EXP1_ENET_RSTz",
164				"ENET1_I2CMUX_SEL", "PCIe0_CLKREQ#", "PCIe1_M.2_CLKREQ#",
165				"PCIe3_M2_CLKREQ#", "PCIe0_PRSNT2#_1", "PCIe0_PRSNT2#_2";
166	};
167};
168
169&main_sdhci0 {
170	/* eMMC */
171	status = "okay";
172	non-removable;
173	ti,driver-strength-ohm = <50>;
174	disable-wp;
175};
176
177&main_sdhci1 {
178	/* SD card */
179	status = "okay";
180	pinctrl-0 = <&main_mmc1_pins_default>;
181	pinctrl-names = "default";
182	disable-wp;
183	vmmc-supply = <&vdd_mmc1>;
184	vqmmc-supply = <&vdd_sd_dv>;
185};
186
187&main_gpio0 {
188	status = "okay";
189};
190