xref: /freebsd/sys/contrib/device-tree/src/arm64/freescale/imx8mn-rve-gateway.dts (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1*8d13bc63SEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*8d13bc63SEmmanuel Vadot/*
3*8d13bc63SEmmanuel Vadot * Copyright 2023 DimOnOff
4*8d13bc63SEmmanuel Vadot */
5*8d13bc63SEmmanuel Vadot
6*8d13bc63SEmmanuel Vadot/dts-v1/;
7*8d13bc63SEmmanuel Vadot
8*8d13bc63SEmmanuel Vadot#include <dt-bindings/usb/pd.h>
9*8d13bc63SEmmanuel Vadot#include "imx8mn-var-som.dtsi"
10*8d13bc63SEmmanuel Vadot
11*8d13bc63SEmmanuel Vadot/ {
12*8d13bc63SEmmanuel Vadot	model = "RVE gateway";
13*8d13bc63SEmmanuel Vadot	compatible = "rve,rve-gateway", "variscite,var-som-mx8mn", "fsl,imx8mn";
14*8d13bc63SEmmanuel Vadot
15*8d13bc63SEmmanuel Vadot	crystal_duart_24m: crystal-duart-24m {
16*8d13bc63SEmmanuel Vadot		compatible = "fixed-clock";
17*8d13bc63SEmmanuel Vadot		#clock-cells = <0>;
18*8d13bc63SEmmanuel Vadot		clock-frequency = <24000000>;
19*8d13bc63SEmmanuel Vadot	};
20*8d13bc63SEmmanuel Vadot
21*8d13bc63SEmmanuel Vadot	gpio-keys {
22*8d13bc63SEmmanuel Vadot		compatible = "gpio-keys";
23*8d13bc63SEmmanuel Vadot		pinctrl-names = "default";
24*8d13bc63SEmmanuel Vadot		pinctrl-0 = <&pinctrl_gpio_keys>;
25*8d13bc63SEmmanuel Vadot
26*8d13bc63SEmmanuel Vadot		key-enter {
27*8d13bc63SEmmanuel Vadot			label = "enter";
28*8d13bc63SEmmanuel Vadot			gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
29*8d13bc63SEmmanuel Vadot			linux,code = <KEY_ENTER>;
30*8d13bc63SEmmanuel Vadot		};
31*8d13bc63SEmmanuel Vadot
32*8d13bc63SEmmanuel Vadot		key-exit {
33*8d13bc63SEmmanuel Vadot			label = "exit";
34*8d13bc63SEmmanuel Vadot			gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
35*8d13bc63SEmmanuel Vadot			linux,code = <KEY_ESC>;
36*8d13bc63SEmmanuel Vadot		};
37*8d13bc63SEmmanuel Vadot	};
38*8d13bc63SEmmanuel Vadot
39*8d13bc63SEmmanuel Vadot	lcd {
40*8d13bc63SEmmanuel Vadot		compatible = "hit,hd44780";
41*8d13bc63SEmmanuel Vadot		display-height-chars = <2>;
42*8d13bc63SEmmanuel Vadot		display-width-chars = <20>;
43*8d13bc63SEmmanuel Vadot		pinctrl-names = "default";
44*8d13bc63SEmmanuel Vadot		pinctrl-0 = <&pinctrl_lcd>;
45*8d13bc63SEmmanuel Vadot		data-gpios = <&gpio5  1 GPIO_ACTIVE_HIGH>,
46*8d13bc63SEmmanuel Vadot			     <&gpio1  6 GPIO_ACTIVE_HIGH>,
47*8d13bc63SEmmanuel Vadot			     <&gpio1 14 GPIO_ACTIVE_HIGH>,
48*8d13bc63SEmmanuel Vadot			     <&gpio4 28 GPIO_ACTIVE_HIGH>,
49*8d13bc63SEmmanuel Vadot			     <&gpio5 24 GPIO_ACTIVE_HIGH>,
50*8d13bc63SEmmanuel Vadot			     <&gpio5  2 GPIO_ACTIVE_HIGH>,
51*8d13bc63SEmmanuel Vadot			     <&gpio1 12 GPIO_ACTIVE_HIGH>,
52*8d13bc63SEmmanuel Vadot			     <&gpio5 25 GPIO_ACTIVE_HIGH>;
53*8d13bc63SEmmanuel Vadot		enable-gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>;
54*8d13bc63SEmmanuel Vadot		rs-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
55*8d13bc63SEmmanuel Vadot		rw-gpios = <&gpio4 27 GPIO_ACTIVE_HIGH>;
56*8d13bc63SEmmanuel Vadot	};
57*8d13bc63SEmmanuel Vadot
58*8d13bc63SEmmanuel Vadot	reg_3p3v: regulator-3p3v {
59*8d13bc63SEmmanuel Vadot		compatible = "regulator-fixed";
60*8d13bc63SEmmanuel Vadot		regulator-name = "3P3V";
61*8d13bc63SEmmanuel Vadot		regulator-min-microvolt = <3300000>;
62*8d13bc63SEmmanuel Vadot		regulator-max-microvolt = <3300000>;
63*8d13bc63SEmmanuel Vadot		regulator-always-on;
64*8d13bc63SEmmanuel Vadot	};
65*8d13bc63SEmmanuel Vadot
66*8d13bc63SEmmanuel Vadot	/* Bourns PEC12R rotary encoder, 24 steps. */
67*8d13bc63SEmmanuel Vadot	rotary: rotary-encoder {
68*8d13bc63SEmmanuel Vadot		compatible = "rotary-encoder";
69*8d13bc63SEmmanuel Vadot		pinctrl-names = "default";
70*8d13bc63SEmmanuel Vadot		pinctrl-0 = <&pinctrl_rotary>;
71*8d13bc63SEmmanuel Vadot		gpios = <&gpio1  5 GPIO_ACTIVE_LOW>, /* A */
72*8d13bc63SEmmanuel Vadot			<&gpio3 21 GPIO_ACTIVE_LOW>; /* B */
73*8d13bc63SEmmanuel Vadot		linux,axis = <0>; /* REL_X */
74*8d13bc63SEmmanuel Vadot		rotary-encoder,encoding = "gray";
75*8d13bc63SEmmanuel Vadot		rotary-encoder,relative-axis;
76*8d13bc63SEmmanuel Vadot	};
77*8d13bc63SEmmanuel Vadot};
78*8d13bc63SEmmanuel Vadot
79*8d13bc63SEmmanuel Vadot&ecspi1 {
80*8d13bc63SEmmanuel Vadot	cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
81*8d13bc63SEmmanuel Vadot
82*8d13bc63SEmmanuel Vadot	duart1: serial@0 {
83*8d13bc63SEmmanuel Vadot		compatible = "nxp,sc16is752";
84*8d13bc63SEmmanuel Vadot		reg = <0>;
85*8d13bc63SEmmanuel Vadot		spi-rx-bus-width = <1>;
86*8d13bc63SEmmanuel Vadot		spi-tx-bus-width = <1>;
87*8d13bc63SEmmanuel Vadot		spi-max-frequency = <4000000>;
88*8d13bc63SEmmanuel Vadot		clocks = <&crystal_duart_24m>;
89*8d13bc63SEmmanuel Vadot		interrupt-parent = <&gpio3>;
90*8d13bc63SEmmanuel Vadot		interrupts = <22 IRQ_TYPE_EDGE_FALLING>;
91*8d13bc63SEmmanuel Vadot		gpio-controller;
92*8d13bc63SEmmanuel Vadot		#gpio-cells = <2>;
93*8d13bc63SEmmanuel Vadot		gpio-line-names = "RADIO0", "RADIO1", "RADIO2", "RADIO3",
94*8d13bc63SEmmanuel Vadot				  "RADIO4", "RADIO_RESET", "TP12", "TP11";
95*8d13bc63SEmmanuel Vadot		linux,rs485-enabled-at-boot-time;
96*8d13bc63SEmmanuel Vadot		rs485-rts-active-low;
97*8d13bc63SEmmanuel Vadot	};
98*8d13bc63SEmmanuel Vadot
99*8d13bc63SEmmanuel Vadot	/delete-node/ touchscreen@0;
100*8d13bc63SEmmanuel Vadot};
101*8d13bc63SEmmanuel Vadot
102*8d13bc63SEmmanuel Vadot&ecspi2 {
103*8d13bc63SEmmanuel Vadot	pinctrl-names = "default";
104*8d13bc63SEmmanuel Vadot	pinctrl-0 = <&pinctrl_ecspi2>;
105*8d13bc63SEmmanuel Vadot	cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
106*8d13bc63SEmmanuel Vadot	/delete-property/ dmas;
107*8d13bc63SEmmanuel Vadot	/delete-property/ dma-names;
108*8d13bc63SEmmanuel Vadot	status = "okay";
109*8d13bc63SEmmanuel Vadot
110*8d13bc63SEmmanuel Vadot	duart2: serial@0 {
111*8d13bc63SEmmanuel Vadot		compatible = "nxp,sc16is752";
112*8d13bc63SEmmanuel Vadot		reg = <0>;
113*8d13bc63SEmmanuel Vadot		spi-rx-bus-width = <1>;
114*8d13bc63SEmmanuel Vadot		spi-tx-bus-width = <1>;
115*8d13bc63SEmmanuel Vadot		spi-max-frequency = <4000000>;
116*8d13bc63SEmmanuel Vadot		clocks = <&crystal_duart_24m>;
117*8d13bc63SEmmanuel Vadot		interrupt-parent = <&gpio3>;
118*8d13bc63SEmmanuel Vadot		interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
119*8d13bc63SEmmanuel Vadot		gpio-controller;
120*8d13bc63SEmmanuel Vadot		#gpio-cells = <2>;
121*8d13bc63SEmmanuel Vadot		gpio-line-names = "LED_B_USER", "LED_R_USER", "LED_G_USER",
122*8d13bc63SEmmanuel Vadot				  "GPIO_EXT3", "GPIO_EXT2", "GPIO_EXT1",
123*8d13bc63SEmmanuel Vadot				  "GPIO_EXT0", "TP13";
124*8d13bc63SEmmanuel Vadot		linux,rs485-enabled-at-boot-time;
125*8d13bc63SEmmanuel Vadot		rs485-rts-active-low;
126*8d13bc63SEmmanuel Vadot	};
127*8d13bc63SEmmanuel Vadot};
128*8d13bc63SEmmanuel Vadot
129*8d13bc63SEmmanuel Vadot/* Configure PWM pins in GPIO mode: */
130*8d13bc63SEmmanuel Vadot&gpio5 {
131*8d13bc63SEmmanuel Vadot	gpio-line-names = "", "", "", "PWM3", "PWM2", "PWM1";
132*8d13bc63SEmmanuel Vadot};
133*8d13bc63SEmmanuel Vadot
134*8d13bc63SEmmanuel Vadot&gpu {
135*8d13bc63SEmmanuel Vadot	status = "disabled";
136*8d13bc63SEmmanuel Vadot};
137*8d13bc63SEmmanuel Vadot
138*8d13bc63SEmmanuel Vadot&i2c2 {
139*8d13bc63SEmmanuel Vadot	clock-frequency = <400000>;
140*8d13bc63SEmmanuel Vadot	pinctrl-names = "default";
141*8d13bc63SEmmanuel Vadot	pinctrl-0 = <&pinctrl_i2c2>;
142*8d13bc63SEmmanuel Vadot	status = "okay";
143*8d13bc63SEmmanuel Vadot
144*8d13bc63SEmmanuel Vadot	/* Carrier board EEPROM */
145*8d13bc63SEmmanuel Vadot	eeprom_cb: eeprom@56 {
146*8d13bc63SEmmanuel Vadot		compatible = "atmel,24c04";
147*8d13bc63SEmmanuel Vadot		reg = <0x56>;
148*8d13bc63SEmmanuel Vadot		pagesize = <16>;
149*8d13bc63SEmmanuel Vadot		vcc-supply = <&reg_3p3v>;
150*8d13bc63SEmmanuel Vadot	};
151*8d13bc63SEmmanuel Vadot
152*8d13bc63SEmmanuel Vadot	lm75: sensor@48 {
153*8d13bc63SEmmanuel Vadot		compatible = "st,stlm75";
154*8d13bc63SEmmanuel Vadot		reg = <0x48>;
155*8d13bc63SEmmanuel Vadot		vs-supply = <&reg_3p3v>;
156*8d13bc63SEmmanuel Vadot	};
157*8d13bc63SEmmanuel Vadot
158*8d13bc63SEmmanuel Vadot	mcp7940: rtc@6f {
159*8d13bc63SEmmanuel Vadot		compatible = "microchip,mcp7940x";
160*8d13bc63SEmmanuel Vadot		reg = <0x6f>;
161*8d13bc63SEmmanuel Vadot	};
162*8d13bc63SEmmanuel Vadot};
163*8d13bc63SEmmanuel Vadot
164*8d13bc63SEmmanuel Vadot&i2c3 {
165*8d13bc63SEmmanuel Vadot	codec@1a {
166*8d13bc63SEmmanuel Vadot		status = "disabled";
167*8d13bc63SEmmanuel Vadot	};
168*8d13bc63SEmmanuel Vadot};
169*8d13bc63SEmmanuel Vadot
170*8d13bc63SEmmanuel Vadot&i2c4 {
171*8d13bc63SEmmanuel Vadot	clock-frequency = <400000>;
172*8d13bc63SEmmanuel Vadot	pinctrl-names = "default";
173*8d13bc63SEmmanuel Vadot	pinctrl-0 = <&pinctrl_i2c4>;
174*8d13bc63SEmmanuel Vadot	status = "okay";
175*8d13bc63SEmmanuel Vadot
176*8d13bc63SEmmanuel Vadot	pcf8574_1: gpio@38 {
177*8d13bc63SEmmanuel Vadot		compatible = "nxp,pcf8574";
178*8d13bc63SEmmanuel Vadot		reg = <0x38>;
179*8d13bc63SEmmanuel Vadot		gpio-controller;
180*8d13bc63SEmmanuel Vadot		#gpio-cells = <2>;
181*8d13bc63SEmmanuel Vadot		gpio-line-names = "LED_B_COMM3", "LED_R_COMM3", "LED_G_COMM3",
182*8d13bc63SEmmanuel Vadot				  "TP14", "TP15", "LED_G_COMM4", "LED_R_COMM4",
183*8d13bc63SEmmanuel Vadot				  "LED_B_COMM4";
184*8d13bc63SEmmanuel Vadot	};
185*8d13bc63SEmmanuel Vadot
186*8d13bc63SEmmanuel Vadot	pcf8574_2: gpio@39 {
187*8d13bc63SEmmanuel Vadot		compatible = "nxp,pcf8574";
188*8d13bc63SEmmanuel Vadot		reg = <0x39>;
189*8d13bc63SEmmanuel Vadot		gpio-controller;
190*8d13bc63SEmmanuel Vadot		#gpio-cells = <2>;
191*8d13bc63SEmmanuel Vadot		gpio-line-names = "LED_B_COMM2", "LED_G_COMM2", "LED_B_COMM1",
192*8d13bc63SEmmanuel Vadot				  "LED_R_COMM2", "LED_R_COMM1", "LED_G_COMM1",
193*8d13bc63SEmmanuel Vadot				  "TP16", "TP17";
194*8d13bc63SEmmanuel Vadot	};
195*8d13bc63SEmmanuel Vadot};
196*8d13bc63SEmmanuel Vadot
197*8d13bc63SEmmanuel Vadot/* Bluetooth */
198*8d13bc63SEmmanuel Vadot&uart2 {
199*8d13bc63SEmmanuel Vadot	status = "disabled";
200*8d13bc63SEmmanuel Vadot};
201*8d13bc63SEmmanuel Vadot
202*8d13bc63SEmmanuel Vadot&usbotg1 {
203*8d13bc63SEmmanuel Vadot	dr_mode = "host";
204*8d13bc63SEmmanuel Vadot	disable-over-current;
205*8d13bc63SEmmanuel Vadot	status = "okay";
206*8d13bc63SEmmanuel Vadot};
207*8d13bc63SEmmanuel Vadot
208*8d13bc63SEmmanuel Vadot/* SD interface on expansion connector. */
209*8d13bc63SEmmanuel Vadot&usdhc2 {
210*8d13bc63SEmmanuel Vadot	vmmc-supply = <&reg_3p3v>;
211*8d13bc63SEmmanuel Vadot	cd-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
212*8d13bc63SEmmanuel Vadot};
213*8d13bc63SEmmanuel Vadot
214*8d13bc63SEmmanuel Vadot&iomuxc {
215*8d13bc63SEmmanuel Vadot	pinctrl_ecspi1: ecspi1grp {
216*8d13bc63SEmmanuel Vadot		fsl,pins = <
217*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK	0x13
218*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI	0x13
219*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI1_MISO_ECSPI1_MISO	0x13
220*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI1_SS0_GPIO5_IO9	0x13 /* SS0 */
221*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI5_RXD1_GPIO3_IO22	0x13 /* SC16 IRQ */
222*8d13bc63SEmmanuel Vadot		>;
223*8d13bc63SEmmanuel Vadot	};
224*8d13bc63SEmmanuel Vadot
225*8d13bc63SEmmanuel Vadot	pinctrl_ecspi2: ecspi2grp {
226*8d13bc63SEmmanuel Vadot		fsl,pins = <
227*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK	0x13
228*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI	0x13
229*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI2_MISO_ECSPI2_MISO	0x13
230*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_ECSPI2_SS0_GPIO5_IO13	0x13 /* SS0 */
231*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI5_RXC_GPIO3_IO20	0x13 /* SC16 IRQ */
232*8d13bc63SEmmanuel Vadot		>;
233*8d13bc63SEmmanuel Vadot	};
234*8d13bc63SEmmanuel Vadot
235*8d13bc63SEmmanuel Vadot	pinctrl_gpio_keys: gpiokeysgrp {
236*8d13bc63SEmmanuel Vadot		fsl,pins = <
237*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO01_GPIO1_IO1	0xc6 /* Enter */
238*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI5_RXD2_GPIO3_IO23	0xc6 /* Exit */
239*8d13bc63SEmmanuel Vadot		>;
240*8d13bc63SEmmanuel Vadot	};
241*8d13bc63SEmmanuel Vadot
242*8d13bc63SEmmanuel Vadot	pinctrl_i2c2: i2c2grp {
243*8d13bc63SEmmanuel Vadot		fsl,pins = <
244*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_I2C2_SCL_I2C2_SCL		0x400001c3
245*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_I2C2_SDA_I2C2_SDA		0x400001c3
246*8d13bc63SEmmanuel Vadot		>;
247*8d13bc63SEmmanuel Vadot	};
248*8d13bc63SEmmanuel Vadot
249*8d13bc63SEmmanuel Vadot	pinctrl_i2c4: i2c4grp {
250*8d13bc63SEmmanuel Vadot		fsl,pins = <
251*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_I2C4_SCL_I2C4_SCL		0x400001c3
252*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_I2C4_SDA_I2C4_SDA		0x400001c3
253*8d13bc63SEmmanuel Vadot		>;
254*8d13bc63SEmmanuel Vadot	};
255*8d13bc63SEmmanuel Vadot
256*8d13bc63SEmmanuel Vadot	pinctrl_lcd: lcdgrp {
257*8d13bc63SEmmanuel Vadot		fsl,pins = <
258*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI3_TXD_GPIO5_IO1		0x00000156 /* D0 */
259*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO06_GPIO1_IO6	0x00000156 /* D1 */
260*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO14_GPIO1_IO14	0x00000156 /* D2 */
261*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI3_RXFS_GPIO4_IO28	0x00000156 /* D3 */
262*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_UART2_RXD_GPIO5_IO24	0x00000156 /* D4 */
263*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI3_MCLK_GPIO5_IO2	0x00000156 /* D5 */
264*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x00000156 /* D6 */
265*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_UART2_TXD_GPIO5_IO25	0x00000156 /* D7 */
266*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_UART1_TXD_GPIO5_IO23	0x00000156 /* E */
267*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO07_GPIO1_IO7	0x00000156 /* RS */
268*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI2_MCLK_GPIO4_IO27	0x00000156 /* R/W */
269*8d13bc63SEmmanuel Vadot		>;
270*8d13bc63SEmmanuel Vadot	};
271*8d13bc63SEmmanuel Vadot
272*8d13bc63SEmmanuel Vadot	pinctrl_rotary: rotarygrp {
273*8d13bc63SEmmanuel Vadot		fsl,pins = <
274*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x00000156 /* A */
275*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_SAI5_RXD0_GPIO3_IO21	0x00000156 /* B */
276*8d13bc63SEmmanuel Vadot		>;
277*8d13bc63SEmmanuel Vadot	};
278*8d13bc63SEmmanuel Vadot
279*8d13bc63SEmmanuel Vadot	/* Override Card Detect function GPIO value (GPIO1_IO10) from SOM: */
280*8d13bc63SEmmanuel Vadot	pinctrl_usdhc2_gpio: usdhc2gpiogrp {
281*8d13bc63SEmmanuel Vadot		fsl,pins = <
282*8d13bc63SEmmanuel Vadot			MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13	0x41
283*8d13bc63SEmmanuel Vadot		>;
284*8d13bc63SEmmanuel Vadot	};
285*8d13bc63SEmmanuel Vadot};
286