1/*
2 * Copyright (c) 2021 Linaro Limited
3 * Copyright (c) 2024 STMicroelectronics
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include <st/u5/stm32u585Xi.dtsi>
9#include <st/u5/stm32u585aiixq-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	leds {
15		compatible = "gpio-leds";
16		green_led_1: led_1 {
17			gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;
18			label = "User LD7";
19		};
20		red_led_1: led_3 {
21			gpios = <&gpioh 6 GPIO_ACTIVE_LOW>;
22			label = "User LD6";
23		};
24	};
25
26	gpio_keys {
27		compatible = "gpio-keys";
28		user_button: button {
29			label = "User";
30			gpios = <&gpioc 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
31			zephyr,code = <INPUT_KEY_0>;
32		};
33	};
34
35
36	aliases {
37		watchdog0 = &iwdg;
38		die-temp0 = &die_temp;
39		volt-sensor0 = &vref1;
40		volt-sensor1 = &vbat4;
41		eeprom-0 = &eeprom0;
42	};
43};
44
45&clk_hsi48 {
46	status = "okay";
47};
48
49&clk_lse {
50	status = "okay";
51};
52
53&clk_msis {
54	status = "okay";
55	msi-range = <4>;
56	msi-pll-mode;
57};
58
59&pll1 {
60	div-m = <1>;
61	mul-n = <80>;
62	div-q = <2>;
63	div-r = <2>;
64	clocks = <&clk_msis>;
65	status = "okay";
66};
67
68&rcc {
69	clocks = <&pll1>;
70	clock-frequency = <DT_FREQ_M(160)>;
71	ahb-prescaler = <1>;
72	apb1-prescaler = <1>;
73	apb2-prescaler = <1>;
74	apb3-prescaler = <1>;
75};
76
77stm32_lp_tick_source: &lptim1 {
78	clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00000800>,
79		 <&rcc STM32_SRC_LSE LPTIM1_SEL(3)>;
80	status = "okay";
81};
82
83&usart1 {
84	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
85	pinctrl-names = "default";
86	current-speed = <115200>;
87	status = "okay";
88};
89
90&usart3 {
91	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
92	pinctrl-names = "default";
93	current-speed = <115200>;
94	status = "okay";
95};
96
97&spi1 {
98	pinctrl-0 = <&spi1_nss_pe12 &spi1_sck_pe13
99		     &spi1_miso_pe14 &spi1_mosi_pe15>;
100	pinctrl-names = "default";
101	status = "okay";
102};
103
104&timers4 {
105	status = "okay";
106	st,prescaler = <1>;
107	pwm4: pwm {
108		status = "okay";
109		pinctrl-0 = <&tim4_ch1_pb6>;
110		pinctrl-names = "default";
111	};
112};
113
114&timers3 {
115	status = "okay";
116	st,prescaler = <255>;
117	pwm3: pwm {
118		status = "okay";
119		pinctrl-0 = <&tim3_ch2_pe4>;
120		pinctrl-names = "default";
121	};
122};
123
124&octospi2 {
125	pinctrl-0 = <&octospim_p2_clk_pf4 &octospim_p2_ncs_pi5
126		     &octospim_p2_io0_pf0 &octospim_p2_io1_pf1
127		     &octospim_p2_io2_pf2 &octospim_p2_io3_pf3
128		     &octospim_p2_io4_ph9 &octospim_p2_io5_ph10
129		     &octospim_p2_io6_ph11 &octospim_p2_io7_ph12
130		     &octospim_p2_dqs_pf12>;
131	pinctrl-names = "default";
132
133	status = "okay";
134
135	mx25lm51245: ospi-nor-flash@70000000 {
136		compatible = "st,stm32-ospi-nor";
137		reg = <0x70000000 DT_SIZE_M(64)>; /* 512 Mbits */
138		ospi-max-frequency = <DT_FREQ_M(50)>;
139		spi-bus-width = <OSPI_OPI_MODE>;
140		data-rate = <OSPI_DTR_TRANSFER>;
141		four-byte-opcodes;
142		status = "okay";
143
144		partitions {
145			compatible = "fixed-partitions";
146			#address-cells = <1>;
147			#size-cells = <1>;
148
149			partition@0 {
150				reg = <0x00000000 DT_SIZE_M(64)>;
151			};
152		};
153	};
154};
155
156&i2c1 {
157	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
158	pinctrl-names = "default";
159	status = "okay";
160	clock-frequency = <I2C_BITRATE_FAST>;
161};
162
163&i2c2 {
164	pinctrl-0 = <&i2c2_scl_ph4 &i2c2_sda_ph5>;
165	pinctrl-names = "default";
166	status = "okay";
167	clock-frequency = <I2C_BITRATE_FAST>;
168
169	veml6030@10 {
170		compatible ="vishay,veml7700";
171		reg = <0x10>;
172		status = "okay";
173	};
174
175	iis2mdc@1e {
176		compatible = "st,iis2mdc";
177		reg = <0x1e>;
178		drdy-gpios =  <&gpiod 10 GPIO_ACTIVE_HIGH>;
179	};
180
181	ism330dhcx@6b {
182		compatible = "st,ism330dhcx";
183		reg = <0x6b>;
184		drdy-gpios =  <&gpioe 11 GPIO_ACTIVE_HIGH>;
185	};
186
187	lps22hh@5d {
188		compatible = "st,lps22hh";
189		reg = <0x5d>;
190		drdy-gpios =  <&gpiog 2 GPIO_ACTIVE_HIGH>;
191	};
192
193	eeprom0:eeprom@56 {
194		compatible = "atmel,at24";
195		reg = <0x56>;
196		status = "okay";
197		size = <DT_SIZE_K(32)>;
198		pagesize = <64>;
199		address-width = <16>;
200		timeout = <5>;
201	};
202
203	hts221@5f {
204		compatible = "st,hts221";
205		reg = <0x5f>;
206	};
207};
208
209&aes {
210	status = "okay";
211};
212
213&rng {
214	status = "okay";
215};
216
217zephyr_udc0: &usbotg_fs {
218	pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
219	pinctrl-names = "default";
220	status = "okay";
221};
222
223&adc1 {
224	pinctrl-0 = <&adc1_in15_pb0>;
225	pinctrl-names = "default";
226	st,adc-clock-source = "ASYNC";
227	st,adc-prescaler = <4>;
228	status = "okay";
229};
230
231&adc4 {
232	pinctrl-0 = <&adc4_in19_pb1>;
233	pinctrl-names = "default";
234	st,adc-clock-source = "ASYNC";
235	st,adc-prescaler = <4>;
236	status = "okay";
237};
238
239&die_temp {
240	status = "okay";
241};
242
243&dac1 {
244	pinctrl-0 = <&dac1_out1_pa4>;
245	pinctrl-names = "default";
246	status = "okay";
247};
248
249&rtc {
250	clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>,
251		 <&rcc STM32_SRC_LSE RTC_SEL(1)>;
252	status = "okay";
253};
254
255&iwdg {
256	status = "okay";
257};
258
259&vref1 {
260	status = "okay";
261};
262
263&vbat4 {
264	status = "okay";
265};
266