xref: /freebsd/sys/contrib/device-tree/src/arm64/ti/k3-am62-pocketbeagle2.dts (revision ae5de77ed78ae54d86cead5604869212e8008e6b)
1// SPDX-License-Identifier: GPL-2.0-only OR MIT
2/*
3 * https://www.beagleboard.org/boards/pocketbeagle-2
4 *
5 * Copyright (C) 2025 Texas Instruments Incorporated - https://www.ti.com/
6 * Copyright (C) 2025 Robert Nelson, BeagleBoard.org Foundation
7 */
8
9/dts-v1/;
10
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/input/input.h>
14#include "k3-am625.dtsi"
15
16/ {
17	compatible = "beagle,am62-pocketbeagle2", "ti,am625";
18	model = "BeagleBoard.org PocketBeagle2";
19
20	aliases {
21		serial0 = &wkup_uart0;
22		serial1 = &main_uart1;
23		serial2 = &main_uart6;
24		serial3 = &main_uart0;
25		mmc1 = &sdhci1;
26		usb0 = &usb0;
27		usb1 = &usb1;
28		i2c0 = &main_i2c0;
29		i2c2 = &main_i2c2;
30		i2c3 = &wkup_i2c0;
31	};
32
33	chosen {
34		stdout-path = &main_uart6;
35	};
36
37	memory@80000000 {
38		/* 512MB RAM */
39		reg = <0x00000000 0x80000000 0x00000000 0x20000000>;
40		device_type = "memory";
41		bootph-pre-ram;
42	};
43
44	reserved_memory: reserved-memory {
45		#address-cells = <2>;
46		#size-cells = <2>;
47		ranges;
48
49		/* global cma region */
50		linux,cma {
51			compatible = "shared-dma-pool";
52			reusable;
53			size = <0x00 0x8000000>;
54			linux,cma-default;
55		};
56
57		mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
58			compatible = "shared-dma-pool";
59			reg = <0x00 0x9cb00000 0x00 0x100000>;
60			no-map;
61		};
62
63		mcu_m4fss_memory_region: m4f-memory@9cc00000 {
64			compatible = "shared-dma-pool";
65			reg = <0x00 0x9cc00000 0x00 0xe00000>;
66			no-map;
67		};
68
69		secure_tfa_ddr: tfa@9e780000 {
70			reg = <0x00 0x9e780000 0x00 0x80000>;
71			alignment = <0x1000>;
72			no-map;
73		};
74
75		secure_ddr: optee@9e800000 {
76			reg = <0x00 0x9e800000 0x00 0x01800000>;
77			alignment = <0x1000>;
78			no-map;
79		};
80
81		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9db00000 {
82			compatible = "shared-dma-pool";
83			reg = <0x00 0x9db00000 0x00 0xc00000>;
84			no-map;
85		};
86	};
87
88	vsys_5v0: regulator-1 {
89		compatible = "regulator-fixed";
90		regulator-name = "vsys_5v0";
91		regulator-min-microvolt = <5000000>;
92		regulator-max-microvolt = <5000000>;
93		regulator-always-on;
94		regulator-boot-on;
95		bootph-all;
96	};
97
98	vdd_3v3: regulator-2 {
99		compatible = "regulator-fixed";
100		regulator-name = "vdd_3v3";
101		regulator-min-microvolt = <3300000>;
102		regulator-max-microvolt = <3300000>;
103		vin-supply = <&vsys_5v0>;
104		regulator-always-on;
105		regulator-boot-on;
106		bootph-all;
107	};
108
109	vdd_mmc1: regulator-3 {
110		compatible = "regulator-fixed";
111		regulator-name = "vdd_mmc1";
112		pinctrl-names = "default";
113		pinctrl-0 = <&vdd_3v3_sd_pins_default>;
114		regulator-min-microvolt = <3300000>;
115		regulator-max-microvolt = <3300000>;
116		regulator-boot-on;
117		enable-active-high;
118		regulator-always-on;
119		vin-supply = <&vdd_3v3>;
120		gpio = <&main_gpio0 0 GPIO_ACTIVE_HIGH>;
121		bootph-all;
122	};
123
124	vdd_sd_dv: regulator-4 {
125		compatible = "regulator-gpio";
126		regulator-name = "sd_hs200_switch";
127		pinctrl-names = "default";
128		pinctrl-0 = <&vdd_sd_dv_pins_default>;
129		regulator-min-microvolt = <1800000>;
130		regulator-max-microvolt = <3300000>;
131		regulator-boot-on;
132		vin-supply = <&vdd_3v3>;
133		gpios = <&main_gpio1 49 GPIO_ACTIVE_HIGH>;
134		states = <1800000 0x0>,
135			 <3300000 0x1>;
136		bootph-all;
137	};
138
139	adc_vref: regulator-5 {
140		compatible = "regulator-fixed";
141		regulator-name = "default";
142		regulator-min-microvolt = <3300000>;
143		regulator-max-microvolt = <3300000>;
144		regulator-boot-on;
145	};
146
147	leds {
148		compatible = "gpio-leds";
149		pinctrl-names = "default";
150		pinctrl-0 = <&led_pins_default>;
151		bootph-all;
152
153		led-1 {
154			function = LED_FUNCTION_HEARTBEAT;
155			color = <LED_COLOR_ID_GREEN>;
156			linux,default-trigger = "heartbeat";
157			gpios = <&main_gpio0 6 GPIO_ACTIVE_HIGH>;
158			default-state = "on";
159			bootph-all;
160		};
161
162		led-2 {
163			function = LED_FUNCTION_DISK_ACTIVITY;
164			color = <LED_COLOR_ID_GREEN>;
165			linux,default-trigger = "mmc1";
166			gpios = <&main_gpio0 5 GPIO_ACTIVE_HIGH>;
167			default-state = "on";
168			bootph-all;
169		};
170
171		led-3 {
172			function = LED_FUNCTION_INDICATOR;
173			color = <LED_COLOR_ID_GREEN>;
174			gpios = <&main_gpio0 4 GPIO_ACTIVE_HIGH>;
175			default-state = "off";
176			bootph-all;
177		};
178
179		led-4 {
180			function = LED_FUNCTION_INDICATOR;
181			color = <LED_COLOR_ID_GREEN>;
182			gpios = <&main_gpio0 3 GPIO_ACTIVE_HIGH>;
183			default-state = "off";
184			bootph-all;
185		};
186	};
187};
188
189&main_pmx0 {
190	led_pins_default: led-default-pins {
191		pinctrl-single,pins = <
192			AM62X_IOPAD(0x000c, PIN_OUTPUT, 7) /* (E25) OSPI0_D0.GPIO0_3 */
193			AM62X_IOPAD(0x0010, PIN_OUTPUT, 7) /* (G24) OSPI0_D1.GPIO0_4 */
194			AM62X_IOPAD(0x0014, PIN_OUTPUT, 7) /* (F25) OSPI0_D2.GPIO0_5 */
195			AM62X_IOPAD(0x0018, PIN_OUTPUT, 7) /* (F24) OSPI0_D3.GPIO0_6 */
196		>;
197		bootph-all;
198	};
199
200	main_i2c0_pins_default: main-i2c0-default-pins {
201		pinctrl-single,pins = <
202			AM62X_IOPAD(0x01e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
203			AM62X_IOPAD(0x01e4, PIN_INPUT_PULLUP, 0) /* (A16) I2C0_SDA */
204		>;
205		bootph-all;
206	};
207
208	main_i2c2_pins_default: main-i2c2-default-pins {
209		pinctrl-single,pins = <
210			AM62X_IOPAD(0x00b0, PIN_INPUT_PULLUP, 1) /* (K22) GPMC0_CSn2.I2C2_SCL */
211			AM62X_IOPAD(0x00b4, PIN_INPUT_PULLUP, 1) /* (K24) GPMC0_CSn3.I2C2_SDA */
212		>;
213		bootph-all;
214	};
215
216	main_uart0_pins_default: main-uart0-default-pins {
217		pinctrl-single,pins = <
218			AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14/A13) UART0_RXD */
219			AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14/E11) UART0_TXD */
220		>;
221		bootph-all;
222	};
223
224	main_uart1_pins_default: main-uart1-default-pins {
225		pinctrl-single,pins = <
226			AM62X_IOPAD(0x194, PIN_INPUT, 2) /* (B19/B18) MCASP0_AXR3.UART1_CTSn */
227			AM62X_IOPAD(0x198, PIN_OUTPUT, 2) /* (A19/B17) MCASP0_AXR2.UART1_RTSn */
228			AM62X_IOPAD(0x1ac, PIN_INPUT, 2) /* (E19/D15) MCASP0_AFSR.UART1_RXD */
229			AM62X_IOPAD(0x1b0, PIN_OUTPUT, 2) /* (A20/D16) MCASP0_ACLKR.UART1_TXD */
230		>;
231		bootph-all;
232	};
233
234	main_uart6_pins_default: main-uart6-default-pins {
235		pinctrl-single,pins = <
236			AM62X_IOPAD(0x001c, PIN_INPUT, 3) /* (J23) OSPI0_D4.UART6_RXD */
237			AM62X_IOPAD(0x0020, PIN_OUTPUT, 3) /* (J25) OSPI0_D5.UART6_TXD */
238		>;
239	};
240
241	main_mmc1_pins_default: main-mmc1-default-pins {
242		pinctrl-single,pins = <
243			AM62X_IOPAD(0x23c, PIN_INPUT, 0) /* (A21/C18) MMC1_CMD */
244			AM62X_IOPAD(0x234, PIN_INPUT, 0) /* (B22/A20) MMC1_CLK */
245			AM62X_IOPAD(0x230, PIN_INPUT, 0) /* (A22/A19) MMC1_DAT0 */
246			AM62X_IOPAD(0x22c, PIN_INPUT, 0) /* (B21/B19) MMC1_DAT1 */
247			AM62X_IOPAD(0x228, PIN_INPUT, 0) /* (C21/B20) MMC1_DAT2 */
248			AM62X_IOPAD(0x224, PIN_INPUT, 0) /* (D22/C19) MMC1_DAT3 */
249			AM62X_IOPAD(0x240, PIN_INPUT, 7) /* (D17/C15) MMC1_SDCD.GPIO1_48 */
250		>;
251		bootph-all;
252	};
253
254	vdd_sd_dv_pins_default: vdd-sd-dv-default-pins {
255		pinctrl-single,pins = <
256			AM62X_IOPAD(0x0244, PIN_OUTPUT, 7) /* (P25) GPMC0_CLK.GPIO1_49 */
257		>;
258		bootph-all;
259	};
260
261	pmic_irq_pins_default: pmic-irq-default-pins {
262		pinctrl-single,pins = <
263			AM62X_IOPAD(0x01f4, PIN_INPUT_PULLUP, 0) /* (D16) EXTINTn */
264		>;
265		bootph-all;
266	};
267
268	vdd_3v3_sd_pins_default: vdd-3v3-sd-default-pins {
269		pinctrl-single,pins = <
270			AM62X_IOPAD(0x0000, PIN_OUTPUT, 7) /* (H24) OSPI0_CLK.GPIO0_0 */
271		>;
272		bootph-all;
273	};
274
275	usb1_pins_default: usb1-default-pins {
276		pinctrl-single,pins = <
277			AM62X_IOPAD(0x0258, PIN_INPUT, 0) /* (F18) USB1_DRVVBUS */
278		>;
279		bootph-all;
280	};
281
282	epwm2_pins_default: epwm2-default-pins {
283		pinctrl-single,pins = <
284			AM62X_IOPAD(0x01e8, PIN_OUTPUT, 8) /* (B17) I2C1_SCL.EHRPWM2_A */
285		>;
286	};
287};
288
289&epwm2 {
290	status = "okay";
291	pinctrl-names = "default";
292	pinctrl-0 = <&epwm2_pins_default>;
293};
294
295&mailbox0_cluster0 {
296	mbox_m4_0: mbox-m4-0 {
297		ti,mbox-rx = <0 0 0>;
298		ti,mbox-tx = <1 0 0>;
299	};
300};
301
302&main_uart0 {
303	pinctrl-names = "default";
304	pinctrl-0 = <&main_uart0_pins_default>;
305	bootph-all;
306	status = "okay";
307};
308
309&main_uart1 {
310	pinctrl-names = "default";
311	pinctrl-0 = <&main_uart1_pins_default>;
312	bootph-pre-ram;
313	status = "reserved";
314};
315
316&main_uart6 {
317	pinctrl-names = "default";
318	pinctrl-0 = <&main_uart6_pins_default>;
319	bootph-all;
320	status = "okay";
321};
322
323&main_i2c0 {
324	pinctrl-names = "default";
325	pinctrl-0 = <&main_i2c0_pins_default>;
326	clock-frequency = <400000>;
327	bootph-all;
328	status = "okay";
329
330	ad7291: adc@20 {
331		/* Emulated with MSPM0L1105 */
332		compatible = "adi,ad7291";
333		reg = <0x20>;
334		vref-supply = <&adc_vref>;
335	};
336
337	eeprom: eeprom@50 {
338		/* Emulated with MSPM0L1105 */
339		compatible = "atmel,24c32";
340		reg = <0x50>;
341	};
342};
343
344&main_i2c2 {
345	pinctrl-names = "default";
346	pinctrl-0 = <&main_i2c2_pins_default>;
347	clock-frequency = <400000>;
348	bootph-all;
349	status = "okay";
350};
351
352&mcu_m4fss {
353	mboxes = <&mailbox0_cluster0 &mbox_m4_0>;
354	memory-region = <&mcu_m4fss_dma_memory_region>,
355			<&mcu_m4fss_memory_region>;
356	status = "okay";
357};
358
359&mcu_pmx0 {
360	wkup_uart0_pins_default: wkup-uart0-default-pins {
361		pinctrl-single,pins = <
362			AM62X_MCU_IOPAD(0x02c, PIN_INPUT, 0)	/* (C6/A7) WKUP_UART0_CTSn */
363			AM62X_MCU_IOPAD(0x030, PIN_OUTPUT, 0)	/* (A4/B4) WKUP_UART0_RTSn */
364			AM62X_MCU_IOPAD(0x024, PIN_INPUT, 0)	/* (B4/B5) WKUP_UART0_RXD */
365			AM62X_MCU_IOPAD(0x028, PIN_OUTPUT, 0)	/* (C5/C6) WKUP_UART0_TXD */
366		>;
367		bootph-all;
368	};
369
370	wkup_i2c0_pins_default: wkup-i2c0-default-pins {
371		pinctrl-single,pins = <
372			AM62X_MCU_IOPAD(0x004c, PIN_INPUT_PULLUP, 0)	/* (B9) WKUP_I2C0_SCL */
373			AM62X_MCU_IOPAD(0x0050, PIN_INPUT_PULLUP, 0)	/* (A9) WKUP_I2C0_SDA */
374		>;
375		bootph-all;
376	};
377};
378
379&sdhci1 {
380	/* SD/MMC */
381	vmmc-supply = <&vdd_mmc1>;
382	vqmmc-supply = <&vdd_sd_dv>;
383	pinctrl-names = "default";
384	pinctrl-0 = <&main_mmc1_pins_default>;
385	disable-wp;
386	cd-gpios = <&main_gpio1 48 GPIO_ACTIVE_LOW>;
387	cd-debounce-delay-ms = <100>;
388	bootph-all;
389	ti,fails-without-test-cd;
390	status = "okay";
391};
392
393&usbss0 {
394	bootph-all;
395	ti,vbus-divider;
396	status = "okay";
397};
398
399&usb0 {
400	/* This is a Type-C socket, but wired as USB 2.0 */
401	dr_mode = "peripheral";
402	bootph-all;
403};
404
405&usbss1 {
406	ti,vbus-divider;
407	status = "okay";
408};
409
410&usb1 {
411	/*
412	 * Default set here is compatible with original PocketBeagle,
413	 * Expansion boards assumed this was pre-setup as host.
414	 */
415	dr_mode = "host";
416	pinctrl-names = "default";
417	pinctrl-0 = <&usb1_pins_default>;
418};
419
420&wkup_uart0 {
421	/* WKUP UART0 is used by Device Manager firmware */
422	pinctrl-names = "default";
423	pinctrl-0 = <&wkup_uart0_pins_default>;
424	bootph-all;
425	status = "reserved";
426};
427
428&wkup_i2c0 {
429	pinctrl-names = "default";
430	pinctrl-0 = <&wkup_i2c0_pins_default>;
431	clock-frequency = <100000>;
432	bootph-all;
433	status = "okay";
434
435	tps65219: pmic@30 {
436		compatible = "ti,tps65219";
437		reg = <0x30>;
438		buck1-supply = <&vsys_5v0>;
439		buck2-supply = <&vsys_5v0>;
440		buck3-supply = <&vsys_5v0>;
441		ldo1-supply = <&vdd_3v3>;
442		ldo2-supply = <&buck2_reg>;
443		ldo3-supply = <&vdd_3v3>;
444		ldo4-supply = <&vdd_3v3>;
445
446		pinctrl-names = "default";
447		pinctrl-0 = <&pmic_irq_pins_default>;
448		interrupt-parent = <&gic500>;
449		interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
450		interrupt-controller;
451		#interrupt-cells = <1>;
452
453		bootph-all;
454		system-power-controller;
455		ti,power-button;
456
457		regulators {
458			buck1_reg: buck1 {
459				regulator-name = "VDD_CORE";
460				regulator-min-microvolt = <850000>;
461				regulator-max-microvolt = <850000>;
462				regulator-boot-on;
463				regulator-always-on;
464			};
465
466			buck2_reg: buck2 {
467				regulator-name = "VDD_1V8";
468				regulator-min-microvolt = <1800000>;
469				regulator-max-microvolt = <1800000>;
470				regulator-boot-on;
471				regulator-always-on;
472			};
473
474			buck3_reg: buck3 {
475				regulator-name = "VDD_1V2";
476				regulator-min-microvolt = <1200000>;
477				regulator-max-microvolt = <1200000>;
478				regulator-boot-on;
479				regulator-always-on;
480			};
481
482			ldo1_reg: ldo1 {
483				/*
484				 * Regulator is left as is unused, vdd_sd
485				 * is controlled via GPIO with bypass config
486				 * as per the NVM configuration
487				 */
488				regulator-name = "VDD_SD_3V3";
489				regulator-min-microvolt = <3300000>;
490				regulator-max-microvolt = <3300000>;
491				regulator-allow-bypass;
492				regulator-boot-on;
493				regulator-always-on;
494			};
495
496			ldo2_reg: ldo2 {
497				regulator-name = "VDDA_0V85";
498				regulator-min-microvolt = <850000>;
499				regulator-max-microvolt = <850000>;
500				regulator-boot-on;
501				regulator-always-on;
502			};
503
504			ldo3_reg: ldo3 {
505				regulator-name = "VDDA_1V8";
506				regulator-min-microvolt = <1800000>;
507				regulator-max-microvolt = <1800000>;
508				regulator-boot-on;
509				regulator-always-on;
510			};
511
512			ldo4_reg: ldo4 {
513				regulator-name = "VDD_2V5";
514				regulator-min-microvolt = <2500000>;
515				regulator-max-microvolt = <2500000>;
516				regulator-boot-on;
517				regulator-always-on;
518			};
519		};
520	};
521};
522