xref: /linux/arch/arm64/boot/dts/freescale/imx8mp-dhcom-drc02.dts (revision c771600c6af14749609b49565ffb4cac2959710d)
1*05be20ccSMarek Vasut// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*05be20ccSMarek Vasut/*
3*05be20ccSMarek Vasut * Copyright (C) 2024 Marek Vasut <marex@denx.de>
4*05be20ccSMarek Vasut *
5*05be20ccSMarek Vasut * DHCOM iMX8MP variant:
6*05be20ccSMarek Vasut * DHCM-iMX8ML8-C160-R204-F1638-SPI16-E2-CAN2-RTC-I-01D2
7*05be20ccSMarek Vasut * DHCOM PCB number: 660-100 or newer
8*05be20ccSMarek Vasut * DRC02 PCB number: 568-100 or newer
9*05be20ccSMarek Vasut */
10*05be20ccSMarek Vasut
11*05be20ccSMarek Vasut/dts-v1/;
12*05be20ccSMarek Vasut
13*05be20ccSMarek Vasut#include <dt-bindings/leds/common.h>
14*05be20ccSMarek Vasut#include <dt-bindings/phy/phy-imx8-pcie.h>
15*05be20ccSMarek Vasut#include "imx8mp-dhcom-som.dtsi"
16*05be20ccSMarek Vasut
17*05be20ccSMarek Vasut/ {
18*05be20ccSMarek Vasut	model = "DH electronics i.MX8M Plus DHCOM on DRC02";
19*05be20ccSMarek Vasut	compatible = "dh,imx8mp-dhcom-drc02", "dh,imx8mp-dhcom-som",
20*05be20ccSMarek Vasut		     "fsl,imx8mp";
21*05be20ccSMarek Vasut
22*05be20ccSMarek Vasut	chosen {
23*05be20ccSMarek Vasut		stdout-path = &uart1;
24*05be20ccSMarek Vasut	};
25*05be20ccSMarek Vasut};
26*05be20ccSMarek Vasut
27*05be20ccSMarek Vasut&eqos {	/* First ethernet */
28*05be20ccSMarek Vasut	pinctrl-0 = <&pinctrl_eqos_rmii>;
29*05be20ccSMarek Vasut	phy-handle = <&ethphy0f>;
30*05be20ccSMarek Vasut	phy-mode = "rmii";
31*05be20ccSMarek Vasut
32*05be20ccSMarek Vasut	assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_266M>,
33*05be20ccSMarek Vasut				 <&clk IMX8MP_SYS_PLL2_100M>,
34*05be20ccSMarek Vasut				 <&clk IMX8MP_SYS_PLL2_50M>;
35*05be20ccSMarek Vasut	assigned-clock-rates = <0>, <100000000>, <50000000>;
36*05be20ccSMarek Vasut};
37*05be20ccSMarek Vasut
38*05be20ccSMarek Vasut&ethphy0g {	/* Micrel KSZ9131RNXI */
39*05be20ccSMarek Vasut	status = "disabled";
40*05be20ccSMarek Vasut};
41*05be20ccSMarek Vasut
42*05be20ccSMarek Vasut&ethphy0f {	/* SMSC LAN8740Ai */
43*05be20ccSMarek Vasut	status = "okay";
44*05be20ccSMarek Vasut};
45*05be20ccSMarek Vasut
46*05be20ccSMarek Vasut&fec {	/* Second ethernet */
47*05be20ccSMarek Vasut	pinctrl-0 = <&pinctrl_fec_rmii>;
48*05be20ccSMarek Vasut	phy-handle = <&ethphy1f>;
49*05be20ccSMarek Vasut	phy-mode = "rmii";
50*05be20ccSMarek Vasut	status = "okay";
51*05be20ccSMarek Vasut
52*05be20ccSMarek Vasut	assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_266M>,
53*05be20ccSMarek Vasut				 <&clk IMX8MP_SYS_PLL2_100M>,
54*05be20ccSMarek Vasut				 <&clk IMX8MP_SYS_PLL2_50M>,
55*05be20ccSMarek Vasut				 <&clk IMX8MP_SYS_PLL2_50M>;
56*05be20ccSMarek Vasut	assigned-clock-rates = <0>, <100000000>, <50000000>, <0>;
57*05be20ccSMarek Vasut};
58*05be20ccSMarek Vasut
59*05be20ccSMarek Vasut&ethphy1f {	/* SMSC LAN8740Ai */
60*05be20ccSMarek Vasut	status = "okay";
61*05be20ccSMarek Vasut};
62*05be20ccSMarek Vasut
63*05be20ccSMarek Vasut&flexcan1 {
64*05be20ccSMarek Vasut	status = "okay";
65*05be20ccSMarek Vasut};
66*05be20ccSMarek Vasut
67*05be20ccSMarek Vasut&flexcan2 {
68*05be20ccSMarek Vasut	status = "okay";
69*05be20ccSMarek Vasut};
70*05be20ccSMarek Vasut
71*05be20ccSMarek Vasut&gpio1 {
72*05be20ccSMarek Vasut	gpio-line-names =
73*05be20ccSMarek Vasut		"DRC02-In1", "", "", "", "", "DHCOM-I", "DRC02-HW2", "DRC02-HW0",
74*05be20ccSMarek Vasut		"DHCOM-B", "DHCOM-A", "", "DHCOM-H", "", "", "", "",
75*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "",
76*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "";
77*05be20ccSMarek Vasut
78*05be20ccSMarek Vasut	/*
79*05be20ccSMarek Vasut	 * NOTE: On DRC02, the RS485_RX_En is controlled by a separate
80*05be20ccSMarek Vasut	 * GPIO line, however the i.MX8 UART driver assumes RX happens
81*05be20ccSMarek Vasut	 * during TX anyway and that it only controls drive enable DE
82*05be20ccSMarek Vasut	 * line. Hence, the RX is always enabled here.
83*05be20ccSMarek Vasut	 */
84*05be20ccSMarek Vasut	rs485-rx-en-hog {
85*05be20ccSMarek Vasut		gpio-hog;
86*05be20ccSMarek Vasut		gpios = <13 0>; /* GPIO Q */
87*05be20ccSMarek Vasut		line-name = "rs485-rx-en";
88*05be20ccSMarek Vasut		output-low;
89*05be20ccSMarek Vasut	};
90*05be20ccSMarek Vasut};
91*05be20ccSMarek Vasut
92*05be20ccSMarek Vasut&gpio2 {
93*05be20ccSMarek Vasut	gpio-line-names =
94*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "",
95*05be20ccSMarek Vasut		"DHCOM-O", "DHCOM-N", "", "SOM-HW1", "", "", "", "",
96*05be20ccSMarek Vasut		"", "", "", "", "DRC02-In2", "", "", "",
97*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "";
98*05be20ccSMarek Vasut};
99*05be20ccSMarek Vasut
100*05be20ccSMarek Vasut&gpio3 {
101*05be20ccSMarek Vasut	gpio-line-names =
102*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "",
103*05be20ccSMarek Vasut		"", "", "", "", "", "", "SOM-HW0", "",
104*05be20ccSMarek Vasut		"", "", "", "", "", "", "SOM-MEM0", "SOM-MEM1",
105*05be20ccSMarek Vasut		"SOM-MEM2", "SOM-HW2", "", "", "", "", "", "";
106*05be20ccSMarek Vasut};
107*05be20ccSMarek Vasut
108*05be20ccSMarek Vasut&gpio4 {
109*05be20ccSMarek Vasut	gpio-line-names =
110*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "",
111*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "",
112*05be20ccSMarek Vasut		"", "", "", "SOM-HW1", "", "", "", "",
113*05be20ccSMarek Vasut		"", "", "", "DRC02-Out2", "", "", "", "";
114*05be20ccSMarek Vasut};
115*05be20ccSMarek Vasut
116*05be20ccSMarek Vasut&gpio5 {
117*05be20ccSMarek Vasut	gpio-line-names =
118*05be20ccSMarek Vasut		"", "", "DHCOM-C", "", "", "", "", "",
119*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "",
120*05be20ccSMarek Vasut		"", "", "", "", "", "", "DHCOM-E", "DRC02-Out1",
121*05be20ccSMarek Vasut		"", "", "", "", "", "", "", "";
122*05be20ccSMarek Vasut};
123*05be20ccSMarek Vasut
124*05be20ccSMarek Vasut/* No HS connector on this SoM variant, so no HDMI, PCIe and only USB HS. */
125*05be20ccSMarek Vasut&hdmi_blk_ctrl {
126*05be20ccSMarek Vasut	status = "disabled";
127*05be20ccSMarek Vasut};
128*05be20ccSMarek Vasut
129*05be20ccSMarek Vasut&hdmi_pvi {
130*05be20ccSMarek Vasut	status = "disabled";
131*05be20ccSMarek Vasut};
132*05be20ccSMarek Vasut
133*05be20ccSMarek Vasut&hdmi_tx {
134*05be20ccSMarek Vasut	status = "disabled";
135*05be20ccSMarek Vasut};
136*05be20ccSMarek Vasut
137*05be20ccSMarek Vasut&hdmi_tx_phy {
138*05be20ccSMarek Vasut	status = "disabled";
139*05be20ccSMarek Vasut};
140*05be20ccSMarek Vasut
141*05be20ccSMarek Vasut&i2c3 {
142*05be20ccSMarek Vasut	/* Resistive touch controller not populated on this one SoM variant. */
143*05be20ccSMarek Vasut	touchscreen@49 {
144*05be20ccSMarek Vasut		status = "disabled";
145*05be20ccSMarek Vasut	};
146*05be20ccSMarek Vasut};
147*05be20ccSMarek Vasut
148*05be20ccSMarek Vasut&irqsteer_hdmi {
149*05be20ccSMarek Vasut	status = "disabled";
150*05be20ccSMarek Vasut};
151*05be20ccSMarek Vasut
152*05be20ccSMarek Vasut&lcdif3 {
153*05be20ccSMarek Vasut	status = "disabled";
154*05be20ccSMarek Vasut};
155*05be20ccSMarek Vasut
156*05be20ccSMarek Vasut&pcie_phy {
157*05be20ccSMarek Vasut	status = "disabled";
158*05be20ccSMarek Vasut};
159*05be20ccSMarek Vasut
160*05be20ccSMarek Vasut&pcie {
161*05be20ccSMarek Vasut	status = "disabled";
162*05be20ccSMarek Vasut};
163*05be20ccSMarek Vasut
164*05be20ccSMarek Vasut/* Console UART */
165*05be20ccSMarek Vasut&pinctrl_uart1 {
166*05be20ccSMarek Vasut	fsl,pins = <
167*05be20ccSMarek Vasut		/* No pull-ups on DRC02, enable in-SoC pull-ups */
168*05be20ccSMarek Vasut		MX8MP_IOMUXC_SAI2_RXC__UART1_DCE_RX		0x149
169*05be20ccSMarek Vasut		MX8MP_IOMUXC_SAI2_RXFS__UART1_DCE_TX		0x149
170*05be20ccSMarek Vasut	>;
171*05be20ccSMarek Vasut};
172*05be20ccSMarek Vasut
173*05be20ccSMarek Vasut&pinctrl_uart3 {
174*05be20ccSMarek Vasut	fsl,pins = <
175*05be20ccSMarek Vasut		/* No pull-ups on DRC02, enable in-SoC pull-ups */
176*05be20ccSMarek Vasut		MX8MP_IOMUXC_ECSPI1_SCLK__UART3_DCE_RX		0x149
177*05be20ccSMarek Vasut		MX8MP_IOMUXC_ECSPI1_MOSI__UART3_DCE_TX		0x149
178*05be20ccSMarek Vasut	>;
179*05be20ccSMarek Vasut};
180*05be20ccSMarek Vasut
181*05be20ccSMarek Vasut&uart1 {
182*05be20ccSMarek Vasut	/*
183*05be20ccSMarek Vasut	 * Due to the use of CAN2 the signals for CAN2 Tx and Rx are routed to
184*05be20ccSMarek Vasut	 * DHCOM UART1 RTS/CTS pins. Therefore this UART have to use DHCOM GPIOs
185*05be20ccSMarek Vasut	 * for RTS/CTS. So configure DHCOM GPIO I as RTS and GPIO M as CTS.
186*05be20ccSMarek Vasut	 */
187*05be20ccSMarek Vasut	/delete-property/ uart-has-rtscts;
188*05be20ccSMarek Vasut	cts-gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>; /* GPIO M */
189*05be20ccSMarek Vasut	pinctrl-0 = <&pinctrl_uart1 &pinctrl_dhcom_i &pinctrl_dhcom_m>;
190*05be20ccSMarek Vasut	pinctrl-names = "default";
191*05be20ccSMarek Vasut	rts-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; /* GPIO I */
192*05be20ccSMarek Vasut};
193*05be20ccSMarek Vasut
194*05be20ccSMarek Vasut&uart3 {
195*05be20ccSMarek Vasut	/*
196*05be20ccSMarek Vasut	 * On DRC02 this UART is used as RS485 interface and RS485_TX_En is
197*05be20ccSMarek Vasut	 * controlled by DHCOM GPIO P. So remove RTS/CTS pins and the property
198*05be20ccSMarek Vasut	 * uart-has-rtscts from this UART and add the DHCOM GPIO P pin via
199*05be20ccSMarek Vasut	 * rts-gpios. The RS485_RX_En is controlled by DHCOM GPIO Q, see gpio1
200*05be20ccSMarek Vasut	 * node above.
201*05be20ccSMarek Vasut	 */
202*05be20ccSMarek Vasut	/delete-property/ uart-has-rtscts;
203*05be20ccSMarek Vasut	linux,rs485-enabled-at-boot-time;
204*05be20ccSMarek Vasut	pinctrl-0 = <&pinctrl_uart3 &pinctrl_dhcom_p &pinctrl_dhcom_q>;
205*05be20ccSMarek Vasut	pinctrl-names = "default";
206*05be20ccSMarek Vasut	rts-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>; /* GPIO P */
207*05be20ccSMarek Vasut};
208*05be20ccSMarek Vasut
209*05be20ccSMarek Vasut/* No WiFi/BT chipset on this SoM variant. */
210*05be20ccSMarek Vasut&uart2 {
211*05be20ccSMarek Vasut	bluetooth {
212*05be20ccSMarek Vasut		status = "disabled";
213*05be20ccSMarek Vasut	};
214*05be20ccSMarek Vasut};
215*05be20ccSMarek Vasut
216*05be20ccSMarek Vasut/* USB_OTG port is not routed out on DRC02. */
217*05be20ccSMarek Vasut&usb3_0 {
218*05be20ccSMarek Vasut	status = "disabled";
219*05be20ccSMarek Vasut};
220*05be20ccSMarek Vasut
221*05be20ccSMarek Vasut&usb_dwc3_0 {
222*05be20ccSMarek Vasut	status = "disabled";
223*05be20ccSMarek Vasut};
224*05be20ccSMarek Vasut
225*05be20ccSMarek Vasut/* USB_HOST port has USB Hub connected to it, PWR/OC pins are unused */
226*05be20ccSMarek Vasut&usb3_1 {
227*05be20ccSMarek Vasut	fsl,disable-port-power-control;
228*05be20ccSMarek Vasut	fsl,permanently-attached;
229*05be20ccSMarek Vasut};
230*05be20ccSMarek Vasut
231*05be20ccSMarek Vasut&usb_dwc3_1 {
232*05be20ccSMarek Vasut	dr_mode = "host";
233*05be20ccSMarek Vasut	maximum-speed = "high-speed";
234*05be20ccSMarek Vasut};
235*05be20ccSMarek Vasut
236*05be20ccSMarek Vasut/* No WiFi/BT chipset on this SoM variant. */
237*05be20ccSMarek Vasut&usdhc1 {
238*05be20ccSMarek Vasut	status = "disabled";
239*05be20ccSMarek Vasut};
240*05be20ccSMarek Vasut
241*05be20ccSMarek Vasut&iomuxc {
242*05be20ccSMarek Vasut	/*
243*05be20ccSMarek Vasut	 * GPIO I is connected to UART1_RTS
244*05be20ccSMarek Vasut	 * GPIO M is connected to UART1_CTS
245*05be20ccSMarek Vasut	 * GPIO P is connected to RS485_TX_En
246*05be20ccSMarek Vasut	 * GPIO Q is connected to RS485_RX_En
247*05be20ccSMarek Vasut	 */
248*05be20ccSMarek Vasut	pinctrl-0 = <&pinctrl_hog_base
249*05be20ccSMarek Vasut		     &pinctrl_dhcom_a &pinctrl_dhcom_b &pinctrl_dhcom_c
250*05be20ccSMarek Vasut		     &pinctrl_dhcom_d &pinctrl_dhcom_e &pinctrl_dhcom_f
251*05be20ccSMarek Vasut		     &pinctrl_dhcom_g &pinctrl_dhcom_h &pinctrl_dhcom_j
252*05be20ccSMarek Vasut		     &pinctrl_dhcom_k &pinctrl_dhcom_l &pinctrl_dhcom_n
253*05be20ccSMarek Vasut		     &pinctrl_dhcom_o &pinctrl_dhcom_r &pinctrl_dhcom_s
254*05be20ccSMarek Vasut		     &pinctrl_dhcom_int>;
255*05be20ccSMarek Vasut};
256