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