xref: /freebsd-src/sys/contrib/device-tree/src/arm/nxp/imx/imx6qdl-dhcom-drc02.dtsi (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1*f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0+
2*f126890aSEmmanuel Vadot/*
3*f126890aSEmmanuel Vadot * Copyright (C) 2021 DH electronics GmbH
4*f126890aSEmmanuel Vadot */
5*f126890aSEmmanuel Vadot
6*f126890aSEmmanuel Vadot/ {
7*f126890aSEmmanuel Vadot	chosen {
8*f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
9*f126890aSEmmanuel Vadot	};
10*f126890aSEmmanuel Vadot};
11*f126890aSEmmanuel Vadot
12*f126890aSEmmanuel Vadot/*
13*f126890aSEmmanuel Vadot * Special SoM hardware required which uses the pins from micro SD card. The
14*f126890aSEmmanuel Vadot * pins SD3_DAT0 and SD3_DAT1 are muxed as can2 Tx and Rx. The signals for can2
15*f126890aSEmmanuel Vadot * Tx and Rx are routed to the DHCOM UART1 rts/cts pins. Therefore the micro SD
16*f126890aSEmmanuel Vadot * card must be disabled and the uart1 rts/cts must be output on other DHCOM
17*f126890aSEmmanuel Vadot * pins, see uart1 and usdhc3 node below.
18*f126890aSEmmanuel Vadot */
19*f126890aSEmmanuel Vadot&can2 {
20*f126890aSEmmanuel Vadot	status = "okay";
21*f126890aSEmmanuel Vadot};
22*f126890aSEmmanuel Vadot
23*f126890aSEmmanuel Vadot&gpio1 {
24*f126890aSEmmanuel Vadot	/*
25*f126890aSEmmanuel Vadot	 * NOTE: On DRC02, the RS485_RX_En is controlled by a separate
26*f126890aSEmmanuel Vadot	 * GPIO line, however the i.MX6 UART driver assumes RX happens
27*f126890aSEmmanuel Vadot	 * during TX anyway and that it only controls drive enable DE
28*f126890aSEmmanuel Vadot	 * line. Hence, the RX is always enabled here.
29*f126890aSEmmanuel Vadot	 */
30*f126890aSEmmanuel Vadot	rs485-rx-en-hog {
31*f126890aSEmmanuel Vadot		gpio-hog;
32*f126890aSEmmanuel Vadot		gpios = <18 0>; /* GPIO Q */
33*f126890aSEmmanuel Vadot		line-name = "rs485-rx-en";
34*f126890aSEmmanuel Vadot		output-low;
35*f126890aSEmmanuel Vadot	};
36*f126890aSEmmanuel Vadot};
37*f126890aSEmmanuel Vadot
38*f126890aSEmmanuel Vadot&gpio3 {
39*f126890aSEmmanuel Vadot	gpio-line-names =
40*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "", "",
41*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "", "",
42*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "", "",
43*f126890aSEmmanuel Vadot		"", "", "", "DRC02-In1", "", "", "", "";
44*f126890aSEmmanuel Vadot};
45*f126890aSEmmanuel Vadot
46*f126890aSEmmanuel Vadot&gpio4 {
47*f126890aSEmmanuel Vadot	gpio-line-names =
48*f126890aSEmmanuel Vadot		"", "", "", "", "", "DHCOM-E", "DRC02-In2", "DHCOM-H",
49*f126890aSEmmanuel Vadot		"DHCOM-I", "DRC02-HW0", "", "", "", "", "", "",
50*f126890aSEmmanuel Vadot		"", "", "", "", "DRC02-Out1", "", "", "",
51*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "", "";
52*f126890aSEmmanuel Vadot};
53*f126890aSEmmanuel Vadot
54*f126890aSEmmanuel Vadot&gpio6 {
55*f126890aSEmmanuel Vadot	gpio-line-names =
56*f126890aSEmmanuel Vadot		"", "", "", "DRC02-Out2", "", "", "SOM-HW1", "",
57*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "DRC02-HW2", "DRC02-HW1",
58*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "", "",
59*f126890aSEmmanuel Vadot		"", "", "", "", "", "", "", "";
60*f126890aSEmmanuel Vadot};
61*f126890aSEmmanuel Vadot
62*f126890aSEmmanuel Vadot&i2c1 {
63*f126890aSEmmanuel Vadot	eeprom@50 {
64*f126890aSEmmanuel Vadot		compatible = "atmel,24c04";
65*f126890aSEmmanuel Vadot		reg = <0x50>;
66*f126890aSEmmanuel Vadot		pagesize = <16>;
67*f126890aSEmmanuel Vadot	};
68*f126890aSEmmanuel Vadot};
69*f126890aSEmmanuel Vadot
70*f126890aSEmmanuel Vadot&uart1 {
71*f126890aSEmmanuel Vadot	/*
72*f126890aSEmmanuel Vadot	 * Due to the use of can2 the signals for can2 Tx and Rx are routed to
73*f126890aSEmmanuel Vadot	 * DHCOM UART1 rts/cts pins. Therefore this UART have to use DHCOM GPIOs
74*f126890aSEmmanuel Vadot	 * for rts/cts. So configure DHCOM GPIO I as rts and GPIO M as cts.
75*f126890aSEmmanuel Vadot	 */
76*f126890aSEmmanuel Vadot	/delete-property/ uart-has-rtscts;
77*f126890aSEmmanuel Vadot	cts-gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>; /* GPIO M */
78*f126890aSEmmanuel Vadot	pinctrl-0 = <&pinctrl_uart1 &pinctrl_dhcom_i &pinctrl_dhcom_m>;
79*f126890aSEmmanuel Vadot	pinctrl-names = "default";
80*f126890aSEmmanuel Vadot	rts-gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; /* GPIO I */
81*f126890aSEmmanuel Vadot};
82*f126890aSEmmanuel Vadot
83*f126890aSEmmanuel Vadot&uart5 {
84*f126890aSEmmanuel Vadot	/*
85*f126890aSEmmanuel Vadot	 * On DRC02 this UART is used as RS485 interface and RS485_TX_En is
86*f126890aSEmmanuel Vadot	 * controlled by DHCOM GPIO P. So remove rts/cts pins and the property
87*f126890aSEmmanuel Vadot	 * uart-has-rtscts from this UART and add the DHCOM GPIO P pin via
88*f126890aSEmmanuel Vadot	 * rts-gpios. The RS485_RX_En is controlled by DHCOM GPIO Q, see gpio1
89*f126890aSEmmanuel Vadot	 * node above.
90*f126890aSEmmanuel Vadot	 */
91*f126890aSEmmanuel Vadot	/delete-property/ uart-has-rtscts;
92*f126890aSEmmanuel Vadot	linux,rs485-enabled-at-boot-time;
93*f126890aSEmmanuel Vadot	pinctrl-0 = <&pinctrl_uart5_core &pinctrl_dhcom_p &pinctrl_dhcom_q>;
94*f126890aSEmmanuel Vadot	pinctrl-names = "default";
95*f126890aSEmmanuel Vadot	rts-gpios = <&gpio7 13 GPIO_ACTIVE_HIGH>; /* GPIO P */
96*f126890aSEmmanuel Vadot};
97*f126890aSEmmanuel Vadot
98*f126890aSEmmanuel Vadot&usbh1 {
99*f126890aSEmmanuel Vadot	disable-over-current;
100*f126890aSEmmanuel Vadot};
101*f126890aSEmmanuel Vadot
102*f126890aSEmmanuel Vadot&usdhc2 { /* SD card */
103*f126890aSEmmanuel Vadot	status = "okay";
104*f126890aSEmmanuel Vadot};
105*f126890aSEmmanuel Vadot
106*f126890aSEmmanuel Vadot&usdhc3 {
107*f126890aSEmmanuel Vadot	/*
108*f126890aSEmmanuel Vadot	 * Due to the use of can2 the micro SD card on module have to be
109*f126890aSEmmanuel Vadot	 * disabled, because the pins SD3_DAT0 and SD3_DAT1 are muxed as
110*f126890aSEmmanuel Vadot	 * can2 Tx and Rx.
111*f126890aSEmmanuel Vadot	 */
112*f126890aSEmmanuel Vadot	status = "disabled";
113*f126890aSEmmanuel Vadot};
114*f126890aSEmmanuel Vadot
115*f126890aSEmmanuel Vadot&iomuxc {
116*f126890aSEmmanuel Vadot	pinctrl-0 = <
117*f126890aSEmmanuel Vadot			/*
118*f126890aSEmmanuel Vadot			 * The following DHCOM GPIOs are used on this board.
119*f126890aSEmmanuel Vadot			 * Therefore, they have been removed from the list below.
120*f126890aSEmmanuel Vadot			 * I: uart1 rts
121*f126890aSEmmanuel Vadot			 * M: uart1 cts
122*f126890aSEmmanuel Vadot			 * P: uart5 rs485-tx-en
123*f126890aSEmmanuel Vadot			 * Q: uart5 rs485-rx-en
124*f126890aSEmmanuel Vadot			 */
125*f126890aSEmmanuel Vadot			&pinctrl_hog_base
126*f126890aSEmmanuel Vadot			&pinctrl_dhcom_a &pinctrl_dhcom_b &pinctrl_dhcom_c
127*f126890aSEmmanuel Vadot			&pinctrl_dhcom_d &pinctrl_dhcom_e &pinctrl_dhcom_f
128*f126890aSEmmanuel Vadot			&pinctrl_dhcom_g &pinctrl_dhcom_h
129*f126890aSEmmanuel Vadot			&pinctrl_dhcom_j &pinctrl_dhcom_k &pinctrl_dhcom_l
130*f126890aSEmmanuel Vadot			&pinctrl_dhcom_n &pinctrl_dhcom_o
131*f126890aSEmmanuel Vadot			&pinctrl_dhcom_r
132*f126890aSEmmanuel Vadot			&pinctrl_dhcom_s &pinctrl_dhcom_t &pinctrl_dhcom_u
133*f126890aSEmmanuel Vadot			&pinctrl_dhcom_v &pinctrl_dhcom_w &pinctrl_dhcom_int
134*f126890aSEmmanuel Vadot		>;
135*f126890aSEmmanuel Vadot	pinctrl-names = "default";
136*f126890aSEmmanuel Vadot
137*f126890aSEmmanuel Vadot	pinctrl_uart5_core: uart5-core-grp {
138*f126890aSEmmanuel Vadot		fsl,pins = <
139*f126890aSEmmanuel Vadot			MX6QDL_PAD_CSI0_DAT14__UART5_TX_DATA	0x1b0b1
140*f126890aSEmmanuel Vadot			MX6QDL_PAD_CSI0_DAT15__UART5_RX_DATA	0x1b0b1
141*f126890aSEmmanuel Vadot		>;
142*f126890aSEmmanuel Vadot	};
143*f126890aSEmmanuel Vadot};
144