1/*
2 * Copyright (c) 2023-2024 Analog Devices, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8
9#include <adi/max32/max32655.dtsi>
10#include <adi/max32/max32655-pinctrl.dtsi>
11#include <zephyr/dt-bindings/gpio/adi-max32-gpio.h>
12#include <zephyr/dt-bindings/input/input-event-codes.h>
13#include <zephyr/dt-bindings/dma/max32655_dma.h>
14
15/ {
16	model = "Analog Devices MAX32655FTHR";
17	compatible = "adi,max32655fthr";
18
19	chosen {
20		zephyr,console = &uart0;
21		zephyr,shell-uart = &uart0;
22		zephyr,sram = &sram2;
23		zephyr,flash = &flash0;
24	};
25
26	leds {
27		compatible = "gpio-leds";
28		led1: led_1 {
29			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
30			label = "Red LED";
31		};
32		led2: led_2 {
33			gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
34			label = "Blue LED";
35		};
36		led3: led_3 {
37			gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
38			label = "Green LED";
39		};
40	};
41
42	buttons {
43		compatible = "gpio-keys";
44		pb1: pb1 {
45			gpios = <&gpio0 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
46			label = "SW2";
47			zephyr,code = <INPUT_KEY_0>;
48		};
49		pb2: pb2 {
50			gpios = <&gpio0 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
51			label = "SW3";
52			zephyr,code = <INPUT_KEY_1>;
53		};
54		pb_wakeup: pb_wakeup {
55			gpios = <&gpio3 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW
56					| MAX32_GPIO_VSEL_VDDIOH)>;
57			label = "Wakeup";
58			zephyr,code = <INPUT_KEY_WAKEUP>;
59		};
60	};
61
62	/* These aliases are provided for compatibility with samples */
63	aliases {
64		led0 = &led1;
65		led1 = &led2;
66		led2 = &led3;
67		sw0 = &pb1;
68		sw1 = &pb2;
69		watchdog0 = &wdt0;
70	};
71
72	/* Used for accessing other pins */
73	feather_header: feather_connector {
74		compatible = "adafruit-feather-header";
75		#gpio-cells = <2>;
76		gpio-map-mask = <0xffffffff 0xffffffc0>;
77		gpio-map-pass-thru = <0 0x3f>;
78		gpio-map = <12 0 &gpio0 31 0>,  /* SDA */
79				<13 0 &gpio0 30 0>,  /* SCL */
80				<14 0 &gpio1 9 0>,  /* GPIO */
81				<15 0 &gpio1 8 0>,  /* GPIO */
82				<16 0 &gpio0 20 0>,   /* GPIO */
83				<17 0 &gpio0 24 0>,   /* GPIO */
84				<18 0 &gpio0 25 0>,   /* GPIO */
85				<19 0 &gpio1 7 0>,   /* GPIO */
86				<20 0 &gpio1 6 0>,   /* GPIO */
87				/* 11 not connected */
88				<10 0 &gpio2 7 0>,  /* TX */
89				<9 0 &gpio2 6 0>,   /* RX */
90				<8 0 &gpio0 22 0>,   /* MISO */
91				<7 0 &gpio0 21 0>,   /* MOSI */
92				<6 0 &gpio0 23 0>,   /* SCK */
93				<5 0 &gpio2 5 0>,   /* AIN5 */
94				<4 0 &gpio2 4 0>,   /* AIN4 */
95				<3 0 &gpio2 3 0>,   /* AIN3 */
96				<2 0 &gpio2 2 0>,   /* AIN2 */
97				<1 0 &gpio2 1 0>,   /* AIN1 */
98				<0 0 &gpio2 0 0>;   /* AIN0 */
99	};
100};
101
102&uart0 {
103	pinctrl-0 = <&uart0a_tx_p0_1 &uart0a_rx_p0_0>;
104	pinctrl-names = "default";
105	current-speed = <115200>;
106	data-bits = <8>;
107	parity = "none";
108	status = "okay";
109};
110
111&clk_ipo {
112	status = "okay";
113};
114
115/*
116 * ERTCO is required for counter RTC
117 */
118&clk_ertco {
119	status = "okay";
120};
121
122&gpio0 {
123	status = "okay";
124};
125
126&gpio1 {
127	status = "okay";
128};
129
130&gpio2 {
131	status = "okay";
132};
133
134&gpio3 {
135	status = "okay";
136};
137
138&trng {
139	status = "okay";
140};
141
142&i2c2 {
143	status = "okay";
144	pinctrl-0 = <&i2c2_scl_p0_30 &i2c2_sda_p0_31>;
145	pinctrl-names = "default";
146};
147
148&dma0 {
149	status = "okay";
150};
151
152&wdt0 {
153	status = "okay";
154};
155
156&spi1 {
157	status = "okay";
158	pinctrl-0 = <&spi1_mosi_p0_21 &spi1_miso_p0_22 &spi1_sck_p0_23 &spi1_ss0_p0_20>;
159	pinctrl-names = "default";
160};
161
162&rtc_counter {
163	status = "okay";
164};
165