xref: /linux/arch/arm64/boot/dts/freescale/imx8mm-verdin-ivy.dtsi (revision fcc79e1714e8c2b8e216dc3149812edd37884eef)
1// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2/*
3 * Copyright 2024 Toradex
4 *
5 * Common dtsi for Verdin IMX8MM SoM on Ivy carrier board
6 *
7 * https://www.toradex.com/computer-on-modules/verdin-arm-family/nxp-imx-8m-mini-nano
8 * https://www.toradex.com/products/carrier-board/ivy-carrier-board
9 */
10
11#include <dt-bindings/mux/mux.h>
12#include <dt-bindings/leds/common.h>
13
14/ {
15	/* AIN1 Voltage w/o AIN1_MODE gpio control */
16	ain1_voltage_unmanaged: voltage-divider-ain1 {
17		compatible = "voltage-divider";
18		#io-channel-cells = <1>;
19		io-channels = <&ivy_adc1 0>;
20		full-ohms = <19>;
21		output-ohms = <1>;
22	};
23
24	/* AIN1 Current w/o AIN1_MODE gpio control */
25	ain1_current_unmanaged: current-sense-shunt-ain1 {
26		compatible = "current-sense-shunt";
27		#io-channel-cells = <0>;
28		io-channels = <&ivy_adc1 1>;
29		shunt-resistor-micro-ohms = <100000000>;
30	};
31
32	/* AIN1_MODE - SODIMM 216 */
33	ain1_mode_mux_ctrl: mux-controller-0 {
34		compatible = "gpio-mux";
35		pinctrl-names = "default";
36		pinctrl-0 = <&pinctrl_gpio5>;
37		#mux-control-cells = <0>;
38		mux-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
39	};
40
41	ain1-voltage {
42		compatible = "io-channel-mux";
43		channels = "ain1_voltage", "";
44		io-channels = <&ain1_voltage_unmanaged 0>;
45		io-channel-names = "parent";
46		mux-controls = <&ain1_mode_mux_ctrl>;
47		settle-time-us = <1000>;
48	};
49
50	ain1-current {
51		compatible = "io-channel-mux";
52		channels = "", "ain1_current";
53		io-channels = <&ain1_current_unmanaged>;
54		io-channel-names = "parent";
55		mux-controls = <&ain1_mode_mux_ctrl>;
56		settle-time-us = <1000>;
57	};
58
59	/* AIN2 Voltage w/o AIN2_MODE gpio control */
60	ain2_voltage_unmanaged: voltage-divider-ain2 {
61		compatible = "voltage-divider";
62		#io-channel-cells = <1>;
63		io-channels = <&ivy_adc2 0>;
64		full-ohms = <19>;
65		output-ohms = <1>;
66	};
67
68	/* AIN2 Current w/o AIN2_MODE gpio control */
69	ain2_current_unmanaged: current-sense-shunt-ain2 {
70		compatible = "current-sense-shunt";
71		#io-channel-cells = <0>;
72		io-channels = <&ivy_adc2 1>;
73		shunt-resistor-micro-ohms = <100000000>;
74	};
75
76	/* AIN2_MODE - SODIMM 218 */
77	ain2_mode_mux_ctrl: mux-controller-1 {
78		compatible = "gpio-mux";
79		pinctrl-names = "default";
80		pinctrl-0 = <&pinctrl_gpio6>;
81		#mux-control-cells = <0>;
82		mux-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
83	};
84
85	ain2-voltage {
86		compatible = "io-channel-mux";
87		channels = "ain2_voltage", "";
88		io-channels = <&ain2_voltage_unmanaged 0>;
89		io-channel-names = "parent";
90		mux-controls = <&ain2_mode_mux_ctrl>;
91		settle-time-us = <1000>;
92	};
93
94	ain2-current {
95		compatible = "io-channel-mux";
96		channels = "", "ain2_current";
97		io-channels = <&ain2_current_unmanaged>;
98		io-channel-names = "parent";
99		mux-controls = <&ain2_mode_mux_ctrl>;
100		settle-time-us = <1000>;
101	};
102
103	leds {
104		compatible = "gpio-leds";
105		pinctrl-names = "default";
106		pinctrl-0 = <&pinctrl_ivy_leds>;
107
108		/* D7 Blue - SODIMM 30 - LEDs.GPIO1 */
109		led-0 {
110			color = <LED_COLOR_ID_BLUE>;
111			default-state = "off";
112			function = LED_FUNCTION_STATUS;
113			function-enumerator = <1>;
114			gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>;
115		};
116
117		/* D7 Green - SODIMM 32 - LEDs.GPIO2 */
118		led-1 {
119			color = <LED_COLOR_ID_GREEN>;
120			default-state = "off";
121			function = LED_FUNCTION_STATUS;
122			function-enumerator = <1>;
123			gpios = <&gpio4 24 GPIO_ACTIVE_HIGH>;
124		};
125
126		/* D7 Red - SODIMM 34 - LEDs.GPIO3 */
127		led-2 {
128			color = <LED_COLOR_ID_RED>;
129			default-state = "off";
130			function = LED_FUNCTION_STATUS;
131			function-enumerator = <1>;
132			gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>;
133		};
134
135		/* D8 Blue - SODIMM 36 - LEDs.GPIO4 */
136		led-3 {
137			color = <LED_COLOR_ID_BLUE>;
138			default-state = "off";
139			function = LED_FUNCTION_STATUS;
140			function-enumerator = <2>;
141			gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
142		};
143
144		/* D8 Green - SODIMM 54 - LEDs.GPIO5 */
145		led-4 {
146			color = <LED_COLOR_ID_GREEN>;
147			default-state = "off";
148			function = LED_FUNCTION_STATUS;
149			function-enumerator = <2>;
150			gpios = <&gpio3 1 GPIO_ACTIVE_HIGH>;
151		};
152
153		/* D8 Red - SODIMM 44 - LEDs.GPIO6 */
154		led-5 {
155			color = <LED_COLOR_ID_RED>;
156			default-state = "off";
157			function = LED_FUNCTION_STATUS;
158			function-enumerator = <2>;
159			gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;
160		};
161
162		/* D9 Blue - SODIMM 46 - LEDs.GPIO7 */
163		led-6 {
164			color = <LED_COLOR_ID_BLUE>;
165			default-state = "off";
166			function = LED_FUNCTION_STATUS;
167			function-enumerator = <3>;
168			gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
169		};
170
171		/* D9 Red - SODIMM 48 - LEDs.GPIO8 */
172		led-7 {
173			color = <LED_COLOR_ID_RED>;
174			default-state = "off";
175			function = LED_FUNCTION_STATUS;
176			function-enumerator = <3>;
177			gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
178		};
179	};
180
181	reg_3v2_ain1: regulator-3v2-ain1 {
182		compatible = "regulator-fixed";
183		regulator-max-microvolt = <3200000>;
184		regulator-min-microvolt = <3200000>;
185		regulator-name = "+3V2_AIN1";
186	};
187
188	reg_3v2_ain2: regulator-3v2-ain2 {
189		compatible = "regulator-fixed";
190		regulator-max-microvolt = <3200000>;
191		regulator-min-microvolt = <3200000>;
192		regulator-name = "+3V2_AIN2";
193	};
194
195	/* Ivy Power Supply Input Voltage */
196	ivy-input-voltage {
197		compatible = "voltage-divider";
198		/* Verdin ADC_1 */
199		io-channels = <&verdin_som_adc 7>;
200		full-ohms = <204700>; /* 200k + 4.7k */
201		output-ohms = <4700>;
202	};
203
204	ivy-5v-voltage {
205		compatible = "voltage-divider";
206		/* Verdin ADC_2 */
207		io-channels = <&verdin_som_adc 6>;
208		full-ohms = <39000>; /* 27k + 12k */
209		output-ohms = <12000>;
210	};
211
212	ivy-3v3-voltage {
213		compatible = "voltage-divider";
214		/* Verdin ADC_3 */
215		io-channels = <&verdin_som_adc 5>;
216		full-ohms = <54000>; /* 27k + 27k */
217		output-ohms = <27000>;
218	};
219
220	ivy-1v8-voltage {
221		compatible = "voltage-divider";
222		/* Verdin ADC_4 */
223		io-channels = <&verdin_som_adc 4>;
224		full-ohms = <39000>; /* 12k + 27k */
225		output-ohms = <27000>;
226	};
227};
228
229/* Verdin SPI_1 */
230&ecspi2 {
231	pinctrl-0 = <&pinctrl_ecspi2>,
232		    <&pinctrl_gpio1>,
233		    <&pinctrl_gpio4>;
234	cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>,
235		   <&gpio3 4 GPIO_ACTIVE_LOW>,
236		   <&gpio5 27 GPIO_ACTIVE_LOW>;
237	status = "okay";
238
239	tpm@1 {
240		compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
241		reg = <1>;
242		spi-max-frequency = <18500000>;
243	};
244
245	fram@2 {
246		compatible = "fujitsu,mb85rs256", "atmel,at25";
247		reg = <2>;
248		address-width = <16>;
249		size = <32768>;
250		spi-max-frequency = <33000000>;
251		pagesize = <1>;
252	};
253};
254
255/* EEPROM on Ivy */
256&eeprom_carrier_board {
257	status = "okay";
258};
259
260/* Verdin ETH_1 */
261&fec1 {
262	status = "okay";
263};
264
265&gpio3 {
266	gpio-line-names =
267		"", /* 0 */
268		"",
269		"REL3", /* SODIMM 64 */
270		"",
271		"",
272		"",
273		"DIG_1", /* SODIMM 56 */
274		"DIG_2", /* SODIMM 58 */
275		"REL1",  /* SODIMM 60 */
276		"REL2",  /* SODIMM 62 */
277		"", /* 10 */
278		"",
279		"",
280		"",
281		"REL4",  /* SODIMM 66 */
282		"",
283		"",
284		"",
285		"",
286		"",
287		"", /* 20 */
288		"",
289		"",
290		"",
291		"",
292		"";
293};
294
295&gpio5 {
296	gpio-line-names =
297		"", /* 0 */
298		"",
299		"",
300		"",
301		"",
302		"GPIO2", /* Verdin GPIO_2 - SODIMM 208 */
303		"",
304		"",
305		"",
306		"",
307		"", /* 10 */
308		"",
309		"",
310		"",
311		"",
312		"",
313		"",
314		"",
315		"",
316		"",
317		"", /* 20 */
318		"",
319		"",
320		"",
321		"",
322		"",
323		"GPIO3", /* Verdin GPIO_3 - SODIMM 210 */
324		"",
325		"",
326		"";
327};
328
329/* Temperature sensor on Ivy */
330&hwmon_temp {
331	compatible = "ti,tmp1075";
332	status = "okay";
333};
334
335/* Verdin I2C_4 CSI */
336&i2c3 {
337	status = "okay";
338
339	ivy_adc1: adc@40 {
340		compatible = "ti,ads1119";
341		reg = <0x40>;
342		pinctrl-names = "default";
343		pinctrl-0 = <&pinctrl_gpio7>;
344		interrupt-parent = <&gpio1>;
345		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
346		avdd-supply = <&reg_3v2_ain1>;
347		dvdd-supply = <&reg_3v2_ain1>;
348		vref-supply = <&reg_3v2_ain1>;
349		#address-cells = <1>;
350		#io-channel-cells = <1>;
351		#size-cells = <0>;
352
353		/* AIN1 0-33V Voltage Input */
354		channel@0 {
355			reg = <0>;
356			diff-channels = <0 1>;
357		};
358
359		/* AIN1 0-20mA Current Input */
360		channel@1 {
361			reg = <1>;
362			diff-channels = <2 3>;
363		};
364	};
365
366	ivy_adc2: adc@41 {
367		compatible = "ti,ads1119";
368		reg = <0x41>;
369		pinctrl-names = "default";
370		pinctrl-0 = <&pinctrl_gpio8>;
371		interrupt-parent = <&gpio1>;
372		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
373		avdd-supply = <&reg_3v2_ain2>;
374		dvdd-supply = <&reg_3v2_ain2>;
375		vref-supply = <&reg_3v2_ain2>;
376		#address-cells = <1>;
377		#io-channel-cells = <1>;
378		#size-cells = <0>;
379
380		/* AIN2 0-33V Voltage Input */
381		channel@0 {
382			reg = <0>;
383			diff-channels = <0 1>;
384		};
385
386		/* AIN2 0-20mA Current Input */
387		channel@1 {
388			reg = <1>;
389			diff-channels = <2 3>;
390		};
391	};
392};
393
394/* Verdin I2C_1 */
395&i2c4 {
396	status = "okay";
397};
398
399/* Verdin PCIE_1 */
400&pcie0 {
401	status = "okay";
402};
403
404&pcie_phy {
405	status = "okay";
406};
407
408/* Verdin UART_3 */
409&uart1 {
410	status = "okay";
411};
412
413/* Verdin UART_1 */
414&uart2 {
415	status = "okay";
416};
417
418/* Verdin UART_2 */
419&uart3 {
420	linux,rs485-enabled-at-boot-time;
421	rs485-rx-during-tx;
422	status = "okay";
423};
424
425/* Verdin USB_1*/
426&usbotg1 {
427	status = "okay";
428};
429
430/* Verdin USB_2 */
431&usbotg2 {
432	status = "okay";
433};
434
435/* Verdin SD_1 */
436&usdhc2 {
437	status = "okay";
438};
439
440&iomuxc {
441
442	pinctrl-names = "default";
443	pinctrl-0 = <&pinctrl_gpio2>, <&pinctrl_gpio3>,
444		    <&pinctrl_ivy_dig_inputs>, <&pinctrl_ivy_relays>;
445
446	pinctrl_ivy_dig_inputs: ivydiginputsgrp {
447		fsl,pins =
448			<MX8MM_IOMUXC_NAND_DATA00_GPIO3_IO6	0x96>, /* SODIMM 56 */
449			<MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7	0x96>; /* SODIMM 58 */
450	};
451
452	pinctrl_ivy_leds: ivyledsgrp {
453		fsl,pins =
454			<MX8MM_IOMUXC_SAI2_TXC_GPIO4_IO25	0x16>, /* SODIMM 30 */
455			<MX8MM_IOMUXC_SAI2_TXFS_GPIO4_IO24	0x16>, /* SODIMM 32 */
456			<MX8MM_IOMUXC_SAI2_TXD0_GPIO4_IO26	0x16>, /* SODIMM 34 */
457			<MX8MM_IOMUXC_SAI2_RXD0_GPIO4_IO23	0x16>, /* SODIMM 36 */
458			<MX8MM_IOMUXC_SAI5_RXD1_GPIO3_IO22	0x16>, /* SODIMM 44 */
459			<MX8MM_IOMUXC_SAI5_RXD3_GPIO3_IO24	0x16>, /* SODIMM 46 */
460			<MX8MM_IOMUXC_SAI5_RXD0_GPIO3_IO21	0x16>, /* SODIMM 48 */
461			<MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1	0x16>; /* SODIMM 54 */
462	};
463
464	pinctrl_ivy_relays: ivyrelaysgrp {
465		fsl,pins =
466			<MX8MM_IOMUXC_NAND_DATA02_GPIO3_IO8	0x16>, /* SODIMM 60 */
467			<MX8MM_IOMUXC_NAND_DATA03_GPIO3_IO9	0x16>, /* SODIMM 62 */
468			<MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2	0x16>, /* SODIMM 64 */
469			<MX8MM_IOMUXC_NAND_DQS_GPIO3_IO14	0x16>; /* SODIMM 66 */
470	};
471};
472