1// SPDX-License-Identifier: GPL-2.0 OR MIT
2/dts-v1/;
3
4#include <dt-bindings/input/input.h>
5#include "tegra30-apalis-v1.1.dtsi"
6
7/ {
8	model = "Toradex Apalis T30 on Apalis Evaluation Board";
9	compatible = "toradex,apalis_t30-v1.1-eval", "toradex,apalis_t30-eval",
10		     "toradex,apalis_t30-v1.1", "toradex,apalis_t30",
11		     "nvidia,tegra30";
12
13	aliases {
14		rtc0 = "/i2c@7000c000/rtc@68";
15		rtc1 = "/i2c@7000d000/pmic@2d";
16		rtc2 = "/rtc@7000e000";
17		serial0 = &uarta;
18		serial1 = &uartb;
19		serial2 = &uartc;
20		serial3 = &uartd;
21	};
22
23	chosen {
24		stdout-path = "serial0:115200n8";
25	};
26
27	pcie@3000 {
28		pci@1,0 {
29			status = "okay";
30		};
31
32		pci@2,0 {
33			status = "okay";
34		};
35	};
36
37	host1x@50000000 {
38		dc@54200000 {
39			rgb {
40				status = "okay";
41				nvidia,panel = <&panel>;
42			};
43		};
44
45		hdmi@54280000 {
46			status = "okay";
47			hdmi-supply = <&reg_5v0>;
48		};
49	};
50
51	gpio@6000d000 {
52		/* Apalis GPIO7 MXM3 pin 15 PLX PEX 8605 PCIe Switch Reset */
53		pex-perst-n-hog {
54			gpio-hog;
55			gpios = <TEGRA_GPIO(S, 7) GPIO_ACTIVE_HIGH>;
56			output-high;
57			line-name = "PEX_PERST_N";
58		};
59	};
60
61	/* Apalis UART1 */
62	serial@70006000 {
63		/delete-property/ dmas;
64		/delete-property/ dma-names;
65		status = "okay";
66	};
67
68	/* Apalis UART2 */
69	serial@70006040 {
70		status = "okay";
71	};
72
73	/* Apalis UART3 */
74	serial@70006200 {
75		status = "okay";
76	};
77
78	/* Apalis UART4 */
79	serial@70006300 {
80		status = "okay";
81	};
82
83	pwm@7000a000 {
84		status = "okay";
85	};
86
87	/*
88	 * GEN1_I2C: I2C1_SDA/SCL on MXM3 pin 209/211 (e.g. RTC on carrier
89	 * board)
90	 */
91	i2c@7000c000 {
92		status = "okay";
93		clock-frequency = <400000>;
94
95		pcie-switch@58 {
96			compatible = "plx,pex8605";
97			reg = <0x58>;
98		};
99
100		/* M41T0M6 real time clock on carrier board */
101		rtc@68 {
102			compatible = "st,m41t0";
103			reg = <0x68>;
104		};
105	};
106
107	/* GEN2_I2C: unused */
108
109	/*
110	 * CAM_I2C: I2C3_SDA/SCL on MXM3 pin 201/203 (e.g. camera sensor on
111	 * carrier board)
112	 */
113	i2c@7000c500 {
114		status = "okay";
115		clock-frequency = <400000>;
116	};
117
118	/* DDC: I2C2_SDA/SCL on MXM3 pin 205/207 (e.g. display EDID) */
119	i2c@7000c700 {
120		status = "okay";
121	};
122
123	/* SPI1: Apalis SPI1 */
124	spi@7000d400 {
125		status = "okay";
126		spi-max-frequency = <25000000>;
127	};
128
129	/* SPI5: Apalis SPI2 */
130	spi@7000dc00 {
131		status = "okay";
132		spi-max-frequency = <25000000>;
133	};
134
135	/* Apalis SD1 */
136	mmc@78000000 {
137		status = "okay";
138		bus-width = <4>;
139		/* SD1_CD# */
140		cd-gpios = <&gpio TEGRA_GPIO(CC, 5) GPIO_ACTIVE_LOW>;
141		no-1-8-v;
142	};
143
144	/* Apalis MMC1 */
145	mmc@78000400 {
146		status = "okay";
147		bus-width = <8>;
148		/* MMC1_CD# */
149		cd-gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_LOW>;
150		vqmmc-supply = <&reg_vddio_sdmmc3>;
151	};
152
153	/* EHCI instance 0: USB1_DP/N -> USBO1_DP/N */
154	usb@7d000000 {
155		status = "okay";
156		dr_mode = "otg";
157	};
158
159	usb-phy@7d000000 {
160		status = "okay";
161		vbus-supply = <&reg_usbo1_vbus>;
162	};
163
164	/* EHCI instance 1: USB2_DP/N -> USBH2_DP/N */
165	usb@7d004000 {
166		status = "okay";
167	};
168
169	usb-phy@7d004000 {
170		status = "okay";
171		vbus-supply = <&reg_usbh_vbus>;
172	};
173
174	/* EHCI instance 2: USB3_DP/N -> USBH3_DP/N */
175	usb@7d008000 {
176		status = "okay";
177	};
178
179	usb-phy@7d008000 {
180		status = "okay";
181		vbus-supply = <&reg_usbh_vbus>;
182	};
183
184	backlight: backlight {
185		compatible = "pwm-backlight";
186		brightness-levels = <255 231 223 207 191 159 127 0>;
187		default-brightness-level = <6>;
188		/* BKL1_ON */
189		enable-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
190		power-supply = <&reg_3v3>;
191		pwms = <&pwm 0 5000000>; /* BKL1_PWM */
192	};
193
194	gpio-keys {
195		compatible = "gpio-keys";
196
197		key-wakeup {
198			label = "WAKE1_MICO";
199			gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_LOW>;
200			linux,code = <KEY_WAKEUP>;
201			debounce-interval = <10>;
202			wakeup-source;
203		};
204	};
205
206	panel: panel {
207		/*
208		 * edt,et057090dhu: EDT 5.7" LCD TFT
209		 * edt,et070080dh6: EDT 7.0" LCD TFT
210		 */
211		compatible = "edt,et057090dhu";
212		backlight = <&backlight>;
213		power-supply = <&reg_3v3>;
214	};
215
216	reg_3v3: regulator-3v3 {
217		compatible = "regulator-fixed";
218		regulator-name = "3.3V_SW";
219		regulator-min-microvolt = <3300000>;
220		regulator-max-microvolt = <3300000>;
221	};
222
223	reg_5v0: regulator-5v0 {
224		compatible = "regulator-fixed";
225		regulator-name = "5V_SW";
226		regulator-min-microvolt = <5000000>;
227		regulator-max-microvolt = <5000000>;
228	};
229
230	/* USBO1_EN */
231	reg_usbo1_vbus: regulator-usbo1-vbus {
232		compatible = "regulator-fixed";
233		regulator-name = "VCC_USBO1";
234		regulator-min-microvolt = <5000000>;
235		regulator-max-microvolt = <5000000>;
236		gpio = <&gpio TEGRA_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
237		enable-active-high;
238		vin-supply = <&reg_5v0>;
239	};
240
241	/* USBH_EN */
242	reg_usbh_vbus: regulator-usbh-vbus {
243		compatible = "regulator-fixed";
244		regulator-name = "VCC_USBH(2A|2C|2D|3|4)";
245		regulator-min-microvolt = <5000000>;
246		regulator-max-microvolt = <5000000>;
247		gpio = <&gpio TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH>;
248		enable-active-high;
249		vin-supply = <&reg_5v0>;
250	};
251
252	/*
253	 * 1.8 volt resp. 3.3 volt VDDIO_SDMMC3 depending on
254	 * EN_+3.3_SDMMC3 GPIO
255	 */
256	reg_vddio_sdmmc3: regulator-vddio-sdmmc3 {
257		compatible = "regulator-gpio";
258		regulator-name = "VDDIO_SDMMC3";
259		regulator-min-microvolt = <1800000>;
260		regulator-max-microvolt = <3300000>;
261		regulator-type = "voltage";
262		gpios = <&gpio TEGRA_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
263		states = <1800000 0x0>,
264			 <3300000 0x1>;
265		startup-delay-us = <100000>;
266		vin-supply = <&vddio_sdmmc_1v8_reg>;
267	};
268};
269