xref: /linux/arch/arm64/boot/dts/ti/k3-am62-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 AM62 SoM on Ivy carrier board
6 *
7 * https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62
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_gpio_5>;
38		#mux-control-cells = <0>;
39		mux-gpios = <&main_gpio0 40 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_gpio_6>;
82		#mux-control-cells = <0>;
83		mux-gpios = <&main_gpio0 36 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 = <&main_gpio1 11 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 = <&main_gpio1 12 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 = <&main_gpio1 10 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 = <&main_gpio1 9 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 = <&main_gpio0 11 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 = <&main_gpio0 37 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 = <&main_gpio0 34 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 = <&main_gpio0 33 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&main_pmx0 {
231	pinctrl_ivy_leds: ivy-leds-default-pins {
232		pinctrl-single,pins =
233			<AM62X_IOPAD(0x019c, PIN_INPUT, 7)>, /* (B18) MCASP0_AXR1.GPIO1_9    */ /* SODIMM 36 */
234			<AM62X_IOPAD(0x01a0, PIN_INPUT, 7)>, /* (B20) MCASP0_AXR0.GPIO1_10   */ /* SODIMM 34 */
235			<AM62X_IOPAD(0x01a4, PIN_INPUT, 7)>, /* (A19) MCASP0_ACLKX.GPIO1_11  */ /* SODIMM 30 */
236			<AM62X_IOPAD(0x01a8, PIN_INPUT, 7)>, /* (A20) MCASP0_AFSX.GPIO1_12   */ /* SODIMM 32 */
237			<AM62X_IOPAD(0x0088, PIN_INPUT, 7)>, /* (L17) GPMC0_OEn_REn.GPIO0_33 */ /* SODIMM 48 */
238			<AM62X_IOPAD(0x0098, PIN_INPUT, 7)>, /* (R18) GPMC0_WAIT0.GPIO0_37   */ /* SODIMM 44 */
239			<AM62X_IOPAD(0x008c, PIN_INPUT, 7)>, /* (L25) GPMC0_WEn.GPIO0_34     */ /* SODIMM 46 */
240			<AM62X_IOPAD(0x002c, PIN_INPUT, 7)>; /* (F23) OSPI0_CSn0.GPIO0_11    */ /* SODIMM 54 */
241	};
242};
243
244/* Verdin ETH */
245&cpsw3g {
246	status = "okay";
247};
248
249/* MDIO, shared by Verdin ETH_1 (On-module PHY) and Verdin ETH_2_RGMII */
250&cpsw3g_mdio {
251	status = "okay";
252
253	cpsw3g_phy1: ethernet-phy@2 {
254		reg = <2>;
255		pinctrl-names = "default";
256		pinctrl-0 = <&pinctrl_eth2_rgmii_int>;
257		interrupt-parent = <&main_gpio0>;
258		interrupts = <38 IRQ_TYPE_EDGE_FALLING>;
259		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
260	};
261};
262
263/* Verdin ETH_1*/
264&cpsw_port1 {
265	status = "okay";
266};
267
268/* Verdin ETH_2_RGMII */
269&cpsw_port2 {
270	phy-handle = <&cpsw3g_phy1>;
271	phy-mode = "rgmii-rxid";
272	status = "okay";
273};
274
275&main_gpio0 {
276	pinctrl-names = "default";
277	pinctrl-0 = <&pinctrl_ctrl_sleep_moci>,
278		    <&pinctrl_qspi1_cs2_gpio>,
279		    <&pinctrl_qspi1_io0_gpio>,
280		    <&pinctrl_qspi1_io1_gpio>,
281		    <&pinctrl_qspi1_io2_gpio>,
282		    <&pinctrl_qspi1_io3_gpio>;
283	gpio-line-names =
284		"", /* 0 */
285		"",
286		"",
287		"DIGI_1", /* SODIMM 56 */
288		"DIGI_2", /* SODIMM 58 */
289		"REL1",   /* SODIMM 60 */
290		"REL2",   /* SODIMM 62 */
291		"",
292		"",
293		"",
294		"", /* 10 */
295		"",
296		"REL3", /* SODIMM 64 */
297		"",
298		"",
299		"",
300		"",
301		"",
302		"",
303		"",
304		"", /* 20 */
305		"",
306		"",
307		"",
308		"",
309		"",
310		"",
311		"",
312		"",
313		"",
314		"", /* 30 */
315		"",
316		"",
317		"",
318		"",
319		"",
320		"",
321		"",
322		"",
323		"",
324		"", /* 40 */
325		"",
326		"",
327		"",
328		"",
329		"",
330		"",
331		"",
332		"",
333		"",
334		"", /* 50 */
335		"",
336		"",
337		"",
338		"",
339		"",
340		"",
341		"",
342		"",
343		"",
344		"", /* 60 */
345		"",
346		"",
347		"",
348		"",
349		"",
350		"",
351		"",
352		"",
353		"",
354		"", /* 70 */
355		"",
356		"",
357		"",
358		"",
359		"",
360		"",
361		"",
362		"",
363		"",
364		"", /* 80 */
365		"",
366		"",
367		"",
368		"",
369		"",
370		"";
371};
372
373&main_gpio1 {
374	pinctrl-names = "default";
375	pinctrl-0 = <&pinctrl_qspi1_dqs_gpio>;
376	gpio-line-names =
377		"", /* 0 */
378		"",
379		"",
380		"",
381		"",
382		"",
383		"",
384		"",
385		"",
386		"",
387		"", /* 10 */
388		"",
389		"",
390		"",
391		"",
392		"",
393		"",
394		"",
395		"REL4", /* SODIMM 66 */
396		"",
397		"", /* 20 */
398		"",
399		"",
400		"",
401		"",
402		"",
403		"",
404		"",
405		"",
406		"",
407		"", /* 30 */
408		"",
409		"",
410		"",
411		"",
412		"",
413		"",
414		"",
415		"",
416		"",
417		"", /* 40 */
418		"",
419		"",
420		"",
421		"",
422		"",
423		"",
424		"",
425		"",
426		"",
427		"", /* 50 */
428		"",
429		"",
430		"",
431		"",
432		"",
433		"",
434		"",
435		"",
436		"",
437		"", /* 60 */
438		"",
439		"",
440		"",
441		"",
442		"",
443		"",
444		"",
445		"",
446		"",
447		"", /* 70 */
448		"",
449		"",
450		"",
451		"",
452		"",
453		"",
454		"",
455		"",
456		"",
457		"", /* 80 */
458		"",
459		"",
460		"",
461		"",
462		"",
463		"",
464		"";
465};
466
467/* Verdin I2C_1 */
468&main_i2c1 {
469	status = "okay";
470
471	temperature-sensor@4f {
472		compatible = "ti,tmp1075";
473		reg = <0x4f>;
474	};
475
476	eeprom@57 {
477		compatible = "st,24c02", "atmel,24c02";
478		reg = <0x57>;
479		pagesize = <16>;
480	};
481};
482
483/* Verdin I2C_4 CSI */
484&main_i2c3 {
485	status = "okay";
486
487	ivy_adc1: adc@40 {
488		compatible = "ti,ads1119";
489		reg = <0x40>;
490		pinctrl-names = "default";
491		pinctrl-0 = <&pinctrl_gpio_7>;
492		interrupt-parent = <&main_gpio0>;
493		interrupts = <41 IRQ_TYPE_EDGE_FALLING>;
494		avdd-supply = <&reg_3v2_ain1>;
495		dvdd-supply = <&reg_3v2_ain1>;
496		vref-supply = <&reg_3v2_ain1>;
497		#address-cells = <1>;
498		#io-channel-cells = <1>;
499		#size-cells = <0>;
500
501		/* AIN1 0-33V Voltage Input */
502		channel@0 {
503			reg = <0>;
504			diff-channels = <0 1>;
505		};
506
507		/* AIN1 0-20mA Current Input */
508		channel@1 {
509			reg = <1>;
510			diff-channels = <2 3>;
511		};
512	};
513
514	ivy_adc2: adc@41 {
515		compatible = "ti,ads1119";
516		reg = <0x41>;
517		pinctrl-names = "default";
518		pinctrl-0 = <&pinctrl_gpio_8>;
519		interrupt-parent = <&main_gpio0>;
520		interrupts = <42 IRQ_TYPE_EDGE_FALLING>;
521		avdd-supply = <&reg_3v2_ain2>;
522		dvdd-supply = <&reg_3v2_ain2>;
523		vref-supply = <&reg_3v2_ain2>;
524		#address-cells = <1>;
525		#io-channel-cells = <1>;
526		#size-cells = <0>;
527
528		/* AIN2 0-33V Voltage Input */
529		channel@0 {
530			reg = <0>;
531			diff-channels = <0 1>;
532		};
533
534		/* AIN2 0-20mA Current Input */
535		channel@1 {
536			reg = <1>;
537			diff-channels = <2 3>;
538		};
539	};
540};
541
542/* Verdin CAN_1 */
543&main_mcan0 {
544	status = "okay";
545};
546
547/* Verdin SPI_1 */
548&main_spi1 {
549	pinctrl-0 = <&pinctrl_spi1>,
550		    <&pinctrl_spi1_cs0>,
551		    <&pinctrl_gpio_1>,
552		    <&pinctrl_gpio_4>;
553	cs-gpios = <0>,
554		   <&mcu_gpio0 1 GPIO_ACTIVE_LOW>,
555		   <&mcu_gpio0 4 GPIO_ACTIVE_LOW>;
556	status = "okay";
557
558	tpm@1 {
559		compatible = "infineon,slb9670", "tcg,tpm_tis-spi";
560		reg = <1>;
561		spi-max-frequency = <18500000>;
562	};
563
564	fram@2 {
565		compatible = "fujitsu,mb85rs256", "atmel,at25";
566		reg = <2>;
567		address-width = <16>;
568		size = <32768>;
569		spi-max-frequency = <33000000>;
570		pagesize = <1>;
571	};
572};
573
574/* Verdin UART_3 */
575&main_uart0 {
576	status = "okay";
577};
578
579/* Verdin UART_1 */
580&main_uart1 {
581	status = "okay";
582};
583
584&mcu_gpio0 {
585	pinctrl-names = "default";
586	pinctrl-0 = <&pinctrl_gpio_2>,
587		    <&pinctrl_gpio_3>,
588		    <&pinctrl_pcie_1_reset>;
589	gpio-line-names =
590		"",
591		"",
592		"GPIO2", /* Verdin GPIO_2 - SODIMM 208 */
593		"GPIO3", /* Verdin GPIO_3 - SODIMM 210 */
594		"",
595		"",
596		"",
597		"",
598		"",
599		"",
600		"",
601		"",
602		"",
603		"",
604		"",
605		"",
606		"",
607		"",
608		"",
609		"",
610		"",
611		"",
612		"",
613		"";
614};
615
616/* Verdin CAN_2 */
617&mcu_mcan0 {
618	status = "okay";
619};
620
621/* Verdin SD_1 */
622&sdhci1 {
623	status = "okay";
624};
625
626/* Verdin USB_1*/
627&usbss0 {
628	status = "okay";
629};
630
631&usb0 {
632	status = "okay";
633};
634
635/* Verdin USB_2 */
636&usbss1 {
637	status = "okay";
638};
639
640&usb1 {
641	status = "okay";
642};
643
644/* Verdin PCIE_1_RESET# */
645&verdin_pcie_1_reset_hog {
646	status = "okay";
647};
648
649/* Verdin UART_2 */
650&wkup_uart0 {
651	linux,rs485-enabled-at-boot-time;
652	rs485-rts-active-low;
653	rs485-rx-during-tx;
654	status = "okay";
655};
656