1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com/
4 * Copyright (c) 2022-2023 TQ-Systems GmbH <linux@ew.tq-group.com>, D-82229 Seefeld, Germany.
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/net/ti-dp83867.h>
12#include <dt-bindings/phy/phy.h>
13#include <dt-bindings/pwm/pwm.h>
14#include "k3-serdes.h"
15
16#include "k3-am642-tqma64xxl.dtsi"
17
18/ {
19	compatible = "tq,am642-tqma6442l-mbax4xxl", "tq,am642-tqma6442l",
20		     "ti,am642";
21	model = "TQ-Systems TQMa64xxL SoM on MBax4xxL carrier board";
22
23	aliases {
24		ethernet0 = &cpsw_port1;
25		i2c1 = &mcu_i2c0;
26		mmc1 = &sdhci1;
27		serial0 = &mcu_uart0;
28		serial1 = &mcu_uart1;
29		serial2 = &main_uart0;
30		serial3 = &main_uart1;
31		serial4 = &main_uart2;
32		serial5 = &main_uart4;
33		serial6 = &main_uart5;
34		serial7 = &main_uart3;
35		spi1 = &main_spi0;
36		spi2 = &mcu_spi0;
37	};
38
39	chosen {
40		stdout-path = &main_uart0;
41	};
42
43	gpio-keys {
44		compatible = "gpio-keys";
45		pinctrl-names = "default";
46		pinctrl-0 = <&mcu_gpio_keys_pins>;
47
48		user-button {
49			label = "USER_BUTTON";
50			linux,code = <BTN_0>;
51			gpios = <&mcu_gpio0 5 GPIO_ACTIVE_LOW>;
52		};
53	};
54
55	gpio-leds {
56		compatible = "gpio-leds";
57		pinctrl-names = "default";
58		pinctrl-0 = <&mcu_gpio_leds_pins>;
59
60		led-0 {
61			label = "led0";
62			gpios = <&mcu_gpio0 8 GPIO_ACTIVE_HIGH>;
63		};
64		led-1 {
65			label = "led1";
66			gpios = <&mcu_gpio0 9 GPIO_ACTIVE_HIGH>;
67		};
68	};
69
70	fan0: pwm-fan {
71		compatible = "pwm-fan";
72		pinctrl-names = "default";
73		pinctrl-0 = <&pwm_fan_pins>;
74		fan-supply = <&reg_pwm_fan>;
75		#cooling-cells = <2>;
76		/* typical 25 kHz -> 40.000 nsec */
77		pwms = <&epwm5 0 40000 PWM_POLARITY_INVERTED>;
78		cooling-levels = <0 32 64 128 196 240>;
79		pulses-per-revolution = <2>;
80		interrupt-parent = <&main_gpio1>;
81		interrupts = <49 IRQ_TYPE_EDGE_FALLING>;
82		status = "disabled";
83	};
84
85	wifi_pwrseq: pwrseq-wifi {
86		compatible = "mmc-pwrseq-simple";
87		pinctrl-names = "default";
88		pinctrl-0 = <&main_mmc1_wifi_pwrseq_pins>;
89		reset-gpios = <&main_gpio0 23 GPIO_ACTIVE_LOW>;
90	};
91
92	reg_pwm_fan: regulator-pwm-fan {
93		compatible = "regulator-fixed";
94		pinctrl-names = "default";
95		pinctrl-0 = <&pwm_fan_reg_pins>;
96		regulator-name = "FAN_PWR";
97		regulator-min-microvolt = <12000000>;
98		regulator-max-microvolt = <12000000>;
99		gpio = <&main_gpio1 48 GPIO_ACTIVE_HIGH>;
100		enable-active-high;
101	};
102
103	reg_sd: regulator-sd {
104		compatible = "regulator-fixed";
105		pinctrl-names = "default";
106		pinctrl-0 = <&main_mmc1_reg_pins>;
107		regulator-name = "V_3V3_SD";
108		regulator-min-microvolt = <3300000>;
109		regulator-max-microvolt = <3300000>;
110		gpio = <&main_gpio1 43 GPIO_ACTIVE_HIGH>;
111		enable-active-high;
112	};
113};
114
115&cpsw3g {
116	pinctrl-names = "default";
117	pinctrl-0 = <&cpsw_pins>;
118};
119
120&cpsw_port1 {
121	phy-mode = "rgmii-rxid";
122	phy-handle = <&cpsw3g_phy0>;
123};
124
125&cpsw_port2 {
126	status = "disabled";
127};
128
129&cpsw3g_mdio {
130	pinctrl-names = "default";
131	pinctrl-0 = <&cpsw_mdio_pins>;
132	status = "okay";
133
134	cpsw3g_phy0: ethernet-phy@0 {
135		compatible = "ethernet-phy-ieee802.3-c22";
136		reg = <0>;
137		reset-gpios = <&main_gpio0 44 GPIO_ACTIVE_LOW>;
138		reset-assert-us = <1000>;
139		reset-deassert-us = <1000>;
140		ti,rx-fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
141		ti,tx-fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
142		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
143		ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
144	};
145};
146
147&epwm5 {
148	pinctrl-names = "default";
149	pinctrl-0 = <&epwm5_pins>;
150	status = "okay";
151};
152
153&main_gpio0 {
154	pinctrl-names = "default";
155	pinctrl-0 = <&main_gpio0_digital_pins>,
156		    <&main_gpio0_hog_pins>;
157	gpio-line-names =
158		"", "", "", "", /* 0-3 */
159		"", "", "", "", /* 4-7 */
160		"", "", "", "", /* 8-11 */
161		"", "", "", "", /* 12-15 */
162		"", "", "", "", /* 16-19 */
163		"", "", "", "", /* 20-23 */
164		"", "", "EN_DIG_OUT_1", "STATUS_OUT_1", /* 24-27 */
165		"EN_DIG_OUT_2", "STATUS_OUT_2", "EN_SIG_OUT_3", "", /* 28-31 */
166		"", "", "STATUS_OUT_3", "EN_DIG_OUT_4", /* 32-35 */
167		"", "", "STATUS_OUT_4", "DIG_IN_1", /* 36-39 */
168		"DIG_IN_2", "DIG_IN_3", "DIG_IN_4"; /* 40- */
169};
170
171&main_gpio1 {
172	pinctrl-names = "default";
173	pinctrl-0 = <&main_gpio1_hog_pins>;
174	gpio-line-names =
175		"", "", "", "", /* 0-3 */
176		"", "", "", "", /* 4-7 */
177		"", "", "", "", /* 8-11 */
178		"", "", "", "", /* 12-15 */
179		"", "", "", "", /* 16-19 */
180		"", "", "", "", /* 20-23 */
181		"", "", "", "", /* 24-27 */
182		"", "", "", "", /* 28-31 */
183		"", "", "", "", /* 32-35 */
184		"", "", "", "", /* 36-39 */
185		"", "", "", "", /* 40-43 */
186		"", "", "", "", /* 44-47 */
187		"", "", "", "", /* 48-51 */
188		"", "", "", "ADC_SYNC", /* 52-55 */
189		"", "", "ADC_RST#", "ADC_DATA_RDY", /* 56-59 */
190		"", "", "", "", /* 60-63 */
191		"", "", "", "ADC_INT#", /* 64-67 */
192		"BG95_PWRKEY", "BG95_RESET"; /* 68- */
193
194	line50-hog {
195		/* See also usb0 */
196		gpio-hog;
197		gpios = <50 0>;
198		line-name = "USB0_VBUS_OC#";
199		input;
200	};
201
202	line54-hog {
203		gpio-hog;
204		gpios = <54 0>;
205		line-name = "PRG0_MDIO_SWITCH";
206		output-low;
207	};
208
209	line70-hog {
210		gpio-hog;
211		gpios = <70 0>;
212		line-name = "PHY_INT#";
213		input;
214	};
215};
216
217&main_mcan0 {
218	pinctrl-names = "default";
219	pinctrl-0 = <&main_mcan0_pins>;
220	status = "okay";
221};
222
223&main_mcan1 {
224	pinctrl-names = "default";
225	pinctrl-0 = <&main_mcan1_pins>;
226	status = "okay";
227};
228
229&main_spi0 {
230	pinctrl-names = "default";
231	pinctrl-0 = <&main_spi0_pins>;
232	ti,pindir-d0-out-d1-in;
233	status = "okay";
234
235	/* adc@0: NXP NAFE13388 */
236};
237
238/* UART/USB adapter port 1 */
239&main_uart0 {
240	pinctrl-names = "default";
241	pinctrl-0 = <&main_uart0_pins>;
242	status = "okay";
243};
244
245/*
246 * IOT Module - GNSS UART
247 *
248 * Note: We expect usage of a SYSFW that does not reserve UART1 for debug traces
249 */
250&main_uart1 {
251	pinctrl-names = "default";
252	pinctrl-0 = <&main_uart1_pins>;
253	status = "okay";
254};
255
256/* RS485 port */
257&main_uart2 {
258	pinctrl-names = "default";
259	pinctrl-0 = <&main_uart2_pins>;
260	linux,rs485-enabled-at-boot-time;
261	rs485-rts-active-low;
262	status = "okay";
263};
264
265/* Bluetooth module */
266&main_uart3 {
267	pinctrl-names = "default";
268	pinctrl-0 = <&main_uart3_pins>;
269	/*
270	 * Left disabled for now, until a way to deal with drivers and firmware
271	 * for the combined WLAN/BT module has been figured out
272	 */
273};
274
275/* IOT module - Main UART */
276&main_uart4 {
277	pinctrl-names = "default";
278	pinctrl-0 = <&main_uart4_pins>;
279	status = "okay";
280};
281
282/* IOT module - DBG UART */
283&main_uart5 {
284	pinctrl-names = "default";
285	pinctrl-0 = <&main_uart5_pins>;
286	status = "okay";
287};
288
289&main0_thermal {
290	trips {
291		main0_active0: trip-active0 {
292			temperature = <40000>;
293			hysteresis = <5000>;
294			type = "active";
295		};
296
297		main0_active1: trip-active1 {
298			temperature = <48000>;
299			hysteresis = <3000>;
300			type = "active";
301		};
302
303		main0_active2: trip-active2 {
304			temperature = <60000>;
305			hysteresis = <10000>;
306			type = "active";
307		};
308	};
309
310	cooling-maps {
311		map1 {
312			trip = <&main0_active0>;
313			cooling-device = <&fan0 1 1>;
314		};
315
316		map2 {
317			trip = <&main0_active1>;
318			cooling-device = <&fan0 2 2>;
319		};
320
321		map3 {
322			trip = <&main0_active2>;
323			cooling-device = <&fan0 3 3>;
324		};
325	};
326};
327
328&main1_thermal {
329	trips {
330		main1_active0: trip-active0 {
331			temperature = <40000>;
332			hysteresis = <5000>;
333			type = "active";
334		};
335
336		main1_active1: trip-active1 {
337			temperature = <48000>;
338			hysteresis = <3000>;
339			type = "active";
340		};
341
342		main1_active2: trip-active2 {
343			temperature = <60000>;
344			hysteresis = <10000>;
345			type = "active";
346		};
347	};
348
349	cooling-maps {
350		map1 {
351			trip = <&main1_active0>;
352			cooling-device = <&fan0 1 1>;
353		};
354
355		map2 {
356			trip = <&main1_active1>;
357			cooling-device = <&fan0 2 2>;
358		};
359
360		map3 {
361			trip = <&main1_active2>;
362			cooling-device = <&fan0 3 3>;
363		};
364	};
365};
366
367&mcu_gpio0 {
368	pinctrl-names = "default";
369	pinctrl-0 = <&mcu_gpio0_pins>;
370};
371
372&mcu_i2c0 {
373	pinctrl-names = "default";
374	pinctrl-0 = <&mcu_i2c0_pins>;
375	/* Left disabled: not functional without external pullup */
376};
377
378&mcu_spi0 {
379	pinctrl-names = "default";
380	pinctrl-0 = <&mcu_spi0_pins>;
381	ti,pindir-d0-out-d1-in;
382	status = "okay";
383};
384
385/* UART/USB adapter port 2 */
386&mcu_uart0 {
387	pinctrl-names = "default";
388	pinctrl-0 = <&mcu_uart0_pins>;
389	status = "okay";
390};
391
392/* Pin header */
393&mcu_uart1 {
394	pinctrl-names = "default";
395	pinctrl-0 = <&mcu_uart1_pins>;
396	status = "okay";
397};
398
399&serdes_ln_ctrl {
400	idle-states = <AM64_SERDES0_LANE0_USB>;
401};
402
403&serdes0 {
404	serdes0_usb_link: phy@0 {
405		reg = <0>;
406		#phy-cells = <0>;
407		resets = <&serdes_wiz0 1>;
408		cdns,num-lanes = <1>;
409		cdns,phy-type = <PHY_TYPE_USB3>;
410	};
411};
412
413&sdhci1 {
414	pinctrl-names = "default";
415	pinctrl-0 = <&main_mmc1_pins>;
416	bus-width = <4>;
417	cd-gpios = <&main_gpio1 77 GPIO_ACTIVE_LOW>;
418	disable-wp;
419	no-mmc;
420	ti,driver-strength-ohm = <50>;
421	ti,fails-without-test-cd;
422	/* Enabled by overlay */
423};
424
425&tscadc0 {
426	status = "okay";
427	adc {
428		ti,adc-channels = <0 1 2 3 4 5 6 7>;
429	};
430};
431
432&usb0 {
433	/*
434	 * The CDNS USB driver currently doesn't support overcurrent GPIOs,
435	 * so there is no overcurrent detection. The OC pin is configured
436	 * as a GPIO hog instead.
437	 */
438	pinctrl-names = "default";
439	pinctrl-0 = <&main_usb0_pins>;
440	dr_mode = "otg";
441	maximum-speed = "super-speed";
442	phys = <&serdes0_usb_link>;
443	phy-names = "cdns3,usb3-phy";
444};
445
446&usbss0 {
447	ti,vbus-divider;
448};
449
450&main_pmx0 {
451	cpsw_pins: cpsw-pins {
452		pinctrl-single,pins = <
453			/* (W5) PRG0_PRU1_GPO7.RGMII1_RD0 */
454			AM64X_IOPAD(0x01cc, PIN_INPUT, 4)
455			/* (Y5) PRG0_PRU1_GPO9.RGMII1_RD1 */
456			AM64X_IOPAD(0x01d4, PIN_INPUT, 4)
457			/* (V6) PRG0_PRU1_GPO10.RGMII1_RD2 */
458			AM64X_IOPAD(0x01d8, PIN_INPUT, 4)
459			/* (V5) PRG0_PRU1_GPO17.RGMII1_RD3 */
460			AM64X_IOPAD(0x01f4, PIN_INPUT, 4)
461			/* (AA5) PRG0_PRU0_GPO10.RGMII1_RXC */
462			AM64X_IOPAD(0x0188, PIN_INPUT, 4)
463			/* (W6) PRG0_PRU0_GPO9.RGMII1_RX_CTL */
464			AM64X_IOPAD(0x0184, PIN_INPUT, 4)
465			/* (V15) PRG1_PRU1_GPO7.RGMII1_TD0 */
466			AM64X_IOPAD(0x0124, PIN_OUTPUT, 4)
467			/* (V14) PRG1_PRU1_GPO9.RGMII1_TD1 */
468			AM64X_IOPAD(0x012c, PIN_OUTPUT, 4)
469			/* (W14) PRG1_PRU1_GPO10.RGMII1_TD2 */
470			AM64X_IOPAD(0x0130, PIN_OUTPUT, 4)
471			/* (AA14) PRG1_PRU1_GPO17.RGMII1_TD3 */
472			AM64X_IOPAD(0x014c, PIN_OUTPUT, 4)
473			/* (U14) PRG1_PRU0_GPO10.RGMII1_TXC */
474			AM64X_IOPAD(0x00e0, PIN_OUTPUT, 4)
475			/* (U15) PRG1_PRU0_GPO9.RGMII1_TX_CTL */
476			AM64X_IOPAD(0x00dc, PIN_OUTPUT, 4)
477		>;
478	};
479
480	cpsw_mdio_pins: cpsw-mdio-pins {
481		pinctrl-single,pins = <
482			/* (R21) GPMC0_CSn3.GPIO0_44 - RESET_RGMII1# */
483			AM64X_IOPAD(0x00b4, PIN_OUTPUT, 7)
484
485			/* (R2) PRG0_PRU1_GPO19.MDIO0_MDC */
486			AM64X_IOPAD(0x01fc, PIN_OUTPUT, 4)
487			/* (P5) PRG0_PRU1_GPO18.MDIO0_MDIO */
488			AM64X_IOPAD(0x01f8, PIN_INPUT, 4)
489		>;
490	};
491
492	epwm5_pins: epwm5-pins {
493		pinctrl-single,pins = <
494			/* (W19) GPMC0_WAIT0.EHRPWM5_B */
495			AM64X_IOPAD(0x0098, PIN_OUTPUT, 3)
496		>;
497	};
498
499	/* Digital IOs */
500	main_gpio0_digital_pins: main-gpio0-digital-pins {
501		pinctrl-single,pins = <
502			/* (W20) GPMC0_AD11.GPIO0_26 - EN_DIG_OUT_1 */
503			AM64X_IOPAD(0x0068, PIN_OUTPUT, 7)
504			/* (W21) GPMC0_AD12.GPIO0_27 - STATUS_OUT_1 */
505			AM64X_IOPAD(0x006c, PIN_INPUT, 7)
506			/* (V18) GPMC0_AD13.GPIO0_28 - EN_DIG_OUT_2 */
507			AM64X_IOPAD(0x0070, PIN_OUTPUT, 7)
508			/* (Y21) GPMC0_AD14.GPIO0_29 - STATUS_OUT_2 */
509			AM64X_IOPAD(0x0074, PIN_INPUT, 7)
510			/* (Y20) GPMC0_AD15.GPIO0_30 - EN_DIG_OUT_3 */
511			AM64X_IOPAD(0x0078, PIN_OUTPUT, 7)
512			/* (T21) GPMC0_WEn.GPIO0_34 - STATUS_OUT_3 */
513			AM64X_IOPAD(0x008c, PIN_INPUT, 7)
514			/* (P17) GPMC0_BE0n_CLE.GPIO0_35 - EN_DIG_OUT_4 */
515			AM64X_IOPAD(0x0090, PIN_OUTPUT, 7)
516			/* (Y18) GPMC0_WAIT1.GPIO0_38 - STATUS_OUT_4 */
517			AM64X_IOPAD(0x009c, PIN_INPUT, 7)
518			/* (N16) GPMC0_WPn.GPIO0_39 - DIG_IN_1 */
519			AM64X_IOPAD(0x00a0, PIN_INPUT, 7)
520			/* (N17) GPMC0_DIR.GPIO0_40 - DIG_IN_2 */
521			AM64X_IOPAD(0x00a4, PIN_INPUT, 7)
522			/* (R19) GPMC0_CSn0.GPIO0_41 - DIG_IN_3 */
523			AM64X_IOPAD(0x00a8, PIN_INPUT, 7)
524			/* (R20) GPMC0_CSn1.GPIO0_42 - DIG_IN_4 */
525			AM64X_IOPAD(0x00ac, PIN_INPUT, 7)
526		>;
527	};
528
529	main_gpio0_hog_pins: main-gpio0-hog-pins {
530		pinctrl-single,pins = <
531			/* (P19) GPMC0_CSn2.GPIO0_43 - MMC1_CTRL */
532			AM64X_IOPAD(0x00b0, PIN_OUTPUT, 7)
533		>;
534	};
535
536	main_gpio1_hog_pins: main-gpio1-hog-pins {
537		pinctrl-single,pins = <
538			/* (B15) SPI1_D0.GPIO1_50 - USB0_VBUS_OC# */
539			AM64X_IOPAD(0x0228, PIN_INPUT, 7)
540			/* (B16) UART0_CTSn.GPIO1_54 - PRG0_MDIO_SWITCH */
541			AM64X_IOPAD(0x0238, PIN_OUTPUT, 7)
542			/* (C19) EXTINTn.GPIO1_70 - PHY_INT# */
543			AM64X_IOPAD(0x0278, PIN_INPUT, 7)
544		>;
545	};
546
547	main_mcan0_pins: main-mcan0-pins {
548		pinctrl-single,pins = <
549			/* (B17) MCAN0_RX */
550			AM64X_IOPAD(0x0254, PIN_INPUT, 0)
551			/* (A17) MCAN0_TX */
552			AM64X_IOPAD(0x0250, PIN_OUTPUT, 0)
553		>;
554	};
555
556	main_mcan1_pins: main-mcan1-pins {
557		pinctrl-single,pins = <
558			/* (D17) MCAN1_RX */
559			AM64X_IOPAD(0x025c, PIN_INPUT, 0)
560			/* (C17) MCAN1_TX */
561			AM64X_IOPAD(0x0258, PIN_OUTPUT, 0)
562		>;
563	};
564
565	main_mmc1_pins: main-mmc1-pins {
566		pinctrl-single,pins = <
567			/* (J19) MMC1_CMD */
568			AM64X_IOPAD(0x0294, PIN_INPUT, 0)
569			/* (L20) MMC1_CLK */
570			AM64X_IOPAD(0x028c, PIN_INPUT, 0)
571			/* (K21) MMC1_DAT0 */
572			AM64X_IOPAD(0x0288, PIN_INPUT, 0)
573			/* (L21) MMC1_DAT1 */
574			AM64X_IOPAD(0x0284, PIN_INPUT, 0)
575			/* (K19) MMC1_DAT2 */
576			AM64X_IOPAD(0x0280, PIN_INPUT, 0)
577			/* (K18) MMC1_DAT3 */
578			AM64X_IOPAD(0x027c, PIN_INPUT, 0)
579			/* (D19) MMC1_SDCD.GPIO1_77 */
580			AM64X_IOPAD(0x0298, PIN_INPUT, 7)
581			/* (#N/A) MMC1_CLKLB */
582			AM64X_IOPAD(0x0290, PIN_INPUT, 0)
583		>;
584	};
585
586	main_mmc1_reg_pins: main-mmc1-reg-pins {
587		pinctrl-single,pins = <
588			/* (C13) SPI0_CS1.GPIO1_43 - MMC1_SD_EN */
589			AM64X_IOPAD(0x020c, PIN_OUTPUT, 7)
590		>;
591	};
592
593	main_mmc1_wifi_pwrseq_pins: main-mmc1-wifi-pwrseq-pins {
594		pinctrl-single,pins = <
595			/* (V19) GPMC0_AD8.GPIO0_23 - WIFI-BT_EN */
596			AM64X_IOPAD(0x005c, PIN_OUTPUT, 7)
597		>;
598	};
599
600	main_spi0_pins: main-spi0-pins {
601		pinctrl-single,pins = <
602			/* (D13) SPI0_CLK */
603			AM64X_IOPAD(0x0210, PIN_OUTPUT, 0)
604			/* (D12) SPI0_CS0 */
605			AM64X_IOPAD(0x0208, PIN_OUTPUT, 0)
606			/* (A13) SPI0_D0 */
607			AM64X_IOPAD(0x0214, PIN_OUTPUT, 0)
608			/* (A14) SPI0_D1 */
609			AM64X_IOPAD(0x0218, PIN_INPUT, 0)
610		>;
611	};
612
613	main_spi0_adc_pins: main-spi0-adc-pins {
614		pinctrl-single,pins = <
615			/* (A16) UART0_RTSn.GPIO1_55 - ADC_SYNC */
616			AM64X_IOPAD(0x023c, PIN_INPUT, 7)
617			/* (D16) UART1_CTSn.GPIO1_58 - ADC_RST# */
618			AM64X_IOPAD(0x0248, PIN_OUTPUT, 7)
619			/* (E16) UART1_RTSn.GPIO1_59 - ADC_DATA_RDY */
620			AM64X_IOPAD(0x024c, PIN_INPUT, 7)
621			/* (B19) I2C1_SDA.GPIO1_67 - ADC_INT# */
622			AM64X_IOPAD(0x026c, PIN_INPUT, 7)
623		>;
624	};
625
626	main_uart0_pins: main-uart0-pins {
627		pinctrl-single,pins = <
628			/* (D15) UART0_RXD */
629			AM64X_IOPAD(0x0230, PIN_INPUT, 0)
630			/* (C16) UART0_TXD */
631			AM64X_IOPAD(0x0234, PIN_OUTPUT, 0)
632		>;
633	};
634
635	main_uart1_pins: main-uart1-pins {
636		pinctrl-single,pins = <
637			/* (E15) UART1_RXD */
638			AM64X_IOPAD(0x0240, PIN_INPUT, 0)
639			/* (E14) UART1_TXD */
640			AM64X_IOPAD(0x0244, PIN_OUTPUT, 0)
641		>;
642	};
643
644	main_uart2_pins: main-uart2-pins {
645		pinctrl-single,pins = <
646			/* (T18) GPMC0_AD2.UART2_RTSn */
647			AM64X_IOPAD(0x0044, PIN_OUTPUT, 2)
648			/* (T20) GPMC0_AD0.UART2_RXD */
649			AM64X_IOPAD(0x003c, PIN_INPUT, 2)
650			/* (U21) GPMC0_AD1.UART2_TXD */
651			AM64X_IOPAD(0x0040, PIN_OUTPUT, 2)
652		>;
653	};
654
655	main_uart3_pins: main-uart3-pins {
656		pinctrl-single,pins = <
657			/* (T17) GPMC0_AD9.UART3_CTSn */
658			AM64X_IOPAD(0x0060, PIN_INPUT, 2)
659			/* (U19) GPMC0_AD5.UART3_RTSn */
660			AM64X_IOPAD(0x0050, PIN_OUTPUT, 2)
661			/* (U20) GPMC0_AD3.UART3_RXD */
662			AM64X_IOPAD(0x0048, PIN_INPUT, 2)
663			/* (U18) GPMC0_AD4.UART3_TXD */
664			AM64X_IOPAD(0x004c, PIN_OUTPUT, 2)
665		>;
666	};
667
668	main_uart4_pins: main-uart4-pins {
669		pinctrl-single,pins = <
670			/* (R16) GPMC0_AD10.UART4_CTSn */
671			AM64X_IOPAD(0x0064, PIN_INPUT, 2)
672			/* (R17) GPMC0_CLK.UART4_RTSn */
673			AM64X_IOPAD(0x007c, PIN_OUTPUT, 2)
674			/* (V20) GPMC0_AD6.UART4_RXD */
675			AM64X_IOPAD(0x0054, PIN_INPUT, 2)
676			/* (V21) GPMC0_AD7.UART4_TXD */
677			AM64X_IOPAD(0x0058, PIN_OUTPUT, 2)
678
679			/* Control GPIOs for IOT Module connected to UART4 */
680			/* (D18) ECAP0_IN_APWM_OUT.GPIO1_68 - BG95_PWRKEY */
681			AM64X_IOPAD(0x0270, PIN_OUTPUT, 7)
682			/* (A19) EXT_REFCLK1.GPIO1_69 - BG95_RESET */
683			AM64X_IOPAD(0x0274, PIN_OUTPUT, 7)
684		>;
685	};
686
687	main_uart5_pins: main-uart5-pins {
688		pinctrl-single,pins = <
689			/* (P16) GPMC0_ADVn_ALE.UART5_RXD */
690			AM64X_IOPAD(0x0084, PIN_INPUT, 2)
691			/* (R18) GPMC0_OEn_REn.UART5_TXD */
692			AM64X_IOPAD(0x0088, PIN_OUTPUT, 2)
693		>;
694	};
695
696	main_usb0_pins: main-usb0-pins {
697		pinctrl-single,pins = <
698			/* (E19) USB0_DRVVBUS */
699			AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0)
700		>;
701	};
702
703	pru_icssg1_mdio_pins: pru-icssg1-mdio-pins {
704		pinctrl-single,pins = <
705			/* (A15) SPI1_D1.GPIO1_51 - RESET_PRG1_RGMII1# */
706			AM64X_IOPAD(0x022c, PIN_OUTPUT, 7)
707			/* (B14) SPI1_CS0.GPIO1_47 - RESET_PRG1_RGMII2# */
708			AM64X_IOPAD(0x021c, PIN_OUTPUT, 7)
709
710			/* (Y6) PRG1_MDIO0_MDC */
711			AM64X_IOPAD(0x015c, PIN_OUTPUT, 0)
712			/* (AA6) PRG1_MDIO0_MDIO */
713			AM64X_IOPAD(0x0158, PIN_INPUT, 0)
714		>;
715	};
716
717	pru_icssg1_rgmii1_pins: pru-icssg1-rgmii1-pins {
718		pinctrl-single,pins = <
719			/* (Y7) PRG1_PRU0_GPO0.PRG1_RGMII1_RD0 */
720			AM64X_IOPAD(0x00b8, PIN_INPUT, 2)
721			/* (U8) PRG1_PRU0_GPO1.PRG1_RGMII1_RD1 */
722			AM64X_IOPAD(0x00bc, PIN_INPUT, 2)
723			/* (W8) PRG1_PRU0_GPO2.PRG1_RGMII1_RD2 */
724			AM64X_IOPAD(0x00c0, PIN_INPUT, 2)
725			/* (V8) PRG1_PRU0_GPO3.PRG1_RGMII1_RD3 */
726			AM64X_IOPAD(0x00c4, PIN_INPUT, 2)
727			/* (AA7) PRG1_PRU0_GPO6.PRG1_RGMII1_RXC */
728			AM64X_IOPAD(0x00d0, PIN_INPUT, 2)
729			/* (Y8) PRG1_PRU0_GPO4.PRG1_RGMII1_RX_CTL */
730			AM64X_IOPAD(0x00c8, PIN_INPUT, 2)
731			/* (AA8) PRG1_PRU0_GPO11.PRG1_RGMII1_TD0 */
732			AM64X_IOPAD(0x00e4, PIN_OUTPUT, 2)
733			/* (U9) PRG1_PRU0_GPO12.PRG1_RGMII1_TD1 */
734			AM64X_IOPAD(0x00e8, PIN_OUTPUT, 2)
735			/* (W9) PRG1_PRU0_GPO13.PRG1_RGMII1_TD2 */
736			AM64X_IOPAD(0x00ec, PIN_OUTPUT, 2)
737			/* (AA9) PRG1_PRU0_GPO14.PRG1_RGMII1_TD3 */
738			AM64X_IOPAD(0x00f0, PIN_OUTPUT, 2)
739			/* (V9) PRG1_PRU0_GPO16.PRG1_RGMII1_TXC */
740			AM64X_IOPAD(0x00f8, PIN_OUTPUT, 2)
741			/* (Y9) PRG1_PRU0_GPO15.PRG1_RGMII1_TX_CTL */
742			AM64X_IOPAD(0x00f4, PIN_OUTPUT, 2)
743		>;
744	};
745
746	pru_icssg1_rgmii2_pins: pru-icssg1-rgmii2-pins {
747		pinctrl-single,pins = <
748			/* (W11) PRG1_PRU1_GPO0.PRG1_RGMII2_RD0 */
749			AM64X_IOPAD(0x0108, PIN_INPUT, 2)
750			/* (V11) PRG1_PRU1_GPO1.PRG1_RGMII2_RD1 */
751			AM64X_IOPAD(0x010c, PIN_INPUT, 2)
752			/* (AA12) PRG1_PRU1_GPO2.PRG1_RGMII2_RD2 */
753			AM64X_IOPAD(0x0110, PIN_INPUT, 2)
754			/* (Y12) PRG1_PRU1_GPO3.PRG1_RGMII2_RD3 */
755			AM64X_IOPAD(0x0114, PIN_INPUT, 2)
756			/* (U11) PRG1_PRU1_GPO6.PRG1_RGMII2_RXC */
757			AM64X_IOPAD(0x0120, PIN_INPUT, 2)
758			/* (W12) PRG1_PRU1_GPO4.PRG1_RGMII2_RX_CTL */
759			AM64X_IOPAD(0x0118, PIN_INPUT, 2)
760			/* (AA10) PRG1_PRU1_GPO11.PRG1_RGMII2_TD0 */
761			AM64X_IOPAD(0x0134, PIN_OUTPUT, 2)
762			/* (V10) PRG1_PRU1_GPO12.PRG1_RGMII2_TD1 */
763			AM64X_IOPAD(0x0138, PIN_OUTPUT, 2)
764			/* (U10) PRG1_PRU1_GPO13.PRG1_RGMII2_TD2 */
765			AM64X_IOPAD(0x013c, PIN_OUTPUT, 2)
766			/* (AA11) PRG1_PRU1_GPO14.PRG1_RGMII2_TD3 */
767			AM64X_IOPAD(0x0140, PIN_OUTPUT, 2)
768			/* (Y10) PRG1_PRU1_GPO16.PRG1_RGMII2_TXC */
769			AM64X_IOPAD(0x0148, PIN_OUTPUT, 2)
770			/* (Y11) PRG1_PRU1_GPO15.PRG1_RGMII2_TX_CTL */
771			AM64X_IOPAD(0x0144, PIN_OUTPUT, 2)
772		>;
773	};
774
775	pwm_fan_pins: pwm-fan-pins {
776		pinctrl-single,pins = <
777			/* (T19) GPMC0_BE1n.EHRPWM5_A */
778			AM64X_IOPAD(0x0094, PIN_OUTPUT, 3)
779			/* (C14) SPI1_CLK.GPIO1_49 - FAN_RPM */
780			AM64X_IOPAD(0x0224, PIN_INPUT, 7)
781		>;
782	};
783
784	pwm_fan_reg_pins: pwm-fan-reg-pins {
785		pinctrl-single,pins = <
786			/* (D14) SPI1_CS1.GPIO1_48 - FAN_PWR */
787			AM64X_IOPAD(0x0220, PIN_OUTPUT, 7)
788		>;
789	};
790};
791
792&mcu_pmx0 {
793	mcu_gpio_keys_pins: mcu-gpio-keys-pins {
794		pinctrl-single,pins = <
795			/* (A7) MCU_SPI1_CS0.MCU_GPIO0_5 */
796			AM64X_MCU_IOPAD(0x0014, PIN_INPUT, 7)
797		>;
798	};
799
800	mcu_gpio_leds_pins: mcu-gpio-leds-pins {
801		pinctrl-single,pins = <
802			/* (C7) MCU_SPI1_D0.MCU_GPIO0_8 */
803			AM64X_MCU_IOPAD(0x0020, PIN_OUTPUT, 7)
804			/* (C8) MCU_SPI1_D1.MCU_GPIO0_9 */
805			AM64X_MCU_IOPAD(0x0024, PIN_OUTPUT, 7)
806		>;
807	};
808
809	mcu_gpio0_pins: mcu-gpio0-pins {
810		pinctrl-single,pins = <
811			/* (E8) MCU_UART0_RTSn.MCU_GPIO0_0 */
812			AM64X_MCU_IOPAD(0x0034, PIN_INPUT, 7)
813			/* (D8) MCU_UART0_CTSn.MCU_GPIO0_1 */
814			AM64X_MCU_IOPAD(0x0030, PIN_INPUT, 7)
815			/* (B7) MCU_SPI1_CS1.MCU_GPIO0_6 */
816			AM64X_MCU_IOPAD(0x0018, PIN_INPUT, 7)
817			/* (D7) MCU_SPI1_CLK.MCU_GPIO0_7 */
818			AM64X_MCU_IOPAD(0x001c, PIN_INPUT, 7)
819			/* (A11) MCU_I2C1_SCL.MCU_GPIO0_20 */
820			AM64X_MCU_IOPAD(0x0050, PIN_INPUT, 7)
821			/* (B10) MCU_I2C1_SDA.MCU_GPIO0_21 */
822			AM64X_MCU_IOPAD(0x0054, PIN_INPUT, 7)
823		>;
824	};
825
826	mcu_i2c0_pins: mcu-i2c0-pins {
827		pinctrl-single,pins = <
828			/* (E9) MCU_I2C0_SCL */
829			AM64X_MCU_IOPAD(0x0048, PIN_INPUT, 0)
830			/* (A10) MCU_I2C0_SDA */
831			AM64X_MCU_IOPAD(0x004c, PIN_INPUT, 0)
832		>;
833	};
834
835	mcu_spi0_pins: mcu-spi0-pins {
836		pinctrl-single,pins = <
837			/* (E6) MCU_SPI0_CLK */
838			AM64X_MCU_IOPAD(0x0008, PIN_OUTPUT, 0)
839			/* (D6) MCU_SPI0_CS0 */
840			AM64X_MCU_IOPAD(0x0000, PIN_OUTPUT, 0)
841			/* (C6) MCU_SPI0_CS1 */
842			AM64X_MCU_IOPAD(0x0004, PIN_OUTPUT, 0)
843			/* (E7) MCU_SPI0_D0 */
844			AM64X_MCU_IOPAD(0x000c, PIN_OUTPUT, 0)
845			/* (B6) MCU_SPI0_D1 */
846			AM64X_MCU_IOPAD(0x0010, PIN_INPUT, 0)
847		>;
848	};
849
850	mcu_uart0_pins: mcu-uart0-pins {
851		pinctrl-single,pins = <
852			/* (A9) MCU_UART0_RXD */
853			AM64X_MCU_IOPAD(0x0028, PIN_INPUT, 0)
854			/* (A8) MCU_UART0_TXD */
855			AM64X_MCU_IOPAD(0x002c, PIN_OUTPUT, 0)
856		>;
857	};
858
859	mcu_uart1_pins: mcu-uart1-pins {
860		pinctrl-single,pins = <
861			/* (B8) MCU_UART1_CTSn */
862			AM64X_MCU_IOPAD(0x0040, PIN_INPUT, 0)
863			/* (B9) MCU_UART1_RTSn */
864			AM64X_MCU_IOPAD(0x0044, PIN_OUTPUT, 0)
865			/* (C9) MCU_UART1_RXD */
866			AM64X_MCU_IOPAD(0x0038, PIN_INPUT, 0)
867			/* (D9) MCU_UART1_TXD */
868			AM64X_MCU_IOPAD(0x003c, PIN_OUTPUT, 0)
869		>;
870	};
871};
872