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