xref: /linux/arch/arm64/boot/dts/ti/k3-am62p-verdin-ivy.dtsi (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2/*
3 * Copyright 2025 Toradex
4 *
5 * Common dtsi for Verdin AM62P SoM on Ivy carrier board
6 *
7 * https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62p
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	aliases {
17		eeprom1 = &carrier_eeprom;
18	};
19
20	/* AIN1 Voltage w/o AIN1_MODE gpio control */
21	ain1_voltage_unmanaged: voltage-divider-ain1 {
22		compatible = "voltage-divider";
23		#io-channel-cells = <1>;
24		io-channels = <&ivy_adc1 0>;
25		full-ohms = <19>;
26		output-ohms = <1>;
27	};
28
29	/* AIN1 Current w/o AIN1_MODE gpio control */
30	ain1_current_unmanaged: current-sense-shunt-ain1 {
31		compatible = "current-sense-shunt";
32		#io-channel-cells = <0>;
33		io-channels = <&ivy_adc1 1>;
34		shunt-resistor-micro-ohms = <100000000>;
35	};
36
37	/* AIN1_MODE - SODIMM 216 */
38	ain1_mode_mux_ctrl: mux-controller-0 {
39		compatible = "gpio-mux";
40		pinctrl-names = "default";
41		pinctrl-0 = <&pinctrl_gpio_5>;
42		#mux-control-cells = <0>;
43		mux-gpios = <&main_gpio0 49 GPIO_ACTIVE_HIGH>;
44	};
45
46	ain1-voltage {
47		compatible = "io-channel-mux";
48		channels = "ain1_voltage", "";
49		io-channels = <&ain1_voltage_unmanaged 0>;
50		io-channel-names = "parent";
51		mux-controls = <&ain1_mode_mux_ctrl>;
52		settle-time-us = <1000>;
53	};
54
55	ain1-current {
56		compatible = "io-channel-mux";
57		channels = "", "ain1_current";
58		io-channels = <&ain1_current_unmanaged>;
59		io-channel-names = "parent";
60		mux-controls = <&ain1_mode_mux_ctrl>;
61		settle-time-us = <1000>;
62	};
63
64	/* AIN2 Voltage w/o AIN2_MODE gpio control */
65	ain2_voltage_unmanaged: voltage-divider-ain2 {
66		compatible = "voltage-divider";
67		#io-channel-cells = <1>;
68		io-channels = <&ivy_adc2 0>;
69		full-ohms = <19>;
70		output-ohms = <1>;
71	};
72
73	/* AIN2 Current w/o AIN2_MODE gpio control */
74	ain2_current_unmanaged: current-sense-shunt-ain2 {
75		compatible = "current-sense-shunt";
76		#io-channel-cells = <0>;
77		io-channels = <&ivy_adc2 1>;
78		shunt-resistor-micro-ohms = <100000000>;
79	};
80
81	/* AIN2_MODE - SODIMM 218 */
82	ain2_mode_mux_ctrl: mux-controller-1 {
83		compatible = "gpio-mux";
84		pinctrl-names = "default";
85		pinctrl-0 = <&pinctrl_gpio_6>;
86		#mux-control-cells = <0>;
87		mux-gpios = <&main_gpio0 50 GPIO_ACTIVE_HIGH>;
88	};
89
90	ain2-voltage {
91		compatible = "io-channel-mux";
92		channels = "ain2_voltage", "";
93		io-channels = <&ain2_voltage_unmanaged 0>;
94		io-channel-names = "parent";
95		mux-controls = <&ain2_mode_mux_ctrl>;
96		settle-time-us = <1000>;
97	};
98
99	ain2-current {
100		compatible = "io-channel-mux";
101		channels = "", "ain2_current";
102		io-channels = <&ain2_current_unmanaged>;
103		io-channel-names = "parent";
104		mux-controls = <&ain2_mode_mux_ctrl>;
105		settle-time-us = <1000>;
106	};
107
108	leds {
109		compatible = "gpio-leds";
110		pinctrl-names = "default";
111		pinctrl-0 = <&pinctrl_ivy_leds>;
112
113		/* D7 Blue - SODIMM 30 - LEDs.GPIO1 */
114		led-0 {
115			color = <LED_COLOR_ID_BLUE>;
116			default-state = "off";
117			function = LED_FUNCTION_STATUS;
118			function-enumerator = <1>;
119			gpios = <&main_gpio1 11 GPIO_ACTIVE_HIGH>;
120		};
121
122		/* D7 Green - SODIMM 32 - LEDs.GPIO2 */
123		led-1 {
124			color = <LED_COLOR_ID_GREEN>;
125			default-state = "off";
126			function = LED_FUNCTION_STATUS;
127			function-enumerator = <1>;
128			gpios = <&main_gpio1 12 GPIO_ACTIVE_HIGH>;
129		};
130
131		/* D7 Red - SODIMM 34 - LEDs.GPIO3 */
132		led-2 {
133			color = <LED_COLOR_ID_RED>;
134			default-state = "off";
135			function = LED_FUNCTION_STATUS;
136			function-enumerator = <1>;
137			gpios = <&main_gpio1 10 GPIO_ACTIVE_HIGH>;
138		};
139
140		/* D8 Blue - SODIMM 36 - LEDs.GPIO4 */
141		led-3 {
142			color = <LED_COLOR_ID_BLUE>;
143			default-state = "off";
144			function = LED_FUNCTION_STATUS;
145			function-enumerator = <2>;
146			gpios = <&main_gpio1 9 GPIO_ACTIVE_HIGH>;
147		};
148
149		/* D8 Green - SODIMM 54 - LEDs.GPIO5 */
150		led-4 {
151			color = <LED_COLOR_ID_GREEN>;
152			default-state = "off";
153			function = LED_FUNCTION_STATUS;
154			function-enumerator = <2>;
155			gpios = <&main_gpio0 11 GPIO_ACTIVE_HIGH>;
156		};
157
158		/* D8 Red - SODIMM 44 - LEDs.GPIO6 */
159		led-5 {
160			color = <LED_COLOR_ID_RED>;
161			default-state = "off";
162			function = LED_FUNCTION_STATUS;
163			function-enumerator = <2>;
164			gpios = <&main_gpio0 37 GPIO_ACTIVE_HIGH>;
165		};
166
167		/* D9 Blue - SODIMM 46 - LEDs.GPIO7 */
168		led-6 {
169			color = <LED_COLOR_ID_BLUE>;
170			default-state = "off";
171			function = LED_FUNCTION_STATUS;
172			function-enumerator = <3>;
173			gpios = <&main_gpio0 34 GPIO_ACTIVE_HIGH>;
174		};
175
176		/* D9 Red - SODIMM 48 - LEDs.GPIO8 */
177		led-7 {
178			color = <LED_COLOR_ID_RED>;
179			default-state = "off";
180			function = LED_FUNCTION_STATUS;
181			function-enumerator = <3>;
182			gpios = <&main_gpio0 33 GPIO_ACTIVE_HIGH>;
183		};
184	};
185
186	reg_3v2_ain1: regulator-3v2-ain1 {
187		compatible = "regulator-fixed";
188		regulator-max-microvolt = <3200000>;
189		regulator-min-microvolt = <3200000>;
190		regulator-name = "+3V2_AIN1";
191	};
192
193	reg_3v2_ain2: regulator-3v2-ain2 {
194		compatible = "regulator-fixed";
195		regulator-max-microvolt = <3200000>;
196		regulator-min-microvolt = <3200000>;
197		regulator-name = "+3V2_AIN2";
198	};
199
200	/* Ivy Power Supply Input Voltage */
201	ivy-input-voltage {
202		compatible = "voltage-divider";
203		/* Verdin ADC_1 */
204		io-channels = <&som_adc 7>;
205		full-ohms = <204700>; /* 200K + 4.7K */
206		output-ohms = <4700>;
207	};
208
209	ivy-5v-voltage {
210		compatible = "voltage-divider";
211		/* Verdin ADC_2 */
212		io-channels = <&som_adc 6>;
213		full-ohms = <39000>; /* 27K + 12K */
214		output-ohms = <12000>;
215	};
216
217	ivy-3v3-voltage {
218		compatible = "voltage-divider";
219		/* Verdin ADC_3 */
220		io-channels = <&som_adc 5>;
221		full-ohms = <54000>; /* 27K + 27K */
222		output-ohms = <27000>;
223	};
224
225	ivy-1v8-voltage {
226		compatible = "voltage-divider";
227		/* Verdin ADC_4 */
228		io-channels = <&som_adc 4>;
229		full-ohms = <39000>; /* 12K + 27K */
230		output-ohms = <27000>;
231	};
232};
233
234&main_pmx0 {
235	pinctrl_ivy_leds: ivy-leds-default-pins {
236		pinctrl-single,pins = <
237			AM62PX_IOPAD(0x019c, PIN_INPUT, 7) /* (E24)  MCASP0_AXR1.GPIO1_9    */ /* SODIMM 36 */
238			AM62PX_IOPAD(0x01a0, PIN_INPUT, 7) /* (F23)  MCASP0_AXR0.GPIO1_10   */ /* SODIMM 34 */
239			AM62PX_IOPAD(0x01a4, PIN_INPUT, 7) /* (F24)  MCASP0_ACLKX.GPIO1_11  */ /* SODIMM 30 */
240			AM62PX_IOPAD(0x01a8, PIN_INPUT, 7) /* (F25)  MCASP0_AFSX.GPIO1_12   */ /* SODIMM 32 */
241			AM62PX_IOPAD(0x0088, PIN_INPUT, 7) /* (R24)  GPMC0_OEn_REn.GPIO0_33 */ /* SODIMM 48 */
242			AM62PX_IOPAD(0x0098, PIN_INPUT, 7) /* (AA24) GPMC0_WAIT0.GPIO0_37   */ /* SODIMM 44 */
243			AM62PX_IOPAD(0x008c, PIN_INPUT, 7) /* (T25)  GPMC0_WEn.GPIO0_34     */ /* SODIMM 46 */
244			AM62PX_IOPAD(0x002c, PIN_INPUT, 7) /* (M25)  OSPI0_CSn0.GPIO0_11    */ /* SODIMM 54 */
245		>;
246	};
247};
248
249/* Verdin ETHs */
250&cpsw3g {
251	pinctrl-names = "default";
252	pinctrl-0 = <&pinctrl_rgmii1>, <&pinctrl_rgmii2>;
253	status = "okay";
254};
255
256/* MDIO, shared by Verdin ETH_1 (On-module PHY) and Verdin ETH_2_RGMII */
257&cpsw3g_mdio {
258	status = "okay";
259
260	carrier_eth_phy: ethernet-phy@2 {
261		reg = <2>;
262		pinctrl-names = "default";
263		pinctrl-0 = <&pinctrl_eth2_rgmii_int>;
264		interrupt-parent = <&main_gpio0>;
265		interrupts = <42 IRQ_TYPE_EDGE_FALLING>;
266		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
267	};
268};
269
270/* Verdin ETH_1 (On-module PHY) */
271&cpsw_port1 {
272	status = "okay";
273};
274
275/* Verdin ETH_2_RGMII */
276&cpsw_port2 {
277	phy-handle = <&carrier_eth_phy>;
278	phy-mode = "rgmii-rxid";
279	status = "okay";
280};
281
282&main_gpio0 {
283	pinctrl-names = "default";
284	pinctrl-0 = <&pinctrl_pcie_1_reset>,
285		    <&pinctrl_qspi1_cs2_gpio>,
286		    <&pinctrl_qspi1_dqs_gpio>,
287		    <&pinctrl_qspi1_io0_gpio>,
288		    <&pinctrl_qspi1_io1_gpio>,
289		    <&pinctrl_qspi1_io2_gpio>,
290		    <&pinctrl_qspi1_io3_gpio>;
291	gpio-line-names =
292		"", /* 0 */
293		"",
294		"REL4",   /* SODIMM 66 */
295		"DIGI_1", /* SODIMM 56 */
296		"DIGI_2", /* SODIMM 58 */
297		"REL1",   /* SODIMM 60 */
298		"REL2",   /* SODIMM 62 */
299		"",
300		"",
301		"",
302		"", /* 10 */
303		"",
304		"REL3", /* SODIMM 64 */
305		"",
306		"",
307		"",
308		"",
309		"",
310		"",
311		"",
312		"", /* 20 */
313		"",
314		"",
315		"",
316		"",
317		"",
318		"",
319		"",
320		"",
321		"",
322		"", /* 30 */
323		"",
324		"",
325		"",
326		"",
327		"",
328		"",
329		"",
330		"",
331		"",
332		"", /* 40 */
333		"",
334		"",
335		"",
336		"",
337		"",
338		"",
339		"",
340		"",
341		"",
342		"", /* 50 */
343		"",
344		"",
345		"",
346		"",
347		"",
348		"",
349		"",
350		"",
351		"",
352		"", /* 60 */
353		"",
354		"",
355		"",
356		"",
357		"",
358		"",
359		"",
360		"",
361		"",
362		"", /* 70 */
363		"",
364		"",
365		"",
366		"",
367		"",
368		"",
369		"",
370		"",
371		"",
372		"", /* 80 */
373		"",
374		"",
375		"",
376		"",
377		"",
378		"",
379		"",
380		"",
381		"",
382		"", /* 90 */
383		"";
384};
385
386&main_gpio1 {
387	gpio-line-names =
388		"", /* 0 */
389		"",
390		"",
391		"",
392		"",
393		"",
394		"",
395		"",
396		"",
397		"",
398		"", /* 10 */
399		"",
400		"",
401		"",
402		"",
403		"",
404		"",
405		"",
406		"",
407		"",
408		"", /* 20 */
409		"",
410		"",
411		"",
412		"",
413		"",
414		"",
415		"",
416		"",
417		"",
418		"", /* 30 */
419		"",
420		"",
421		"",
422		"",
423		"",
424		"",
425		"",
426		"",
427		"",
428		"", /* 40 */
429		"",
430		"",
431		"",
432		"",
433		"",
434		"",
435		"",
436		"",
437		"",
438		"", /* 50 */
439		"";
440};
441
442/* Verdin I2C_1 */
443&main_i2c0 {
444	status = "okay";
445
446	temperature-sensor@4f {
447		compatible = "ti,tmp1075";
448		reg = <0x4f>;
449	};
450
451	carrier_eeprom: eeprom@57 {
452		compatible = "st,24c02", "atmel,24c02";
453		reg = <0x57>;
454		pagesize = <16>;
455	};
456};
457
458/* Verdin I2C_4_CSI */
459&main_i2c3 {
460	status = "okay";
461
462	ivy_adc1: adc@40 {
463		compatible = "ti,ads1119";
464		reg = <0x40>;
465		pinctrl-names = "default";
466		pinctrl-0 = <&pinctrl_gpio_7>;
467		interrupt-parent = <&main_gpio0>;
468		interrupts = <51 IRQ_TYPE_EDGE_FALLING>;
469		avdd-supply = <&reg_3v2_ain1>;
470		dvdd-supply = <&reg_3v2_ain1>;
471		vref-supply = <&reg_3v2_ain1>;
472		#address-cells = <1>;
473		#io-channel-cells = <1>;
474		#size-cells = <0>;
475
476		/* AIN1 0-33V Voltage Input */
477		channel@0 {
478			reg = <0>;
479			diff-channels = <0 1>;
480		};
481
482		/* AIN1 0-20mA Current Input */
483		channel@1 {
484			reg = <1>;
485			diff-channels = <2 3>;
486		};
487	};
488
489	ivy_adc2: adc@41 {
490		compatible = "ti,ads1119";
491		reg = <0x41>;
492		pinctrl-names = "default";
493		pinctrl-0 = <&pinctrl_gpio_8>;
494		interrupt-parent = <&main_gpio0>;
495		interrupts = <52 IRQ_TYPE_EDGE_FALLING>;
496		avdd-supply = <&reg_3v2_ain2>;
497		dvdd-supply = <&reg_3v2_ain2>;
498		vref-supply = <&reg_3v2_ain2>;
499		#address-cells = <1>;
500		#io-channel-cells = <1>;
501		#size-cells = <0>;
502
503		/* AIN2 0-33V Voltage Input */
504		channel@0 {
505			reg = <0>;
506			diff-channels = <0 1>;
507		};
508
509		/* AIN2 0-20mA Current Input */
510		channel@1 {
511			reg = <1>;
512			diff-channels = <2 3>;
513		};
514	};
515};
516
517/* Verdin CAN_1 */
518&main_mcan0 {
519	status = "okay";
520};
521
522/* Verdin SPI_1 */
523&main_spi1 {
524	pinctrl-0 = <&pinctrl_main_spi1>,
525		    <&pinctrl_main_spi1_cs0>,
526		    <&pinctrl_gpio_1>,
527		    <&pinctrl_gpio_4>;
528	cs-gpios = <0>,
529		   <&mcu_gpio0 1 GPIO_ACTIVE_LOW>,
530		   <&mcu_gpio0 4 GPIO_ACTIVE_LOW>;
531	status = "okay";
532
533	tpm@1 {
534		compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
535		reg = <1>;
536		spi-max-frequency = <18500000>;
537	};
538
539	fram@2 {
540		compatible = "fujitsu,mb85rs256", "atmel,at25";
541		reg = <2>;
542		address-width = <16>;
543		size = <32768>;
544		spi-max-frequency = <33000000>;
545		pagesize = <1>;
546	};
547};
548
549/* Verdin UART_3, used as the Linux console */
550&main_uart0 {
551	status = "okay";
552};
553
554/* Verdin UART_1 */
555&main_uart1 {
556	status = "okay";
557};
558
559&mcu_gpio0 {
560	pinctrl-names = "default";
561	pinctrl-0 = <&pinctrl_gpio_2>,
562		    <&pinctrl_gpio_3>;
563	gpio-line-names =
564		"",
565		"",
566		"GPIO2", /* Verdin GPIO_2 - SODIMM 208 */
567		"GPIO3", /* Verdin GPIO_3 - SODIMM 210 */
568		"",
569		"",
570		"",
571		"",
572		"",
573		"",
574		"", /* 10 */
575		"",
576		"",
577		"",
578		"",
579		"",
580		"",
581		"",
582		"",
583		"",
584		"", /* 20 */
585		"",
586		"",
587		"";
588};
589
590/* Verdin CAN_2 */
591&mcu_mcan0 {
592	status = "okay";
593};
594
595/* Verdin SD_1 */
596&sdhci1 {
597	status = "okay";
598};
599
600/* Verdin USB_1 */
601&usbss0 {
602	status = "okay";
603};
604
605&usb0 {
606	status = "okay";
607};
608
609/* Verdin USB_2 */
610&usbss1 {
611	status = "okay";
612};
613
614&usb1 {
615	status = "okay";
616};
617
618/* Verdin PCIE_1_RESET# */
619&verdin_pcie_1_reset_hog {
620	status = "okay";
621};
622
623/* Verdin UART_2 */
624&wkup_uart0 {
625	rs485-rts-active-low;
626	rs485-rx-during-tx;
627	linux,rs485-enabled-at-boot-time;
628	status = "okay";
629};
630