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