mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-29 22:51:49 +01:00
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>
This commit is contained in:
parent
60a996bacb
commit
2a7ecc5360
@ -117,6 +117,8 @@ static int stm32_serial_probe(struct udevice *dev)
|
|||||||
BIT(uart_enable_bit));
|
BIT(uart_enable_bit));
|
||||||
if (plat->uart_info->has_overrun_disable)
|
if (plat->uart_info->has_overrun_disable)
|
||||||
setbits_le32(base + CR3_OFFSET(stm32f4), USART_CR3_OVRDIS);
|
setbits_le32(base + CR3_OFFSET(stm32f4), USART_CR3_OVRDIS);
|
||||||
|
if (plat->uart_info->has_fifo)
|
||||||
|
setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_FIFOEN);
|
||||||
setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_RE | USART_CR1_TE |
|
setbits_le32(base + CR1_OFFSET(stm32f4), USART_CR1_RE | USART_CR1_TE |
|
||||||
BIT(uart_enable_bit));
|
BIT(uart_enable_bit));
|
||||||
|
|
||||||
@ -125,8 +127,8 @@ static int stm32_serial_probe(struct udevice *dev)
|
|||||||
|
|
||||||
#if CONFIG_IS_ENABLED(OF_CONTROL)
|
#if CONFIG_IS_ENABLED(OF_CONTROL)
|
||||||
static const struct udevice_id stm32_serial_id[] = {
|
static const struct udevice_id stm32_serial_id[] = {
|
||||||
{ .compatible = "st,stm32f7-uart", .data = (ulong)&stm32x7_info},
|
{ .compatible = "st,stm32f7-uart", .data = (ulong)&stm32f7_info},
|
||||||
{ .compatible = "st,stm32h7-uart", .data = (ulong)&stm32x7_info},
|
{ .compatible = "st,stm32h7-uart", .data = (ulong)&stm32h7_info},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -24,12 +24,21 @@ struct stm32_uart_info {
|
|||||||
u8 uart_enable_bit; /* UART_CR1_UE */
|
u8 uart_enable_bit; /* UART_CR1_UE */
|
||||||
bool stm32f4; /* true for STM32F4, false otherwise */
|
bool stm32f4; /* true for STM32F4, false otherwise */
|
||||||
bool has_overrun_disable;
|
bool has_overrun_disable;
|
||||||
|
bool has_fifo;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct stm32_uart_info stm32x7_info = {
|
struct stm32_uart_info stm32f7_info = {
|
||||||
.uart_enable_bit = 0,
|
.uart_enable_bit = 0,
|
||||||
.stm32f4 = false,
|
.stm32f4 = false,
|
||||||
.has_overrun_disable = true,
|
.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 */
|
/* Information about a serial port */
|
||||||
@ -39,6 +48,7 @@ struct stm32x7_serial_platdata {
|
|||||||
unsigned long int clock_rate;
|
unsigned long int clock_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define USART_CR1_FIFOEN BIT(29)
|
||||||
#define USART_CR1_OVER8 BIT(15)
|
#define USART_CR1_OVER8 BIT(15)
|
||||||
#define USART_CR1_TE BIT(3)
|
#define USART_CR1_TE BIT(3)
|
||||||
#define USART_CR1_RE BIT(2)
|
#define USART_CR1_RE BIT(2)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user