1/*
2 * Copyright (c) 2018 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f4/stm32f446Xe.dtsi>
9#include <st/f4/stm32f446v(c-e)tx-pinctrl.dtsi>
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "STMicroelectronics 96Boards STM32 Sensor Mezzanine board";
14	compatible = "st,stm32f446-b96b-f446ve";
15
16	chosen {
17		zephyr,console = &uart4;
18		zephyr,shell-uart = &uart4;
19		zephyr,sram = &sram0;
20		zephyr,flash = &flash0;
21	};
22
23	leds {
24		compatible = "gpio-leds";
25		red_led_0: led_0 {
26			gpios = <&gpiod 10 GPIO_ACTIVE_HIGH>;
27			label = "User LD0";
28		};
29		green_led_1: led_1 {
30			gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
31			label = "User LD1";
32		};
33		blue_led_2: led_2 {
34			gpios = <&gpiod 12 GPIO_ACTIVE_HIGH>;
35			label = "User LD2";
36		};
37	};
38
39	gpio_keys {
40		compatible = "gpio-keys";
41		user_button: button {
42			label = "Key";
43			gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
44			zephyr,code = <INPUT_KEY_0>;
45		};
46	};
47
48	aliases {
49		led0 = &red_led_0;
50		led1 = &green_led_1;
51		led2 = &blue_led_2;
52		sw0 = &user_button;
53	};
54};
55
56&clk_lsi {
57	status = "okay";
58};
59
60&clk_hse {
61	clock-frequency = <DT_FREQ_M(16)>;
62	status = "okay";
63};
64
65&pll {
66	div-m = <8>;
67	mul-n = <84>;
68	div-p = <2>;
69	div-q = <8>;
70	clocks = <&clk_hse>;
71	status = "okay";
72};
73
74&plli2s {
75	div-m = <8>;
76	mul-n = <192>;
77	div-r = <3>;
78	div-q = <4>;
79	clocks = <&clk_hse>;
80	status = "okay"; /* 48MHz on PLLI2SQ */
81};
82
83&rcc {
84	clocks = <&pll>;
85	clock-frequency = <DT_FREQ_M(84)>;
86	ahb-prescaler = <1>;
87	apb1-prescaler = <2>;
88	apb2-prescaler = <1>;
89};
90
91&i2s2 {
92	status = "okay";
93
94	mp34dt01@0 {
95		compatible = "st,mpxxdtyy";
96		reg = <0>;
97	};
98};
99
100&i2c1 {
101	pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
102	pinctrl-names = "default";
103	status = "okay";
104	clock-frequency = <I2C_BITRATE_FAST>;
105
106	/* ST Microelectronics LIS3MDL magnetic field sensor */
107	lis3mdl-magn@1e {
108		compatible = "st,lis3mdl-magn";
109		reg = <0x1e>;
110	};
111
112	/* ST Microelectronics LPS22HB pressure sensor */
113	lps22hb-press@5d {
114		compatible = "st,lps22hb-press";
115		reg = <0x5d>;
116	};
117};
118
119&i2c2 {
120	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pc12>;
121	pinctrl-names = "default";
122	status = "okay";
123	clock-frequency = <I2C_BITRATE_FAST>;
124};
125
126&dma1 {
127	status = "okay";
128};
129
130&i2s2 {
131	pinctrl-0 = <&i2s2_ck_pc7 &i2s2_sd_pc1>;
132	pinctrl-names = "default";
133	status = "okay";
134};
135
136&spi1_nss_pa4 { slew-rate = "very-high-speed"; };
137
138&spi1 {
139	pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5
140		     &spi1_miso_pa6 &spi1_mosi_pa7>;
141	pinctrl-names = "default";
142	status = "okay";
143};
144
145&spi2_nss_pb9 { slew-rate = "very-high-speed"; };
146
147&spi2 {
148	pinctrl-0 = <&spi2_nss_pb9 &spi2_sck_pd3
149		     &spi2_miso_pb14 &spi2_mosi_pb15>;
150	pinctrl-names = "default";
151	/* Cannot be used together with i2s2. */
152	/* status = "okay"; */
153};
154
155&spi4_nss_pe11 { slew-rate = "very-high-speed"; };
156
157&spi4 {
158	pinctrl-0 = <&spi4_nss_pe11 &spi4_sck_pe12
159		     &spi4_miso_pe13 &spi4_mosi_pe14>;
160	pinctrl-names = "default";
161	status = "okay";
162};
163
164&timers3 {
165	status = "okay";
166
167	pwm3: pwm {
168		status = "okay";
169		pinctrl-0 = <&tim3_ch1_pb4 &tim3_ch3_pc8>;
170		pinctrl-names = "default";
171	};
172};
173
174&timers4 {
175	status = "okay";
176
177	pwm4: pwm {
178		status = "okay";
179		pinctrl-0 = <&tim4_ch3_pd14 &tim4_ch4_pd15>;
180		pinctrl-names = "default";
181	};
182};
183
184&timers9 {
185	status = "okay";
186
187	pwm9: pwm {
188		status = "okay";
189		pinctrl-0 = <&tim9_ch1_pe5 &tim9_ch2_pe6>;
190		pinctrl-names = "default";
191	};
192};
193
194&usart1 {
195	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
196	pinctrl-names = "default";
197	current-speed = <115200>;
198	status = "okay";
199};
200
201&usart2 {
202	pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
203	pinctrl-names = "default";
204	current-speed = <115200>;
205	status = "okay";
206};
207
208&usart3 {
209	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
210	pinctrl-names = "default";
211	current-speed = <115200>;
212	status = "okay";
213};
214
215&uart4 {
216	pinctrl-0 = <&uart4_tx_pc10 &uart4_rx_pc11>;
217	pinctrl-names = "default";
218	current-speed = <115200>;
219	status = "okay";
220};
221
222&rtc {
223	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
224		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
225	status = "okay";
226};
227