From 1847426f325a6bb8c30bf5e8755257b128b2e2b9 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 27 Mar 2019 09:23:14 +0100 Subject: [PATCH] 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 --- dts/arm/st/wb/stm32wb.dtsi | 18 ++++++++++++++++++ soc/arm/st_stm32/stm32wb/dts_fixup.h | 18 ++++++++++++++++++ soc/arm/st_stm32/stm32wb/soc.h | 5 +++++ 3 files changed, 41 insertions(+) diff --git a/dts/arm/st/wb/stm32wb.dtsi b/dts/arm/st/wb/stm32wb.dtsi index 2723aad57b0..98cfaec5fa6 100644 --- a/dts/arm/st/wb/stm32wb.dtsi +++ b/dts/arm/st/wb/stm32wb.dtsi @@ -109,6 +109,24 @@ label = "GPIOH"; }; }; + + usart1: serial@40013800 { + compatible = "st,stm32-usart", "st,stm32-uart"; + reg = <0x40013800 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00004000>; + interrupts = <36 0>; + status = "disabled"; + label = "UART_1"; + }; + + lpuart1: serial@40008000 { + compatible = "st,stm32-lpuart", "st,stm32-uart"; + reg = <0x40008000 0x400>; + clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000001>; + interrupts = <37 0>; + status = "disabled"; + label = "LPUART_1"; + }; }; }; diff --git a/soc/arm/st_stm32/stm32wb/dts_fixup.h b/soc/arm/st_stm32/stm32wb/dts_fixup.h index c07a4e3dff1..660e3b8f0f2 100644 --- a/soc/arm/st_stm32/stm32wb/dts_fixup.h +++ b/soc/arm/st_stm32/stm32wb/dts_fixup.h @@ -62,4 +62,22 @@ #define DT_GPIO_STM32_GPIOH_CLOCK_BITS DT_ST_STM32_GPIO_48001C00_CLOCK_BITS #define DT_GPIO_STM32_GPIOH_CLOCK_BUS DT_ST_STM32_GPIO_48001C00_CLOCK_BUS +#define DT_UART_STM32_USART_1_BASE_ADDRESS DT_ST_STM32_USART_40013800_BASE_ADDRESS +#define DT_UART_STM32_USART_1_BAUD_RATE DT_ST_STM32_USART_40013800_CURRENT_SPEED +#define DT_UART_STM32_USART_1_IRQ_PRI DT_ST_STM32_USART_40013800_IRQ_0_PRIORITY +#define DT_UART_STM32_USART_1_NAME DT_ST_STM32_USART_40013800_LABEL +#define DT_USART_1_IRQ DT_ST_STM32_USART_40013800_IRQ_0 +#define DT_UART_STM32_USART_1_CLOCK_BITS DT_ST_STM32_USART_40013800_CLOCK_BITS +#define DT_UART_STM32_USART_1_CLOCK_BUS DT_ST_STM32_USART_40013800_CLOCK_BUS +#define DT_UART_STM32_USART_1_HW_FLOW_CONTROL DT_ST_STM32_USART_40013800_HW_FLOW_CONTROL + +#define DT_UART_STM32_LPUART_1_BASE_ADDRESS DT_ST_STM32_LPUART_40008000_BASE_ADDRESS +#define DT_UART_STM32_LPUART_1_BAUD_RATE DT_ST_STM32_LPUART_40008000_CURRENT_SPEED +#define DT_UART_STM32_LPUART_1_IRQ_PRI DT_ST_STM32_LPUART_40008000_IRQ_0_PRIORITY +#define DT_UART_STM32_LPUART_1_NAME DT_ST_STM32_LPUART_40008000_LABEL +#define DT_LPUART_1_IRQ DT_ST_STM32_LPUART_40008000_IRQ_0 +#define DT_UART_STM32_LPUART_1_CLOCK_BITS DT_ST_STM32_LPUART_40008000_CLOCK_BITS +#define DT_UART_STM32_LPUART_1_CLOCK_BUS DT_ST_STM32_LPUART_40008000_CLOCK_BUS +#define DT_UART_STM32_LPUART_1_HW_FLOW_CONTROL DT_ST_STM32_LPUART_40008000_HW_FLOW_CONTROL + /* End of SoC Level DTS fixup file */ diff --git a/soc/arm/st_stm32/stm32wb/soc.h b/soc/arm/st_stm32/stm32wb/soc.h index 3d1a98e9b5e..4be5e097e20 100644 --- a/soc/arm/st_stm32/stm32wb/soc.h +++ b/soc/arm/st_stm32/stm32wb/soc.h @@ -31,6 +31,11 @@ #include #endif +#ifdef CONFIG_SERIAL_HAS_DRIVER +#include +#include +#endif + #ifdef CONFIG_CLOCK_CONTROL_STM32_CUBE #include #include