aboutsummaryrefslogtreecommitdiff
path: root/src/arm64/freescale/imx8mn-rve-gateway.dts
blob: ea1855171fb03c23a4b60ca2c23682f37cf471d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright 2023 DimOnOff
 */

/dts-v1/;

#include <dt-bindings/usb/pd.h>
#include "imx8mn-var-som.dtsi"

/ {
	model = "RVE gateway";
	compatible = "rve,gateway", "variscite,var-som-mx8mn", "fsl,imx8mn";

	crystal_duart_24m: crystal-duart-24m {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <24000000>;
	};

	gpio-keys {
		compatible = "gpio-keys";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_gpio_keys>;

		key-enter {
			label = "enter";
			gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_ENTER>;
		};

		key-exit {
			label = "exit";
			gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_ESC>;
		};
	};

	lcd {
		compatible = "hit,hd44780";
		display-height-chars = <2>;
		display-width-chars = <20>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_lcd>;
		data-gpios = <&gpio5  1 GPIO_ACTIVE_HIGH>,
			     <&gpio1  6 GPIO_ACTIVE_HIGH>,
			     <&gpio1 14 GPIO_ACTIVE_HIGH>,
			     <&gpio4 28 GPIO_ACTIVE_HIGH>,
			     <&gpio5 24 GPIO_ACTIVE_HIGH>,
			     <&gpio5  2 GPIO_ACTIVE_HIGH>,
			     <&gpio1 12 GPIO_ACTIVE_HIGH>,
			     <&gpio5 25 GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>;
		rs-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
		rw-gpios = <&gpio4 27 GPIO_ACTIVE_HIGH>;
	};

	reg_3p3v: regulator-3p3v {
		compatible = "regulator-fixed";
		regulator-name = "3P3V";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	/* Bourns PEC12R rotary encoder, 24 steps. */
	rotary: rotary-encoder {
		compatible = "rotary-encoder";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_rotary>;
		gpios = <&gpio1  5 GPIO_ACTIVE_LOW>, /* A */
			<&gpio3 21 GPIO_ACTIVE_LOW>; /* B */
		linux,axis = <0>; /* REL_X */
		rotary-encoder,encoding = "gray";
		rotary-encoder,relative-axis;
	};
};

&ecspi1 {
	cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;

	duart1: serial@0 {
		compatible = "nxp,sc16is752";
		reg = <0>;
		spi-rx-bus-width = <1>;
		spi-tx-bus-width = <1>;
		spi-max-frequency = <4000000>;
		clocks = <&crystal_duart_24m>;
		interrupt-parent = <&gpio3>;
		interrupts = <22 IRQ_TYPE_EDGE_FALLING>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "RADIO0", "RADIO1", "RADIO2", "RADIO3",
				  "RADIO4", "RADIO_RESET", "TP12", "TP11";
		linux,rs485-enabled-at-boot-time;
		rs485-rts-active-low;
	};

	/delete-node/ touchscreen@0;
};

&ecspi2 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi2>;
	cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
	/delete-property/ dmas;
	/delete-property/ dma-names;
	status = "okay";

	duart2: serial@0 {
		compatible = "nxp,sc16is752";
		reg = <0>;
		spi-rx-bus-width = <1>;
		spi-tx-bus-width = <1>;
		spi-max-frequency = <4000000>;
		clocks = <&crystal_duart_24m>;
		interrupt-parent = <&gpio3>;
		interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "LED_B_USER", "LED_R_USER", "LED_G_USER",
				  "GPIO_EXT3", "GPIO_EXT2", "GPIO_EXT1",
				  "GPIO_EXT0", "TP13";
		linux,rs485-enabled-at-boot-time;
		rs485-rts-active-low;
	};
};

/* Configure PWM pins in GPIO mode: */
&gpio5 {
	gpio-line-names = "", "", "", "PWM3", "PWM2", "PWM1";
};

&gpu {
	status = "disabled";
};

&i2c2 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c2>;
	status = "okay";

	/* Carrier board EEPROM */
	eeprom_cb: eeprom@56 {
		compatible = "atmel,24c04";
		reg = <0x56>;
		pagesize = <16>;
		vcc-supply = <&reg_3p3v>;
	};

	lm75: sensor@48 {
		compatible = "st,stlm75";
		reg = <0x48>;
		vs-supply = <&reg_3p3v>;
	};

	mcp7940: rtc@6f {
		compatible = "microchip,mcp7940x";
		reg = <0x6f>;
	};
};

&i2c3 {
	codec@1a {
		status = "disabled";
	};
};

&i2c4 {
	clock-frequency = <400000>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_i2c4>;
	status = "okay";

	pcf8574_1: gpio@38 {
		compatible = "nxp,pcf8574";
		reg = <0x38>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "LED_B_COMM3", "LED_R_COMM3", "LED_G_COMM3",
				  "TP14", "TP15", "LED_G_COMM4", "LED_R_COMM4",
				  "LED_B_COMM4";
	};

	pcf8574_2: gpio@39 {
		compatible = "nxp,pcf8574";
		reg = <0x39>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names = "LED_B_COMM2", "LED_G_COMM2", "LED_B_COMM1",
				  "LED_R_COMM2", "LED_R_COMM1", "LED_G_COMM1",
				  "TP16", "TP17";
	};
};

/* Bluetooth */
&uart2 {
	status = "disabled";
};

&usbotg1 {
	dr_mode = "host";
	disable-over-current;
	status = "okay";
};

/* SD interface on expansion connector. */
&usdhc2 {
	vmmc-supply = <&reg_3p3v>;
	cd-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
};

&iomuxc {
	pinctrl_ecspi1: ecspi1grp {
		fsl,pins = <
			MX8MN_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK	0x13
			MX8MN_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI	0x13
			MX8MN_IOMUXC_ECSPI1_MISO_ECSPI1_MISO	0x13
			MX8MN_IOMUXC_ECSPI1_SS0_GPIO5_IO9	0x13 /* SS0 */
			MX8MN_IOMUXC_SAI5_RXD1_GPIO3_IO22	0x13 /* SC16 IRQ */
		>;
	};

	pinctrl_ecspi2: ecspi2grp {
		fsl,pins = <
			MX8MN_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK	0x13
			MX8MN_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI	0x13
			MX8MN_IOMUXC_ECSPI2_MISO_ECSPI2_MISO	0x13
			MX8MN_IOMUXC_ECSPI2_SS0_GPIO5_IO13	0x13 /* SS0 */
			MX8MN_IOMUXC_SAI5_RXC_GPIO3_IO20	0x13 /* SC16 IRQ */
		>;
	};

	pinctrl_gpio_keys: gpiokeysgrp {
		fsl,pins = <
			MX8MN_IOMUXC_GPIO1_IO01_GPIO1_IO1	0xc6 /* Enter */
			MX8MN_IOMUXC_SAI5_RXD2_GPIO3_IO23	0xc6 /* Exit */
		>;
	};

	pinctrl_i2c2: i2c2grp {
		fsl,pins = <
			MX8MN_IOMUXC_I2C2_SCL_I2C2_SCL		0x400001c3
			MX8MN_IOMUXC_I2C2_SDA_I2C2_SDA		0x400001c3
		>;
	};

	pinctrl_i2c4: i2c4grp {
		fsl,pins = <
			MX8MN_IOMUXC_I2C4_SCL_I2C4_SCL		0x400001c3
			MX8MN_IOMUXC_I2C4_SDA_I2C4_SDA		0x400001c3
		>;
	};

	pinctrl_lcd: lcdgrp {
		fsl,pins = <
			MX8MN_IOMUXC_SAI3_TXD_GPIO5_IO1		0x00000156 /* D0 */
			MX8MN_IOMUXC_GPIO1_IO06_GPIO1_IO6	0x00000156 /* D1 */
			MX8MN_IOMUXC_GPIO1_IO14_GPIO1_IO14	0x00000156 /* D2 */
			MX8MN_IOMUXC_SAI3_RXFS_GPIO4_IO28	0x00000156 /* D3 */
			MX8MN_IOMUXC_UART2_RXD_GPIO5_IO24	0x00000156 /* D4 */
			MX8MN_IOMUXC_SAI3_MCLK_GPIO5_IO2	0x00000156 /* D5 */
			MX8MN_IOMUXC_GPIO1_IO12_GPIO1_IO12	0x00000156 /* D6 */
			MX8MN_IOMUXC_UART2_TXD_GPIO5_IO25	0x00000156 /* D7 */
			MX8MN_IOMUXC_UART1_TXD_GPIO5_IO23	0x00000156 /* E */
			MX8MN_IOMUXC_GPIO1_IO07_GPIO1_IO7	0x00000156 /* RS */
			MX8MN_IOMUXC_SAI2_MCLK_GPIO4_IO27	0x00000156 /* R/W */
		>;
	};

	pinctrl_rotary: rotarygrp {
		fsl,pins = <
			MX8MN_IOMUXC_GPIO1_IO05_GPIO1_IO5	0x00000156 /* A */
			MX8MN_IOMUXC_SAI5_RXD0_GPIO3_IO21	0x00000156 /* B */
		>;
	};

	/* Override Card Detect function GPIO value (GPIO1_IO10) from SOM: */
	pinctrl_usdhc2_gpio: usdhc2gpiogrp {
		fsl,pins = <
			MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13	0x41
		>;
	};
};