1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * at91-sam9x75_curiosity.dts - Device Tree file for Microchip SAM9X75 Curiosity board
4 *
5 * Copyright (C) 2023 Microchip Technology Inc. and its subsidiaries
6 *
7 * Author: Varshini Rajendran <[email protected]>
8 */
9/dts-v1/;
10#include "sam9x7.dtsi"
11#include <dt-bindings/input/input.h>
12
13/ {
14	model = "Microchip SAM9X75 Curiosity";
15	compatible = "microchip,sam9x75-curiosity", "microchip,sam9x7", "atmel,at91sam9";
16
17	aliases {
18		i2c0 = &i2c6;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24
25	gpio-keys {
26		compatible = "gpio-keys";
27		pinctrl-names = "default";
28		pinctrl-0 = <&pinctrl_key_gpio_default>;
29
30		button-user {
31			label = "USER";
32			gpios = <&pioC 9 GPIO_ACTIVE_LOW>;
33			linux,code = <KEY_0>;
34			wakeup-source;
35		};
36	};
37
38	led-controller {
39		compatible = "gpio-leds";
40
41		led_red: led-red {
42			label = "red";
43			gpios = <&pioC 14 GPIO_ACTIVE_HIGH>;
44			pinctrl-0 = <&pinctrl_red_led_gpio_default>;
45		};
46
47		led_green: led-green {
48			label = "green";
49			gpios = <&pioC 21 GPIO_ACTIVE_HIGH>;
50			pinctrl-0 = <&pinctrl_green_led_gpio_default>;
51		};
52
53		led_blue: led-blue {
54			label = "blue";
55			gpios = <&pioC 20 GPIO_ACTIVE_HIGH>;
56			pinctrl-0 = <&pinctrl_blue_led_gpio_default>;
57			linux,default-trigger = "heartbeat";
58		};
59	};
60
61	memory@20000000 {
62		reg = <0x20000000 0x10000000>;
63		device_type = "memory";
64	};
65};
66
67&classd {
68	pinctrl-names = "default";
69	pinctrl-0 = <&pinctrl_classd_default>;
70	atmel,pwm-type = "diff";
71	atmel,non-overlap-time = <10>;
72	status = "okay";
73};
74
75&dbgu {
76	pinctrl-names = "default";
77	pinctrl-0 = <&pinctrl_dbgu_default>;
78	status = "okay";
79};
80
81&dma0 {
82	status = "okay";
83};
84
85&flx6 {
86	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
87	status = "okay";
88};
89
90&i2c6 {
91	pinctrl-names = "default";
92	pinctrl-0 = <&pinctrl_flx6_default>;
93	i2c-analog-filter;
94	i2c-digital-filter;
95	i2c-digital-filter-width-ns = <35>;
96	status = "okay";
97
98	pmic@5b {
99		compatible = "microchip,mcp16502";
100		reg = <0x5b>;
101
102		regulators {
103			vdd_3v3: VDD_IO {
104				regulator-name = "VDD_IO";
105				regulator-min-microvolt = <3300000>;
106				regulator-max-microvolt = <3300000>;
107				regulator-initial-mode = <2>;
108				regulator-allowed-modes = <2>, <4>;
109				regulator-always-on;
110
111				regulator-state-standby {
112					regulator-on-in-suspend;
113					regulator-mode = <4>;
114				};
115
116				regulator-state-mem {
117					regulator-mode = <4>;
118				};
119			};
120
121			vddioddr: VDD_DDR {
122				regulator-name = "VDD_DDR";
123				regulator-min-microvolt = <1350000>;
124				regulator-max-microvolt = <1350000>;
125				regulator-initial-mode = <2>;
126				regulator-allowed-modes = <2>, <4>;
127				regulator-always-on;
128
129				regulator-state-standby {
130					regulator-on-in-suspend;
131					regulator-mode = <4>;
132				};
133
134				regulator-state-mem {
135					regulator-on-in-suspend;
136					regulator-mode = <4>;
137				};
138			};
139
140			vddcore: VDD_CORE {
141				regulator-name = "VDD_CORE";
142				regulator-min-microvolt = <1150000>;
143				regulator-max-microvolt = <1150000>;
144				regulator-initial-mode = <2>;
145				regulator-allowed-modes = <2>, <4>;
146				regulator-always-on;
147
148				regulator-state-standby {
149					regulator-on-in-suspend;
150					regulator-mode = <4>;
151				};
152
153				regulator-state-mem {
154					regulator-mode = <4>;
155				};
156			};
157
158			dcdc4: VDD_OTHER {
159				regulator-name = "VDD_OTHER";
160				regulator-min-microvolt = <1150000>;
161				regulator-max-microvolt = <1150000>;
162				regulator-initial-mode = <2>;
163				regulator-allowed-modes = <2>, <4>;
164				regulator-ramp-delay = <3125>;
165				regulator-always-on;
166
167				regulator-state-standby {
168					regulator-on-in-suspend;
169					regulator-mode = <4>;
170				};
171
172				regulator-state-mem {
173					regulator-mode = <4>;
174				};
175			};
176
177			vldo1: LDO1 {
178				regulator-name = "LDO1";
179				regulator-min-microvolt = <3300000>;
180				regulator-max-microvolt = <3300000>;
181				regulator-always-on;
182
183				regulator-state-standby {
184					regulator-on-in-suspend;
185				};
186			};
187
188			vldo2: LDO2 {
189				regulator-name = "LDO2";
190				regulator-min-microvolt = <1800000>;
191				regulator-max-microvolt = <1800000>;
192
193				regulator-state-standby {
194					regulator-on-in-suspend;
195				};
196			};
197		};
198	};
199};
200
201&flx7 {
202	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
203	status = "okay";
204};
205
206&i2c7 {
207	dmas = <0>, <0>;
208	i2c-analog-filter;
209	i2c-digital-filter;
210	i2c-digital-filter-width-ns = <35>;
211	pinctrl-names = "default";
212	pinctrl-0 = <&pinctrl_flx7_default>;
213	status = "okay";
214
215	power-monitor@10 {
216		compatible = "microchip,pac1934";
217		reg = <0x10>;
218		#address-cells = <1>;
219		#size-cells = <0>;
220
221		channel@1 {
222			reg = <0x1>;
223			shunt-resistor-micro-ohms = <10000>;
224			label = "VDD3V3";
225		};
226
227		channel@2 {
228			reg = <0x2>;
229			shunt-resistor-micro-ohms = <10000>;
230			label = "DCDC4";
231		};
232
233		channel@3 {
234			reg = <0x3>;
235			shunt-resistor-micro-ohms = <10000>;
236			label = "VDDCORE";
237		};
238
239		channel@4 {
240			reg = <0x4>;
241			shunt-resistor-micro-ohms = <10000>;
242			label = "VDDIODDR";
243		};
244	};
245};
246
247&i2s {
248	pinctrl-names = "default";
249	pinctrl-0 = <&pinctrl_i2s_default>;
250	#sound-dai-cells = <0>;
251	status = "okay";
252};
253
254&main_xtal {
255	clock-frequency = <24000000>;
256};
257
258&pinctrl {
259	classd {
260		pinctrl_classd_default: classd-default {
261			atmel,pins =
262				<AT91_PIOA 18 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>,
263				<AT91_PIOA 19 AT91_PERIPH_C AT91_PINCTRL_PULL_DOWN>;
264		};
265	};
266
267	dbgu {
268		pinctrl_dbgu_default: dbgu-default {
269			atmel,pins = <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
270				     <AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
271		};
272	};
273
274	flexcom {
275		pinctrl_flx6_default: flx6-default {
276			atmel,pins =
277				<AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
278				<AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
279		};
280
281		pinctrl_flx7_default: flx7-default {
282			atmel,pins =
283				<AT91_PIOC 0 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>,
284				<AT91_PIOC 1 AT91_PERIPH_C AT91_PINCTRL_PULL_UP>;
285		};
286	};
287
288	gpio-keys {
289		pinctrl_key_gpio_default: key-gpio-default {
290			atmel,pins = <AT91_PIOC 9 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
291		};
292	};
293
294	i2s {
295		pinctrl_i2s_default: i2s-default {
296			atmel,pins =
297				<AT91_PIOB 26 AT91_PERIPH_D AT91_PINCTRL_NONE>,		/* I2SCK */
298				<AT91_PIOB 15 AT91_PERIPH_D AT91_PINCTRL_NONE>,		/* I2SWS */
299				<AT91_PIOB 16 AT91_PERIPH_D AT91_PINCTRL_NONE>,		/* I2SDIN */
300				<AT91_PIOB 17 AT91_PERIPH_D AT91_PINCTRL_NONE>,		/* I2SDOUT */
301				<AT91_PIOB 25 AT91_PERIPH_D AT91_PINCTRL_NONE>;		/* I2SMCK */
302		};
303	};
304
305	led-controller {
306		pinctrl_red_led_gpio_default: red-led-gpio-default {
307			atmel,pins = <AT91_PIOC 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
308		};
309		pinctrl_green_led_gpio_default: green-led-gpio-default {
310			atmel,pins = <AT91_PIOC 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
311		};
312		pinctrl_blue_led_gpio_default: blue-led-gpio-default {
313			atmel,pins = <AT91_PIOC 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
314		};
315	};
316
317	sdmmc0 {
318		pinctrl_sdmmc0_default: sdmmc0-default {
319			atmel,pins =
320				<AT91_PIOA 2 AT91_PERIPH_A (AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_ENA)>,				/* PA2 CK  periph A with pullup */
321				<AT91_PIOA 1 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_ENA)>,	/* PA1 CMD periph A with pullup */
322				<AT91_PIOA 0 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_ENA)>,	/* PA0 DAT0 periph A */
323				<AT91_PIOA 3 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_ENA)>,	/* PA3 DAT1 periph A with pullup */
324				<AT91_PIOA 4 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_ENA)>,	/* PA4 DAT2 periph A with pullup */
325				<AT91_PIOA 5 AT91_PERIPH_A (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DRIVE_STRENGTH_HI | AT91_PINCTRL_SLEWRATE_ENA)>;	/* PA5 DAT3 periph A with pullup */
326		};
327	};
328}; /* pinctrl */
329
330&poweroff {
331	debounce-delay-us = <976>;
332	status = "okay";
333
334	input@0 {
335		reg = <0>;
336	};
337};
338
339&rtt {
340	atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
341};
342
343&sdmmc0 {
344	bus-width = <4>;
345	pinctrl-names = "default";
346	pinctrl-0 = <&pinctrl_sdmmc0_default>;
347	cd-gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
348	disable-wp;
349	status = "okay";
350};
351
352&slow_xtal {
353	clock-frequency = <32768>;
354};
355
356&tcb {
357	timer0: timer@0 {
358		compatible = "atmel,tcb-timer";
359		reg = <0>;
360	};
361
362	timer1: timer@1 {
363		compatible = "atmel,tcb-timer";
364		reg = <1>;
365	};
366};
367
368&trng {
369	status = "okay";
370};
371
372&watchdog {
373	status = "okay";
374};
375