Skip to content
Permalink
Browse files

drivers/serial: stm32: Add support for STM32H7 series

Add needful to enable uart on STM32H7.
This mostly impact dts but as well soc for fixup.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
  • Loading branch information...
erwango authored and nashif committed Jul 1, 2019
1 parent d185ec4 commit fda2ea7253fe149d2d71b192ceebb9f1e0424c4d
@@ -97,7 +97,7 @@ config UART_10
Enable support for UART10 port in the driver.
Say y here if you want to use UART10 device.

if SOC_SERIES_STM32L0X || SOC_SERIES_STM32L4X || SOC_SERIES_STM32WBX
if SOC_SERIES_STM32L0X || SOC_SERIES_STM32L4X || SOC_SERIES_STM32WBX || SOC_SERIES_STM32H7X

# --- low power port 1 ---

@@ -815,7 +815,8 @@ STM32_UART_INIT(UART_10)

#endif

#if defined(CONFIG_SOC_SERIES_STM32L4X) || \
#if defined(CONFIG_SOC_SERIES_STM32H7X) || \
defined(CONFIG_SOC_SERIES_STM32L4X) || \
defined(CONFIG_SOC_SERIES_STM32L0X) || \
defined(CONFIG_SOC_SERIES_STM32WBX)
#ifdef CONFIG_LPUART_1
@@ -156,6 +156,71 @@
label = "GPIOK";
};
};

usart1: serial@40011000 {
compatible = "st,stm32-usart", "st,stm32-uart";
reg = <0x40011000 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000010>;
interrupts = <37 0>;
status = "disabled";
label = "UART_1";
};
usart2: serial@40004400 {
compatible = "st,stm32-usart", "st,stm32-uart";
reg = <0x40004400 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>;
interrupts = <38 0>;
status = "disabled";
label = "UART_2";
};
usart3: serial@40004800 {
compatible = "st,stm32-usart", "st,stm32-uart";
reg = <0x40004800 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>;
interrupts = <39 0>;
status = "disabled";
label = "UART_3";
};
uart4: serial@40004c00 {
compatible ="st,stm32-uart";
reg = <0x40004c00 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00080000>;
interrupts = <52 0>;
status = "disabled";
label = "UART_4";
};
uart5: serial@40005000 {
compatible = "st,stm32-uart";
reg = <0x40005000 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00100000>;
interrupts = <53 0>;
status = "disabled";
label = "UART_5";
};
usart6: serial@40011400 {
compatible = "st,stm32-usart", "st,stm32-uart";
reg = <0x40011400 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB2 0x00000020>;
interrupts = <71 0>;
status = "disabled";
label = "UART_6";
};
uart7: serial@40007800 {
compatible = "st,stm32-uart";
reg = <0x40007800 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x40000000>;
interrupts = <82 0>;
status = "disabled";
label = "UART_7";
};
uart8: serial@40007c00 {
compatible = "st,stm32-uart";
reg = <0x40007c00 0x400>;
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x80000000>;
interrupts = <83 0>;
status = "disabled";
label = "UART_8";
};
};
};

@@ -108,4 +108,77 @@
#define DT_GPIO_STM32_GPIOK_SIZE DT_ST_STM32_GPIO_58022800_SIZE
#define DT_GPIO_STM32_GPIOK_CLOCK_BITS DT_ST_STM32_GPIO_58022800_CLOCK_BITS
#define DT_GPIO_STM32_GPIOK_CLOCK_BUS DT_ST_STM32_GPIO_58022800_CLOCK_BUS

#define DT_UART_STM32_USART_1_BASE_ADDRESS DT_ST_STM32_USART_40011000_BASE_ADDRESS
#define DT_UART_STM32_USART_1_BAUD_RATE DT_ST_STM32_USART_40011000_CURRENT_SPEED
#define DT_UART_STM32_USART_1_IRQ_PRI DT_ST_STM32_USART_40011000_IRQ_0_PRIORITY
#define DT_UART_STM32_USART_1_NAME DT_ST_STM32_USART_40011000_LABEL
#define DT_USART_1_IRQ DT_ST_STM32_USART_40011000_IRQ_0
#define DT_UART_STM32_USART_1_CLOCK_BITS DT_ST_STM32_USART_40011000_CLOCK_BITS
#define DT_UART_STM32_USART_1_CLOCK_BUS DT_ST_STM32_USART_40011000_CLOCK_BUS
#define DT_UART_STM32_USART_1_HW_FLOW_CONTROL DT_ST_STM32_USART_40011000_HW_FLOW_CONTROL

#define DT_UART_STM32_USART_2_BASE_ADDRESS DT_ST_STM32_USART_40004400_BASE_ADDRESS
#define DT_UART_STM32_USART_2_BAUD_RATE DT_ST_STM32_USART_40004400_CURRENT_SPEED
#define DT_UART_STM32_USART_2_IRQ_PRI DT_ST_STM32_USART_40004400_IRQ_0_PRIORITY
#define DT_UART_STM32_USART_2_NAME DT_ST_STM32_USART_40004400_LABEL
#define DT_USART_2_IRQ DT_ST_STM32_USART_40004400_IRQ_0
#define DT_UART_STM32_USART_2_CLOCK_BITS DT_ST_STM32_USART_40004400_CLOCK_BITS
#define DT_UART_STM32_USART_2_CLOCK_BUS DT_ST_STM32_USART_40004400_CLOCK_BUS
#define DT_UART_STM32_USART_2_HW_FLOW_CONTROL DT_ST_STM32_USART_40004400_HW_FLOW_CONTROL

#define DT_UART_STM32_USART_3_BASE_ADDRESS DT_ST_STM32_USART_40004800_BASE_ADDRESS
#define DT_UART_STM32_USART_3_BAUD_RATE DT_ST_STM32_USART_40004800_CURRENT_SPEED
#define DT_UART_STM32_USART_3_IRQ_PRI DT_ST_STM32_USART_40004800_IRQ_0_PRIORITY
#define DT_UART_STM32_USART_3_NAME DT_ST_STM32_USART_40004800_LABEL
#define DT_USART_3_IRQ DT_ST_STM32_USART_40004800_IRQ_0
#define DT_UART_STM32_USART_3_CLOCK_BITS DT_ST_STM32_USART_40004800_CLOCK_BITS
#define DT_UART_STM32_USART_3_CLOCK_BUS DT_ST_STM32_USART_40004800_CLOCK_BUS
#define DT_UART_STM32_USART_3_HW_FLOW_CONTROL DT_ST_STM32_USART_40004800_HW_FLOW_CONTROL

#define DT_UART_STM32_UART_4_BASE_ADDRESS DT_ST_STM32_UART_40004C00_BASE_ADDRESS
#define DT_UART_STM32_UART_4_BAUD_RATE DT_ST_STM32_UART_40004C00_CURRENT_SPEED
#define DT_UART_STM32_UART_4_IRQ_PRI DT_ST_STM32_UART_40004C00_IRQ_0_PRIORITY
#define DT_UART_STM32_UART_4_NAME DT_ST_STM32_UART_40004C00_LABEL
#define DT_UART_4_IRQ DT_ST_STM32_UART_40004C00_IRQ_0
#define DT_UART_STM32_UART_4_CLOCK_BITS DT_ST_STM32_UART_40004C00_CLOCK_BITS
#define DT_UART_STM32_UART_4_CLOCK_BUS DT_ST_STM32_UART_40004C00_CLOCK_BUS
#define DT_UART_STM32_UART_4_HW_FLOW_CONTROL DT_ST_STM32_UART_40004C00_HW_FLOW_CONTROL

#define DT_UART_STM32_UART_5_BASE_ADDRESS DT_ST_STM32_UART_40005000_BASE_ADDRESS
#define DT_UART_STM32_UART_5_BAUD_RATE DT_ST_STM32_UART_40005000_CURRENT_SPEED
#define DT_UART_STM32_UART_5_IRQ_PRI DT_ST_STM32_UART_40005000_IRQ_0_PRIORITY
#define DT_UART_STM32_UART_5_NAME DT_ST_STM32_UART_40005000_LABEL
#define DT_UART_5_IRQ DT_ST_STM32_UART_40005000_IRQ_0
#define DT_UART_STM32_UART_5_CLOCK_BITS DT_ST_STM32_UART_40005000_CLOCK_BITS
#define DT_UART_STM32_UART_5_CLOCK_BUS DT_ST_STM32_UART_40005000_CLOCK_BUS
#define DT_UART_STM32_UART_5_HW_FLOW_CONTROL DT_ST_STM32_UART_40005000_HW_FLOW_CONTROL

#define DT_UART_STM32_USART_6_BASE_ADDRESS DT_ST_STM32_USART_40011400_BASE_ADDRESS
#define DT_UART_STM32_USART_6_BAUD_RATE DT_ST_STM32_USART_40011400_CURRENT_SPEED
#define DT_UART_STM32_USART_6_IRQ_PRI DT_ST_STM32_USART_40011400_IRQ_0_PRIORITY
#define DT_UART_STM32_USART_6_NAME DT_ST_STM32_USART_40011400_LABEL
#define DT_USART_6_IRQ DT_ST_STM32_USART_40011400_IRQ_0
#define DT_UART_STM32_USART_6_CLOCK_BITS DT_ST_STM32_USART_40011400_CLOCK_BITS
#define DT_UART_STM32_USART_6_CLOCK_BUS DT_ST_STM32_USART_40011400_CLOCK_BUS
#define DT_UART_STM32_USART_6_HW_FLOW_CONTROL DT_ST_STM32_USART_40011400_HW_FLOW_CONTROL

#define DT_UART_STM32_UART_7_BASE_ADDRESS DT_ST_STM32_UART_40007800_BASE_ADDRESS
#define DT_UART_STM32_UART_7_BAUD_RATE DT_ST_STM32_UART_40007800_CURRENT_SPEED
#define DT_UART_STM32_UART_7_IRQ_PRI DT_ST_STM32_UART_40007800_IRQ_0_PRIORITY
#define DT_UART_STM32_UART_7_NAME DT_ST_STM32_UART_40007800_LABEL
#define DT_UART_7_IRQ DT_ST_STM32_UART_40007800_IRQ_0
#define DT_UART_STM32_UART_7_CLOCK_BITS DT_ST_STM32_UART_40007800_CLOCK_BITS
#define DT_UART_STM32_UART_7_CLOCK_BUS DT_ST_STM32_UART_40007800_CLOCK_BUS
#define DT_UART_STM32_UART_7_HW_FLOW_CONTROL DT_ST_STM32_UART_40007800_HW_FLOW_CONTROL

#define DT_UART_STM32_UART_8_BASE_ADDRESS DT_ST_STM32_UART_40007C00_BASE_ADDRESS
#define DT_UART_STM32_UART_8_BAUD_RATE DT_ST_STM32_UART_40007C00_CURRENT_SPEED
#define DT_UART_STM32_UART_8_IRQ_PRI DT_ST_STM32_UART_40007C00_IRQ_0_PRIORITY
#define DT_UART_STM32_UART_8_NAME DT_ST_STM32_UART_40007C00_LABEL
#define DT_UART_8_IRQ DT_ST_STM32_UART_40007C00_IRQ_0
#define DT_UART_STM32_UART_8_CLOCK_BITS DT_ST_STM32_UART_40007C00_CLOCK_BITS
#define DT_UART_STM32_UART_8_CLOCK_BUS DT_ST_STM32_UART_40007C00_CLOCK_BUS
#define DT_UART_STM32_UART_8_HW_FLOW_CONTROL DT_ST_STM32_UART_40007C00_HW_FLOW_CONTROL

/* End of SoC Level DTS fixup file */
@@ -33,6 +33,10 @@
#include <stm32h7xx_ll_system.h>
#endif /* CONFIG_GPIO_STM32 */

#ifdef CONFIG_SERIAL_HAS_DRIVER
#include <stm32h7xx_ll_usart.h>
#endif /* CONFIG_SERIAL_HAS_DRIVER */

#endif /* !_ASMLANGUAGE */

#endif /* _STM32F7_SOC_H7_ */

0 comments on commit fda2ea7

Please sign in to comment.
You can’t perform that action at this time.