Skip to content

Commit 1847426

Browse files
erwangogalak
authored andcommitted
dts/arm/st: Add serial nodes on stm32wb
Add USART1 and LPUART1 nodes on stm32wb series. Only these 2 ones are available for now on this series. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent eb51ea0 commit 1847426

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

dts/arm/st/wb/stm32wb.dtsi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,24 @@
109109
label = "GPIOH";
110110
};
111111
};
112+
113+
usart1: serial@40013800 {
114+
compatible = "st,stm32-usart", "st,stm32-uart";
115+
reg = <0x40013800 0x400>;
116+
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>;
117+
interrupts = <36 0>;
118+
status = "disabled";
119+
label = "UART_1";
120+
};
121+
122+
lpuart1: serial@40008000 {
123+
compatible = "st,stm32-lpuart", "st,stm32-uart";
124+
reg = <0x40008000 0x400>;
125+
clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000001>;
126+
interrupts = <37 0>;
127+
status = "disabled";
128+
label = "LPUART_1";
129+
};
112130
};
113131
};
114132

soc/arm/st_stm32/stm32wb/dts_fixup.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,22 @@
6262
#define DT_GPIO_STM32_GPIOH_CLOCK_BITS DT_ST_STM32_GPIO_48001C00_CLOCK_BITS
6363
#define DT_GPIO_STM32_GPIOH_CLOCK_BUS DT_ST_STM32_GPIO_48001C00_CLOCK_BUS
6464

65+
#define DT_UART_STM32_USART_1_BASE_ADDRESS DT_ST_STM32_USART_40013800_BASE_ADDRESS
66+
#define DT_UART_STM32_USART_1_BAUD_RATE DT_ST_STM32_USART_40013800_CURRENT_SPEED
67+
#define DT_UART_STM32_USART_1_IRQ_PRI DT_ST_STM32_USART_40013800_IRQ_0_PRIORITY
68+
#define DT_UART_STM32_USART_1_NAME DT_ST_STM32_USART_40013800_LABEL
69+
#define DT_USART_1_IRQ DT_ST_STM32_USART_40013800_IRQ_0
70+
#define DT_UART_STM32_USART_1_CLOCK_BITS DT_ST_STM32_USART_40013800_CLOCK_BITS
71+
#define DT_UART_STM32_USART_1_CLOCK_BUS DT_ST_STM32_USART_40013800_CLOCK_BUS
72+
#define DT_UART_STM32_USART_1_HW_FLOW_CONTROL DT_ST_STM32_USART_40013800_HW_FLOW_CONTROL
73+
74+
#define DT_UART_STM32_LPUART_1_BASE_ADDRESS DT_ST_STM32_LPUART_40008000_BASE_ADDRESS
75+
#define DT_UART_STM32_LPUART_1_BAUD_RATE DT_ST_STM32_LPUART_40008000_CURRENT_SPEED
76+
#define DT_UART_STM32_LPUART_1_IRQ_PRI DT_ST_STM32_LPUART_40008000_IRQ_0_PRIORITY
77+
#define DT_UART_STM32_LPUART_1_NAME DT_ST_STM32_LPUART_40008000_LABEL
78+
#define DT_LPUART_1_IRQ DT_ST_STM32_LPUART_40008000_IRQ_0
79+
#define DT_UART_STM32_LPUART_1_CLOCK_BITS DT_ST_STM32_LPUART_40008000_CLOCK_BITS
80+
#define DT_UART_STM32_LPUART_1_CLOCK_BUS DT_ST_STM32_LPUART_40008000_CLOCK_BUS
81+
#define DT_UART_STM32_LPUART_1_HW_FLOW_CONTROL DT_ST_STM32_LPUART_40008000_HW_FLOW_CONTROL
82+
6583
/* End of SoC Level DTS fixup file */

soc/arm/st_stm32/stm32wb/soc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
#include <stm32wbxx_ll_gpio.h>
3232
#endif
3333

34+
#ifdef CONFIG_SERIAL_HAS_DRIVER
35+
#include <stm32wbxx_ll_usart.h>
36+
#include <stm32wbxx_ll_lpuart.h>
37+
#endif
38+
3439
#ifdef CONFIG_CLOCK_CONTROL_STM32_CUBE
3540
#include <stm32wbxx_ll_utils.h>
3641
#include <stm32wbxx_ll_bus.h>

0 commit comments

Comments
 (0)