xref: /freebsd-src/sys/contrib/device-tree/src/arm64/freescale/imx8mp-dhcom-pdk3.dts (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
1*fac71e4eSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*fac71e4eSEmmanuel Vadot/*
3*fac71e4eSEmmanuel Vadot * Copyright (C) 2023 Marek Vasut <marex@denx.de>
4*fac71e4eSEmmanuel Vadot *
5*fac71e4eSEmmanuel Vadot * DHCOM iMX8MP variant:
6*fac71e4eSEmmanuel Vadot * DHCM-iMX8ML8-C160-R409-F1638-SPI16-GE-CAN2-SD-RTC-WBTA-ADC-T-RGB-CSI2-HS-I-01D2
7*fac71e4eSEmmanuel Vadot * DHCOM PCB number: 660-100 or newer
8*fac71e4eSEmmanuel Vadot * PDK3 PCB number: 669-100 or newer
9*fac71e4eSEmmanuel Vadot */
10*fac71e4eSEmmanuel Vadot
11*fac71e4eSEmmanuel Vadot/dts-v1/;
12*fac71e4eSEmmanuel Vadot
13*fac71e4eSEmmanuel Vadot#include <dt-bindings/leds/common.h>
14*fac71e4eSEmmanuel Vadot#include <dt-bindings/phy/phy-imx8-pcie.h>
15*fac71e4eSEmmanuel Vadot#include "imx8mp-dhcom-som.dtsi"
16*fac71e4eSEmmanuel Vadot
17*fac71e4eSEmmanuel Vadot/ {
18*fac71e4eSEmmanuel Vadot	model = "DH electronics i.MX8M Plus DHCOM Premium Developer Kit (3)";
19*fac71e4eSEmmanuel Vadot	compatible = "dh,imx8mp-dhcom-pdk3", "dh,imx8mp-dhcom-som",
20*fac71e4eSEmmanuel Vadot		     "fsl,imx8mp";
21*fac71e4eSEmmanuel Vadot
22*fac71e4eSEmmanuel Vadot	chosen {
23*fac71e4eSEmmanuel Vadot		stdout-path = &uart1;
24*fac71e4eSEmmanuel Vadot	};
25*fac71e4eSEmmanuel Vadot
26*fac71e4eSEmmanuel Vadot	clk_pcie: clock-pcie {
27*fac71e4eSEmmanuel Vadot		compatible = "fixed-clock";
28*fac71e4eSEmmanuel Vadot		#clock-cells = <0>;
29*fac71e4eSEmmanuel Vadot		clock-frequency = <100000000>;
30*fac71e4eSEmmanuel Vadot	};
31*fac71e4eSEmmanuel Vadot
32*fac71e4eSEmmanuel Vadot	connector {
33*fac71e4eSEmmanuel Vadot		compatible = "usb-c-connector";
34*fac71e4eSEmmanuel Vadot		label = "USB-C";
35*fac71e4eSEmmanuel Vadot		data-role = "dual";
36*fac71e4eSEmmanuel Vadot
37*fac71e4eSEmmanuel Vadot		ports {
38*fac71e4eSEmmanuel Vadot			#address-cells = <1>;
39*fac71e4eSEmmanuel Vadot			#size-cells = <0>;
40*fac71e4eSEmmanuel Vadot
41*fac71e4eSEmmanuel Vadot			port@0 {
42*fac71e4eSEmmanuel Vadot				reg = <0>;
43*fac71e4eSEmmanuel Vadot
44*fac71e4eSEmmanuel Vadot				usb_c_0_hs_ep: endpoint {
45*fac71e4eSEmmanuel Vadot					remote-endpoint = <&dwc3_0_hs_ep>;
46*fac71e4eSEmmanuel Vadot				};
47*fac71e4eSEmmanuel Vadot			};
48*fac71e4eSEmmanuel Vadot
49*fac71e4eSEmmanuel Vadot			port@1 {
50*fac71e4eSEmmanuel Vadot				reg = <1>;
51*fac71e4eSEmmanuel Vadot
52*fac71e4eSEmmanuel Vadot				usb_c_0_ss_ep: endpoint {
53*fac71e4eSEmmanuel Vadot					remote-endpoint = <&ptn5150_in_ep>;
54*fac71e4eSEmmanuel Vadot				};
55*fac71e4eSEmmanuel Vadot			};
56*fac71e4eSEmmanuel Vadot		};
57*fac71e4eSEmmanuel Vadot	};
58*fac71e4eSEmmanuel Vadot
59*fac71e4eSEmmanuel Vadot	gpio-keys {
60*fac71e4eSEmmanuel Vadot		compatible = "gpio-keys";
61*fac71e4eSEmmanuel Vadot
62*fac71e4eSEmmanuel Vadot		button-0 {
63*fac71e4eSEmmanuel Vadot			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; /* GPIO A */
64*fac71e4eSEmmanuel Vadot			label = "TA1-GPIO-A";
65*fac71e4eSEmmanuel Vadot			linux,code = <KEY_A>;
66*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_a>;
67*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
68*fac71e4eSEmmanuel Vadot			wakeup-source;
69*fac71e4eSEmmanuel Vadot		};
70*fac71e4eSEmmanuel Vadot
71*fac71e4eSEmmanuel Vadot		button-1 {
72*fac71e4eSEmmanuel Vadot			gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; /* GPIO B */
73*fac71e4eSEmmanuel Vadot			label = "TA2-GPIO-B";
74*fac71e4eSEmmanuel Vadot			linux,code = <KEY_B>;
75*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_b>;
76*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
77*fac71e4eSEmmanuel Vadot			wakeup-source;
78*fac71e4eSEmmanuel Vadot		};
79*fac71e4eSEmmanuel Vadot
80*fac71e4eSEmmanuel Vadot		button-2 {
81*fac71e4eSEmmanuel Vadot			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>; /* GPIO C */
82*fac71e4eSEmmanuel Vadot			label = "TA3-GPIO-C";
83*fac71e4eSEmmanuel Vadot			linux,code = <KEY_C>;
84*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_c>;
85*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
86*fac71e4eSEmmanuel Vadot			wakeup-source;
87*fac71e4eSEmmanuel Vadot		};
88*fac71e4eSEmmanuel Vadot
89*fac71e4eSEmmanuel Vadot		button-3 {
90*fac71e4eSEmmanuel Vadot			gpios = <&gpio5 22 GPIO_ACTIVE_LOW>; /* GPIO E */
91*fac71e4eSEmmanuel Vadot			label = "TA4-GPIO-E";
92*fac71e4eSEmmanuel Vadot			linux,code = <KEY_E>;
93*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_e>;
94*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
95*fac71e4eSEmmanuel Vadot			wakeup-source;
96*fac71e4eSEmmanuel Vadot		};
97*fac71e4eSEmmanuel Vadot	};
98*fac71e4eSEmmanuel Vadot
99*fac71e4eSEmmanuel Vadot	led {
100*fac71e4eSEmmanuel Vadot		compatible = "gpio-leds";
101*fac71e4eSEmmanuel Vadot
102*fac71e4eSEmmanuel Vadot		led-0 {
103*fac71e4eSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
104*fac71e4eSEmmanuel Vadot			default-state = "off";
105*fac71e4eSEmmanuel Vadot			function = LED_FUNCTION_INDICATOR;
106*fac71e4eSEmmanuel Vadot			function-enumerator = <0>;
107*fac71e4eSEmmanuel Vadot			gpios = <&gpio4 27 GPIO_ACTIVE_HIGH>; /* GPIO D */
108*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_d>;
109*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
110*fac71e4eSEmmanuel Vadot		};
111*fac71e4eSEmmanuel Vadot
112*fac71e4eSEmmanuel Vadot		led-1 {
113*fac71e4eSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
114*fac71e4eSEmmanuel Vadot			default-state = "off";
115*fac71e4eSEmmanuel Vadot			function = LED_FUNCTION_INDICATOR;
116*fac71e4eSEmmanuel Vadot			function-enumerator = <1>;
117*fac71e4eSEmmanuel Vadot			gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* GPIO F */
118*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_f>;
119*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
120*fac71e4eSEmmanuel Vadot		};
121*fac71e4eSEmmanuel Vadot
122*fac71e4eSEmmanuel Vadot		led-2 {
123*fac71e4eSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
124*fac71e4eSEmmanuel Vadot			default-state = "off";
125*fac71e4eSEmmanuel Vadot			function = LED_FUNCTION_INDICATOR;
126*fac71e4eSEmmanuel Vadot			function-enumerator = <2>;
127*fac71e4eSEmmanuel Vadot			gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; /* GPIO G */
128*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_g>;
129*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
130*fac71e4eSEmmanuel Vadot		};
131*fac71e4eSEmmanuel Vadot
132*fac71e4eSEmmanuel Vadot		led-3 {
133*fac71e4eSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
134*fac71e4eSEmmanuel Vadot			default-state = "off";
135*fac71e4eSEmmanuel Vadot			function = LED_FUNCTION_INDICATOR;
136*fac71e4eSEmmanuel Vadot			function-enumerator = <3>;
137*fac71e4eSEmmanuel Vadot			gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; /* GPIO I */
138*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_dhcom_i>;
139*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
140*fac71e4eSEmmanuel Vadot		};
141*fac71e4eSEmmanuel Vadot	};
142*fac71e4eSEmmanuel Vadot
143*fac71e4eSEmmanuel Vadot	reg_avdd: regulator-avdd {	/* AUDIO_VDD */
144*fac71e4eSEmmanuel Vadot		compatible = "regulator-fixed";
145*fac71e4eSEmmanuel Vadot		regulator-always-on;
146*fac71e4eSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
147*fac71e4eSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
148*fac71e4eSEmmanuel Vadot		regulator-name = "AUDIO_VDD";
149*fac71e4eSEmmanuel Vadot	};
150*fac71e4eSEmmanuel Vadot};
151*fac71e4eSEmmanuel Vadot
152*fac71e4eSEmmanuel Vadot&i2c5 {
153*fac71e4eSEmmanuel Vadot	i2c-mux@70 {
154*fac71e4eSEmmanuel Vadot		compatible = "nxp,pca9540";
155*fac71e4eSEmmanuel Vadot		reg = <0x70>;
156*fac71e4eSEmmanuel Vadot		#address-cells = <1>;
157*fac71e4eSEmmanuel Vadot		#size-cells = <0>;
158*fac71e4eSEmmanuel Vadot
159*fac71e4eSEmmanuel Vadot		i2cmuxed0: i2c@0 {
160*fac71e4eSEmmanuel Vadot			#address-cells = <1>;
161*fac71e4eSEmmanuel Vadot			#size-cells = <0>;
162*fac71e4eSEmmanuel Vadot			reg = <0>;
163*fac71e4eSEmmanuel Vadot
164*fac71e4eSEmmanuel Vadot			typec@3d {
165*fac71e4eSEmmanuel Vadot				compatible = "nxp,ptn5150";
166*fac71e4eSEmmanuel Vadot				reg = <0x3d>;
167*fac71e4eSEmmanuel Vadot				interrupt-parent = <&gpio4>;
168*fac71e4eSEmmanuel Vadot				interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
169*fac71e4eSEmmanuel Vadot				pinctrl-names = "default";
170*fac71e4eSEmmanuel Vadot				pinctrl-0 = <&pinctrl_ptn5150>;
171*fac71e4eSEmmanuel Vadot
172*fac71e4eSEmmanuel Vadot				ports {
173*fac71e4eSEmmanuel Vadot					#address-cells = <1>;
174*fac71e4eSEmmanuel Vadot					#size-cells = <0>;
175*fac71e4eSEmmanuel Vadot
176*fac71e4eSEmmanuel Vadot					port@0 {
177*fac71e4eSEmmanuel Vadot						reg = <0>;
178*fac71e4eSEmmanuel Vadot
179*fac71e4eSEmmanuel Vadot						ptn5150_in_ep: endpoint {
180*fac71e4eSEmmanuel Vadot							remote-endpoint = <&usb_c_0_ss_ep>;
181*fac71e4eSEmmanuel Vadot						};
182*fac71e4eSEmmanuel Vadot					};
183*fac71e4eSEmmanuel Vadot
184*fac71e4eSEmmanuel Vadot					port@1 {
185*fac71e4eSEmmanuel Vadot						reg = <1>;
186*fac71e4eSEmmanuel Vadot
187*fac71e4eSEmmanuel Vadot						ptn5150_out_ep: endpoint {
188*fac71e4eSEmmanuel Vadot							remote-endpoint = <&dwc3_0_ss_ep>;
189*fac71e4eSEmmanuel Vadot						};
190*fac71e4eSEmmanuel Vadot					};
191*fac71e4eSEmmanuel Vadot				};
192*fac71e4eSEmmanuel Vadot			};
193*fac71e4eSEmmanuel Vadot
194*fac71e4eSEmmanuel Vadot			power-sensor@40 {
195*fac71e4eSEmmanuel Vadot			    compatible = "ti,ina238";
196*fac71e4eSEmmanuel Vadot			    reg = <0x40>;
197*fac71e4eSEmmanuel Vadot			    shunt-resistor = <20000>;	/* 0.02 R */
198*fac71e4eSEmmanuel Vadot			    ti,shunt-gain = <1>;	/* Drop cca. 40mV */
199*fac71e4eSEmmanuel Vadot			};
200*fac71e4eSEmmanuel Vadot
201*fac71e4eSEmmanuel Vadot			eeprom_board: eeprom@54 {
202*fac71e4eSEmmanuel Vadot				compatible = "atmel,24c04";
203*fac71e4eSEmmanuel Vadot				pagesize = <16>;
204*fac71e4eSEmmanuel Vadot				reg = <0x54>;
205*fac71e4eSEmmanuel Vadot			};
206*fac71e4eSEmmanuel Vadot		};
207*fac71e4eSEmmanuel Vadot
208*fac71e4eSEmmanuel Vadot		i2cmuxed1: i2c@1 {	/* HDMI DDC I2C */
209*fac71e4eSEmmanuel Vadot			#address-cells = <1>;
210*fac71e4eSEmmanuel Vadot			#size-cells = <0>;
211*fac71e4eSEmmanuel Vadot			reg = <1>;
212*fac71e4eSEmmanuel Vadot		};
213*fac71e4eSEmmanuel Vadot	};
214*fac71e4eSEmmanuel Vadot};
215*fac71e4eSEmmanuel Vadot
216*fac71e4eSEmmanuel Vadot&ethphy0g {
217*fac71e4eSEmmanuel Vadot	reg = <7>;
218*fac71e4eSEmmanuel Vadot};
219*fac71e4eSEmmanuel Vadot
220*fac71e4eSEmmanuel Vadot&fec {	/* Second ethernet */
221*fac71e4eSEmmanuel Vadot	pinctrl-0 = <&pinctrl_fec_rgmii>;
222*fac71e4eSEmmanuel Vadot	phy-handle = <&ethphypdk>;
223*fac71e4eSEmmanuel Vadot	phy-mode = "rgmii-id";
224*fac71e4eSEmmanuel Vadot
225*fac71e4eSEmmanuel Vadot	mdio {
226*fac71e4eSEmmanuel Vadot		ethphypdk: ethernet-phy@7 { /* Micrel KSZ9131RNXI */
227*fac71e4eSEmmanuel Vadot			compatible = "ethernet-phy-id0022.1642",
228*fac71e4eSEmmanuel Vadot				     "ethernet-phy-ieee802.3-c22";
229*fac71e4eSEmmanuel Vadot			interrupt-parent = <&gpio4>;
230*fac71e4eSEmmanuel Vadot			interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
231*fac71e4eSEmmanuel Vadot			pinctrl-0 = <&pinctrl_ethphy1>;
232*fac71e4eSEmmanuel Vadot			pinctrl-names = "default";
233*fac71e4eSEmmanuel Vadot			reg = <7>;
234*fac71e4eSEmmanuel Vadot			reset-assert-us = <1000>;
235*fac71e4eSEmmanuel Vadot			/* RESET_N signal rise time ~100ms */
236*fac71e4eSEmmanuel Vadot			reset-deassert-us = <120000>;
237*fac71e4eSEmmanuel Vadot			reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
238*fac71e4eSEmmanuel Vadot		};
239*fac71e4eSEmmanuel Vadot	};
240*fac71e4eSEmmanuel Vadot};
241*fac71e4eSEmmanuel Vadot
242*fac71e4eSEmmanuel Vadot&flexcan1 {
243*fac71e4eSEmmanuel Vadot	status = "okay";
244*fac71e4eSEmmanuel Vadot};
245*fac71e4eSEmmanuel Vadot
246*fac71e4eSEmmanuel Vadot&pcie_phy {
247*fac71e4eSEmmanuel Vadot	clocks = <&clk_pcie>;
248*fac71e4eSEmmanuel Vadot	clock-names = "ref";
249*fac71e4eSEmmanuel Vadot	fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>;
250*fac71e4eSEmmanuel Vadot	status = "okay";
251*fac71e4eSEmmanuel Vadot};
252*fac71e4eSEmmanuel Vadot
253*fac71e4eSEmmanuel Vadot&pcie {
254*fac71e4eSEmmanuel Vadot	fsl,max-link-speed = <3>;
255*fac71e4eSEmmanuel Vadot	reset-gpio = <&gpio1 6 GPIO_ACTIVE_LOW>;
256*fac71e4eSEmmanuel Vadot	status = "okay";
257*fac71e4eSEmmanuel Vadot};
258*fac71e4eSEmmanuel Vadot
259*fac71e4eSEmmanuel Vadot&usb_dwc3_0 {
260*fac71e4eSEmmanuel Vadot	usb-role-switch;
261*fac71e4eSEmmanuel Vadot
262*fac71e4eSEmmanuel Vadot	port {
263*fac71e4eSEmmanuel Vadot		#address-cells = <1>;
264*fac71e4eSEmmanuel Vadot		#size-cells = <0>;
265*fac71e4eSEmmanuel Vadot
266*fac71e4eSEmmanuel Vadot		dwc3_0_hs_ep: endpoint@0 {
267*fac71e4eSEmmanuel Vadot			reg = <0>;
268*fac71e4eSEmmanuel Vadot			remote-endpoint = <&usb_c_0_hs_ep>;
269*fac71e4eSEmmanuel Vadot		};
270*fac71e4eSEmmanuel Vadot
271*fac71e4eSEmmanuel Vadot		dwc3_0_ss_ep: endpoint@1 {
272*fac71e4eSEmmanuel Vadot			reg = <1>;
273*fac71e4eSEmmanuel Vadot			remote-endpoint = <&ptn5150_out_ep>;
274*fac71e4eSEmmanuel Vadot		};
275*fac71e4eSEmmanuel Vadot	};
276*fac71e4eSEmmanuel Vadot};
277*fac71e4eSEmmanuel Vadot
278*fac71e4eSEmmanuel Vadot&usb3_1 {
279*fac71e4eSEmmanuel Vadot	fsl,disable-port-power-control;
280*fac71e4eSEmmanuel Vadot	fsl,permanently-attached;
281*fac71e4eSEmmanuel Vadot};
282*fac71e4eSEmmanuel Vadot
283*fac71e4eSEmmanuel Vadot&usb_dwc3_1 {
284*fac71e4eSEmmanuel Vadot	/* This port has USB5734 Hub connected to it, PWR/OC pins are unused */
285*fac71e4eSEmmanuel Vadot	/delete-property/ pinctrl-names;
286*fac71e4eSEmmanuel Vadot	/delete-property/ pinctrl-0;
287*fac71e4eSEmmanuel Vadot};
288*fac71e4eSEmmanuel Vadot
289*fac71e4eSEmmanuel Vadot&iomuxc {
290*fac71e4eSEmmanuel Vadot	/*
291*fac71e4eSEmmanuel Vadot	 * GPIO_A,B,C,E are connected to buttons.
292*fac71e4eSEmmanuel Vadot	 * GPIO_D,F,G,I are connected to LEDs.
293*fac71e4eSEmmanuel Vadot	 * GPIO_H is connected to USB Hub RESET_N.
294*fac71e4eSEmmanuel Vadot	 * GPIO_M is connected to CLKOUT2.
295*fac71e4eSEmmanuel Vadot	 */
296*fac71e4eSEmmanuel Vadot	pinctrl-0 = <&pinctrl_hog_base
297*fac71e4eSEmmanuel Vadot		     &pinctrl_dhcom_h &pinctrl_dhcom_j &pinctrl_dhcom_k
298*fac71e4eSEmmanuel Vadot		     &pinctrl_dhcom_l
299*fac71e4eSEmmanuel Vadot		     &pinctrl_dhcom_int>;
300*fac71e4eSEmmanuel Vadot
301*fac71e4eSEmmanuel Vadot	pinctrl_ptn5150: ptn5150grp {
302*fac71e4eSEmmanuel Vadot		fsl,pins = <
303*fac71e4eSEmmanuel Vadot			MX8MP_IOMUXC_SAI2_TXC__GPIO4_IO25		0x40000000
304*fac71e4eSEmmanuel Vadot		>;
305*fac71e4eSEmmanuel Vadot	};
306*fac71e4eSEmmanuel Vadot};
307