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		status = "okay";
64	};
65
66	/* Apalis UART2 */
67	serial@70006040 {
68		status = "okay";
69	};
70
71	/* Apalis UART3 */
72	serial@70006200 {
73		status = "okay";
74	};
75
76	/* Apalis UART4 */
77	serial@70006300 {
78		status = "okay";
79	};
80
81	pwm@7000a000 {
82		status = "okay";
83	};
84
85	/*
86	 * GEN1_I2C: I2C1_SDA/SCL on MXM3 pin 209/211 (e.g. RTC on carrier
87	 * board)
88	 */
89	i2c@7000c000 {
90		status = "okay";
91		clock-frequency = <400000>;
92
93		pcie-switch@58 {
94			compatible = "plx,pex8605";
95			reg = <0x58>;
96		};
97
98		/* M41T0M6 real time clock on carrier board */
99		rtc@68 {
100			compatible = "st,m41t0";
101			reg = <0x68>;
102		};
103	};
104
105	/* GEN2_I2C: unused */
106
107	/*
108	 * CAM_I2C: I2C3_SDA/SCL on MXM3 pin 201/203 (e.g. camera sensor on
109	 * carrier board)
110	 */
111	i2c@7000c500 {
112		status = "okay";
113		clock-frequency = <400000>;
114	};
115
116	/* DDC: I2C2_SDA/SCL on MXM3 pin 205/207 (e.g. display EDID) */
117	i2c@7000c700 {
118		status = "okay";
119	};
120
121	/* SPI1: Apalis SPI1 */
122	spi@7000d400 {
123		status = "okay";
124		spi-max-frequency = <25000000>;
125	};
126
127	/* SPI5: Apalis SPI2 */
128	spi@7000dc00 {
129		status = "okay";
130		spi-max-frequency = <25000000>;
131	};
132
133	/* Apalis SD1 */
134	mmc@78000000 {
135		status = "okay";
136		bus-width = <4>;
137		/* SD1_CD# */
138		cd-gpios = <&gpio TEGRA_GPIO(CC, 5) GPIO_ACTIVE_LOW>;
139		no-1-8-v;
140	};
141
142	/* Apalis MMC1 */
143	mmc@78000400 {
144		status = "okay";
145		bus-width = <8>;
146		/* MMC1_CD# */
147		cd-gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_LOW>;
148		vqmmc-supply = <&reg_vddio_sdmmc3>;
149	};
150
151	/* EHCI instance 0: USB1_DP/N -> USBO1_DP/N */
152	usb@7d000000 {
153		status = "okay";
154		dr_mode = "otg";
155	};
156
157	usb-phy@7d000000 {
158		status = "okay";
159		vbus-supply = <&reg_usbo1_vbus>;
160	};
161
162	/* EHCI instance 1: USB2_DP/N -> USBH2_DP/N */
163	usb@7d004000 {
164		status = "okay";
165	};
166
167	usb-phy@7d004000 {
168		status = "okay";
169		vbus-supply = <&reg_usbh_vbus>;
170	};
171
172	/* EHCI instance 2: USB3_DP/N -> USBH3_DP/N */
173	usb@7d008000 {
174		status = "okay";
175	};
176
177	usb-phy@7d008000 {
178		status = "okay";
179		vbus-supply = <&reg_usbh_vbus>;
180	};
181
182	backlight: backlight {
183		compatible = "pwm-backlight";
184		brightness-levels = <255 231 223 207 191 159 127 0>;
185		default-brightness-level = <6>;
186		/* BKL1_ON */
187		enable-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
188		power-supply = <&reg_3v3>;
189		pwms = <&pwm 0 5000000>; /* BKL1_PWM */
190	};
191
192	gpio-keys {
193		compatible = "gpio-keys";
194
195		key-wakeup {
196			label = "WAKE1_MICO";
197			gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_LOW>;
198			linux,code = <KEY_WAKEUP>;
199			debounce-interval = <10>;
200			wakeup-source;
201		};
202	};
203
204	panel: panel {
205		/*
206		 * edt,et057090dhu: EDT 5.7" LCD TFT
207		 * edt,et070080dh6: EDT 7.0" LCD TFT
208		 */
209		compatible = "edt,et057090dhu";
210		backlight = <&backlight>;
211		power-supply = <&reg_3v3>;
212	};
213
214	reg_3v3: regulator-3v3 {
215		compatible = "regulator-fixed";
216		regulator-name = "3.3V_SW";
217		regulator-min-microvolt = <3300000>;
218		regulator-max-microvolt = <3300000>;
219	};
220
221	reg_5v0: regulator-5v0 {
222		compatible = "regulator-fixed";
223		regulator-name = "5V_SW";
224		regulator-min-microvolt = <5000000>;
225		regulator-max-microvolt = <5000000>;
226	};
227
228	/* USBO1_EN */
229	reg_usbo1_vbus: regulator-usbo1-vbus {
230		compatible = "regulator-fixed";
231		regulator-name = "VCC_USBO1";
232		regulator-min-microvolt = <5000000>;
233		regulator-max-microvolt = <5000000>;
234		gpio = <&gpio TEGRA_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
235		enable-active-high;
236		vin-supply = <&reg_5v0>;
237	};
238
239	/* USBH_EN */
240	reg_usbh_vbus: regulator-usbh-vbus {
241		compatible = "regulator-fixed";
242		regulator-name = "VCC_USBH(2A|2C|2D|3|4)";
243		regulator-min-microvolt = <5000000>;
244		regulator-max-microvolt = <5000000>;
245		gpio = <&gpio TEGRA_GPIO(DD, 1) GPIO_ACTIVE_HIGH>;
246		enable-active-high;
247		vin-supply = <&reg_5v0>;
248	};
249
250	/*
251	 * 1.8 volt resp. 3.3 volt VDDIO_SDMMC3 depending on
252	 * EN_+3.3_SDMMC3 GPIO
253	 */
254	reg_vddio_sdmmc3: regulator-vddio-sdmmc3 {
255		compatible = "regulator-gpio";
256		regulator-name = "VDDIO_SDMMC3";
257		regulator-min-microvolt = <1800000>;
258		regulator-max-microvolt = <3300000>;
259		regulator-type = "voltage";
260		gpios = <&gpio TEGRA_GPIO(J, 5) GPIO_ACTIVE_HIGH>;
261		states = <1800000 0x0>,
262			 <3300000 0x1>;
263		startup-delay-us = <100000>;
264		vin-supply = <&vddio_sdmmc_1v8_reg>;
265	};
266};
267