1/*
2 * Copyright (c) 2023 Marcin Niestroj
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <seeed_studio/lora-e5.dtsi>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10
11/ {
12	model = "Seeed Studio LoRa-E5 mini";
13	compatible = "seeed,lora-e5-mini";
14
15	chosen {
16		zephyr,console = &usart1;
17		zephyr,shell-uart = &usart1;
18		zephyr,sram = &sram0;
19		zephyr,flash = &flash0;
20		zephyr,code-partition = &slot0_partition;
21	};
22
23	leds {
24		compatible = "gpio-leds";
25		red_led_1: led_1 {
26			gpios = <&gpiob 5 GPIO_ACTIVE_LOW>;
27			label = "User LED1";
28		};
29	};
30
31	gpio_keys {
32		compatible = "gpio-keys";
33		boot_button: button_0 {
34			label = "SW1";
35			gpios = <&gpiob 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
36			zephyr,code = <INPUT_KEY_0>;
37		};
38	};
39
40	aliases {
41		led0 = &red_led_1;
42		sw0 = &boot_button;
43		lora0 = &lora;
44		watchdog0 = &iwdg;
45	};
46};
47
48stm32_lp_tick_source: &lptim1 {
49	status = "okay";
50	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>,
51		 <&rcc STM32_SRC_LSI LPTIM1_SEL(1)>;
52};
53
54&clk_lsi {
55	status = "okay";
56};
57
58&clk_msi {
59	status = "okay";
60	msi-range = <11>;
61};
62
63&rcc {
64	clocks = <&clk_msi>;
65	clock-frequency = <DT_FREQ_M(48)>;
66	cpu1-prescaler = <1>;
67	ahb3-prescaler = <1>;
68	apb1-prescaler = <1>;
69	apb2-prescaler = <1>;
70};
71
72&usart1 {
73	pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
74	pinctrl-names = "default";
75	current-speed = <115200>;
76	status = "okay";
77};
78
79&i2c2 {
80	pinctrl-0 = <&i2c2_scl_pb15 &i2c2_sda_pa15>;
81	pinctrl-names = "default";
82	status = "okay";
83	clock-frequency = <I2C_BITRATE_FAST>;
84};
85
86&rtc {
87	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>,
88		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
89	status = "okay";
90};
91
92&iwdg {
93	status = "okay";
94};
95
96&aes {
97	status = "okay";
98};
99
100&flash0 {
101	partitions {
102		compatible = "fixed-partitions";
103		#address-cells = <1>;
104		#size-cells = <1>;
105
106		boot_partition: partition@0 {
107			label = "mcuboot";
108			reg = <0x00000000 DT_SIZE_K(48)>;
109		};
110		slot0_partition: partition@c000 {
111			label = "image-0";
112			reg = <0x0000c000 DT_SIZE_K(96)>;
113		};
114		slot1_partition: partition@24000 {
115			label = "image-1";
116			reg = <0x00024000 DT_SIZE_K(96)>;
117		};
118
119		/* 16KB (8x2kB pages) of storage at the end of the flash */
120		storage_partition: partition@3c000 {
121			label = "storage";
122			reg = <0x0003c000 DT_SIZE_K(16)>;
123		};
124	};
125};
126