1// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2/*
3 * Copyright 2014-2022 Toradex
4 * Copyright 2012 Freescale Semiconductor, Inc.
5 * Copyright 2011 Linaro Ltd.
6 */
7
8/dts-v1/;
9
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/interrupt-controller/irq.h>
13#include "imx6q.dtsi"
14#include "imx6qdl-apalis.dtsi"
15
16/ {
17	model = "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.2";
18	compatible = "toradex,apalis_imx6q-ixora-v1.2", "toradex,apalis_imx6q",
19		     "fsl,imx6q";
20
21	aliases {
22		i2c0 = &i2c1;
23		i2c1 = &i2c3;
24		i2c2 = &i2c2;
25		rtc0 = &rtc_i2c;
26		rtc1 = &snvs_rtc;
27	};
28
29	chosen {
30		stdout-path = "serial0:115200n8";
31	};
32
33	leds {
34		compatible = "gpio-leds";
35
36		pinctrl-names = "default";
37		pinctrl-0 = <&pinctrl_leds_ixora>;
38
39		led4-green {
40			gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
41			label = "LED_4_GREEN";
42		};
43
44		led4-red {
45			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
46			label = "LED_4_RED";
47		};
48
49		led5-green {
50			gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
51			label = "LED_5_GREEN";
52		};
53
54		led5-red {
55			gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
56			label = "LED_5_RED";
57		};
58	};
59
60	reg_3v3_vmmc: regulator-3v3-vmmc {
61		compatible = "regulator-fixed";
62		enable-active-high;
63		gpio = <&gpio2 0 GPIO_ACTIVE_HIGH>;
64		pinctrl-names = "default";
65		pinctrl-0 = <&pinctrl_enable_3v3_vmmc>;
66		regulator-max-microvolt = <3300000>;
67		regulator-min-microvolt = <3300000>;
68		regulator-name = "3v3_vmmc";
69		startup-delay-us = <100>;
70	};
71
72	reg_can1_supply: regulator-can1-supply {
73		compatible = "regulator-fixed";
74		enable-active-high;
75		gpio = <&gpio2 3 GPIO_ACTIVE_HIGH>;
76		pinctrl-names = "default";
77		pinctrl-0 = <&pinctrl_enable_can1_power>;
78		regulator-name = "can1_supply";
79	};
80
81	reg_can2_supply: regulator-can2-supply {
82		compatible = "regulator-fixed";
83		enable-active-high;
84		gpio = <&gpio3 15 GPIO_ACTIVE_HIGH>;
85		pinctrl-names = "default";
86		pinctrl-0 = <&pinctrl_enable_can2_power>;
87		regulator-name = "can2_supply";
88	};
89};
90
91&can1 {
92	xceiver-supply = <&reg_can1_supply>;
93	status = "okay";
94};
95
96&can2 {
97	xceiver-supply = <&reg_can2_supply>;
98	status = "okay";
99};
100
101&gpio1 {
102	pinctrl-names = "default";
103	pinctrl-0 = <&pinctrl_uart24_forceoff>;
104
105	/*
106	 * uart-2-4-on-x21-enable-hog enables the UART transceiver for Apalis
107	 * UART2 and UART3. If one wants to disable the transceiver force
108	 * the GPIO to output-low, if one wants to control the transceiver
109	 * from user space delete the hog node.
110	 */
111	uart-2-4-on-x21-enable-hog {
112		gpio-hog;
113		gpios = <11 GPIO_ACTIVE_HIGH>; /* MXM3 180 */
114		output-high;
115	};
116};
117
118/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
119&i2c1 {
120	status = "okay";
121
122	/* M41T0M6 real time clock on carrier board */
123	rtc_i2c: rtc@68 {
124		compatible = "st,m41t0";
125		reg = <0x68>;
126	};
127
128	eeprom: eeprom@50 {
129		compatible = "atmel,24c02";
130		reg = <0x50>;
131		pagesize = <16>;
132	};
133};
134
135/*
136 * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier
137 * board)
138 */
139&i2c3 {
140	status = "okay";
141};
142
143&pcie {
144	pinctrl-names = "default";
145	pinctrl-0 = <&pinctrl_reset_moci>;
146	/* active-high meaning opposite of regular PERST# active-low polarity */
147	reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
148	reset-gpio-active-high;
149	status = "okay";
150};
151
152&pwm1 {
153	status = "okay";
154};
155
156&pwm2 {
157	status = "okay";
158};
159
160&pwm3 {
161	status = "okay";
162};
163
164&pwm4 {
165	status = "okay";
166};
167
168&reg_usb_host_vbus {
169	status = "okay";
170};
171
172&reg_usb_otg_vbus {
173	status = "okay";
174};
175
176&sata {
177	status = "okay";
178};
179
180&sound_spdif {
181	status = "okay";
182};
183
184&spdif {
185	status = "okay";
186};
187
188&uart1 {
189	status = "okay";
190};
191
192&uart2 {
193	status = "okay";
194};
195
196&uart4 {
197	status = "okay";
198};
199
200&uart5 {
201	status = "okay";
202};
203
204&usbh1 {
205	disable-over-current;
206	vbus-supply = <&reg_usb_host_vbus>;
207	status = "okay";
208};
209
210&usbotg {
211	disable-over-current;
212	vbus-supply = <&reg_usb_otg_vbus>;
213	status = "okay";
214};
215
216/* MMC1 */
217&usdhc1 {
218	pinctrl-names = "default", "sleep";
219	pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_mmc_cd>;
220	pinctrl-1 = <&pinctrl_usdhc1_4bit_sleep &pinctrl_mmc_cd_sleep>;
221	bus-width = <4>;
222	cap-power-off-card;
223	vmmc-supply = <&reg_3v3_vmmc>;
224	status = "okay";
225};
226
227&iomuxc {
228	pinctrl_enable_3v3_vmmc: enable3v3vmmcgrp {
229		fsl,pins = <
230			MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x1b0b0
231		>;
232	};
233
234	pinctrl_enable_can1_power: enablecan1powergrp {
235		fsl,pins = <
236			MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0
237		>;
238	};
239
240	pinctrl_enable_can2_power: enablecan2powergrp {
241		fsl,pins = <
242			MX6QDL_PAD_EIM_DA15__GPIO3_IO15 0x1b0b0
243		>;
244	};
245
246	pinctrl_uart24_forceoff: uart24forceoffgrp {
247		fsl,pins = <
248			MX6QDL_PAD_SD2_CMD__GPIO1_IO11 0x1b0b0
249		>;
250	};
251
252	pinctrl_leds_ixora: ledsixoragrp {
253		fsl,pins = <
254			MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 0x1b0b0
255			MX6QDL_PAD_SD2_DAT3__GPIO1_IO12 0x1b0b0
256			MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
257			MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0
258		>;
259	};
260
261	pinctrl_mmc_cd_sleep: mmccdslpgrp {
262		fsl,pins = <
263			 /* MMC1 CD */
264			MX6QDL_PAD_DI0_PIN4__GPIO4_IO20 0x0
265		>;
266	};
267
268	pinctrl_usdhc1_4bit_sleep: usdhc1-4bitslpgrp {
269		fsl,pins = <
270			MX6QDL_PAD_SD1_CMD__SD1_CMD     0x3000
271			MX6QDL_PAD_SD1_CLK__SD1_CLK     0x3000
272			MX6QDL_PAD_SD1_DAT0__SD1_DATA0  0x3000
273			MX6QDL_PAD_SD1_DAT1__SD1_DATA1  0x3000
274			MX6QDL_PAD_SD1_DAT2__SD1_DATA2  0x3000
275			MX6QDL_PAD_SD1_DAT3__SD1_DATA3  0x3000
276		>;
277	};
278};
279