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