serial: stm32x7: add fifo support for STM32H7
Add fifo mode support for rx and tx.
As only STM32H7 supports this feature, add has_fifo flag
to uart configuration to use fifo only when possible.
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
diff --git a/drivers/serial/serial_stm32x7.h b/drivers/serial/serial_stm32x7.h
index 4c6b7d4..ed8a3ee 100644
--- a/drivers/serial/serial_stm32x7.h
+++ b/drivers/serial/serial_stm32x7.h
@@ -24,14 +24,23 @@
u8 uart_enable_bit; /* UART_CR1_UE */
bool stm32f4; /* true for STM32F4, false otherwise */
bool has_overrun_disable;
+ bool has_fifo;
};
-struct stm32_uart_info stm32x7_info = {
+struct stm32_uart_info stm32f7_info = {
.uart_enable_bit = 0,
.stm32f4 = false,
.has_overrun_disable = true,
+ .has_fifo = false,
};
+struct stm32_uart_info stm32h7_info = {
+ .uart_enable_bit = 0,
+ .stm32f4 = false,
+ .has_overrun_disable = true,
+ .has_fifo = true,
+};
+
/* Information about a serial port */
struct stm32x7_serial_platdata {
fdt_addr_t base; /* address of registers in physical memory */
@@ -39,6 +48,7 @@
unsigned long int clock_rate;
};
+#define USART_CR1_FIFOEN BIT(29)
#define USART_CR1_OVER8 BIT(15)
#define USART_CR1_TE BIT(3)
#define USART_CR1_RE BIT(2)