1/*
2 * Copyright (c) 2020 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/l4/stm32l4s5Xi.dtsi>
9#include <st/l4/stm32l4s5vitx-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "STMicroelectronics B-L4S5I-IOT01A discovery kit";
15	compatible = "st,b-l4s5i-iot01a";
16
17	chosen {
18		zephyr,console = &usart1;
19		zephyr,shell-uart = &usart1;
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22		zephyr,code-partition = &slot0_partition;
23		zephyr,flash-controller = &mx25r6435f;
24		zephyr,bt-c2h-uart = &usart1;
25		zephyr,bt-hci = &hci_spi;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		green_led_1: led_1 {
31			gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
32			label = "User LD1";
33		};
34		green_led_2: led_2 {
35			gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
36			label = "User LD2";
37		};
38	};
39
40	gpio_keys {
41		compatible = "gpio-keys";
42		user_button: button {
43			label = "User";
44			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
45			zephyr,code = <INPUT_KEY_0>;
46		};
47	};
48
49	aliases {
50		led0 = &green_led_1;
51		sw0 = &user_button;
52		watchdog0 = &iwdg;
53		accel0 = &lsm6dsl;
54	};
55};
56
57&clk_lsi {
58	status = "okay";
59};
60
61&clk_hsi48 {
62	status = "okay";
63};
64
65&clk_hsi {
66	status = "okay";
67};
68
69&pll {
70	div-m = <4>;
71	mul-n = <40>;
72	div-q = <2>;
73	div-r = <2>;
74	clocks = <&clk_hsi>;
75	status = "okay";
76};
77
78&rcc {
79	clocks = <&pll>;
80	clock-frequency = <DT_FREQ_M(80)>;
81	ahb-prescaler = <1>;
82	apb1-prescaler = <1>;
83	apb2-prescaler = <1>;
84};
85
86&usart1 {
87	pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
88	pinctrl-names = "default";
89	current-speed = <115200>;
90	status = "okay";
91};
92
93&uart4 {
94	pinctrl-0 = <&uart4_tx_pa0 &uart4_rx_pa1>;
95	pinctrl-names = "default";
96	current-speed = <115200>;
97};
98
99&i2c1 {
100	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
101	pinctrl-names = "default";
102	status = "okay";
103	clock-frequency = <I2C_BITRATE_FAST>;
104};
105
106&i2c2 {
107	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
108	pinctrl-names = "default";
109	status = "okay";
110	clock-frequency = <I2C_BITRATE_FAST>;
111
112	lis3mdl-magn@1e {
113		compatible = "st,lis3mdl-magn";
114		reg = <0x1e>;
115	};
116
117	hts221@5f {
118		compatible = "st,hts221";
119		reg = <0x5f>;
120	};
121
122	lps22hb-press@5d {
123		compatible = "st,lps22hb-press";
124		reg = <0x5d>;
125	};
126
127	lsm6dsl: lsm6dsl@6a {
128		compatible = "st,lsm6dsl";
129		reg = <0x6a>;
130		irq-gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
131	};
132
133	vl53l0x@29 {
134		compatible = "st,vl53l0x";
135		reg = <0x29>;
136		xshut-gpios = <&gpioc 6 GPIO_ACTIVE_LOW>;
137	};
138};
139
140&spi1 {
141	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
142	pinctrl-names = "default";
143	cs-gpios = <&gpioa 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
144	status = "okay";
145};
146
147&spi3 {
148	pinctrl-0 = <&spi3_sck_pc10 &spi3_miso_pc11 &spi3_mosi_pc12>;
149	pinctrl-names = "default";
150	status = "okay";
151
152	cs-gpios = <&gpiod 13 GPIO_ACTIVE_LOW>,
153		   <&gpioe 0 GPIO_ACTIVE_LOW>;
154
155	hci_spi: spbtle-rf@0 {
156		compatible = "st,hci-spi-v1";
157		reg = <0>;
158		reset-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
159		irq-gpios = <&gpioe 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
160		spi-max-frequency = <DT_FREQ_M(2)>;
161		spi-hold-cs;
162	};
163
164	wifi0: ism43362@1 {
165		compatible = "inventek,eswifi";
166		spi-max-frequency = <2000000>;
167		reg = <1>;
168		resetn-gpios = <&gpioe 8 GPIO_ACTIVE_HIGH>;
169		boot0-gpios = <&gpiob 12 GPIO_ACTIVE_HIGH>;
170		wakeup-gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
171		data-gpios = <&gpioe 1 GPIO_ACTIVE_HIGH>;
172	};
173};
174
175&flash0 {
176
177	partitions {
178		compatible = "fixed-partitions";
179		#address-cells = <1>;
180		#size-cells = <1>;
181
182		boot_partition: partition@0 {
183			label = "mcuboot";
184			reg = <0x0 DT_SIZE_K(64)>;
185			read-only;
186		};
187
188		slot0_partition: partition@10000 {
189			label = "image-0";
190			reg = <0x10000 DT_SIZE_K(976)>;
191		};
192
193		slot1_partition: partition@104000 {
194			label = "image-1";
195			reg = <0x104000 DT_SIZE_K(976)>;
196		};
197
198		storage_partition: partition@1f8000 {
199			label = "storage";
200			reg = <0x1f8000 DT_SIZE_K(32)>;
201		};
202	};
203};
204
205&timers2 {
206	status = "okay";
207
208	pwm2: pwm {
209		status = "okay";
210		pinctrl-0 = <&tim2_ch1_pa15>;
211		pinctrl-names = "default";
212	};
213};
214
215&rtc {
216	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
217		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
218	status = "okay";
219};
220
221zephyr_udc0: &usbotg_fs {
222	pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12
223		     &usb_otg_fs_id_pa10>;
224	pinctrl-names = "default";
225	status = "okay";
226};
227
228&iwdg {
229	status = "okay";
230};
231
232&rng {
233	status = "okay";
234};
235
236&octospi1 {
237	pinctrl-0 = <&octospim_p1_clk_pe10 &octospim_p1_ncs_pe11
238		     &octospim_p1_io0_pe12 &octospim_p1_io1_pe13
239		     &octospim_p1_io2_pe14 &octospim_p1_io3_pe15>;
240	pinctrl-names = "default";
241
242	dmas = <&dma1 0 40 0x480>; /* request 40 for OCTOSPI1 */
243	dma-names = "tx_rx";
244
245	status = "okay";
246
247	mx25r6435f: ospi-nor-flash@90000000 {
248		compatible = "st,stm32-ospi-nor";
249		reg = <0x90000000 DT_SIZE_M(8)>; /* 64 Megabits */
250		ospi-max-frequency = <DT_FREQ_M(26)>; /* for Voltage Range 2 */
251		spi-bus-width = <OSPI_QUAD_MODE>;
252		data-rate = <OSPI_STR_TRANSFER>;
253		writeoc="PP_1_4_4";
254
255		status = "okay";
256
257		partitions {
258			compatible = "fixed-partitions";
259			#address-cells = <1>;
260			#size-cells = <1>;
261
262			store_partition: partition@000 {
263				label = "store";
264				reg = <0x00000000 DT_SIZE_M(8)>;
265			};
266		};
267	};
268};
269
270&dma1 {
271	status = "okay";
272};
273
274&dmamux1 {
275	status = "okay";
276};
277