diff options
author | Tom Rini <trini@konsulko.com> | 2021-12-21 01:12:04 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-12-21 01:12:04 +0300 |
commit | 4afab30caea3211032710c4298a8839d3254e7f7 (patch) | |
tree | 8318afb8810966aca9fe356dde316c155b7a33ce /drivers/serial/serial_mvebu_a3700.c | |
parent | e9d7888da845638f135046d53c25492a8c54e664 (diff) | |
parent | 734ad933766f0dbbeafe1b27211686940a5e6d16 (diff) | |
download | u-boot-4afab30caea3211032710c4298a8839d3254e7f7.tar.xz |
Merge tag 'v2022.01-rc4' into next
Prepare v2022.01-rc4
Diffstat (limited to 'drivers/serial/serial_mvebu_a3700.c')
-rw-r--r-- | drivers/serial/serial_mvebu_a3700.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/serial/serial_mvebu_a3700.c b/drivers/serial/serial_mvebu_a3700.c index 8c3c10c667..3e673bde57 100644 --- a/drivers/serial/serial_mvebu_a3700.c +++ b/drivers/serial/serial_mvebu_a3700.c @@ -10,6 +10,7 @@ #include <serial.h> #include <asm/io.h> #include <asm/arch/cpu.h> +#include <mach/soc.h> struct mvebu_plat { void __iomem *base; @@ -214,6 +215,7 @@ static int mvebu_serial_remove(struct udevice *dev) u32 new_oversampling; u32 oversampling; u32 d1, d2; + u32 nb_rst; /* * Switch UART base clock back to XTAL because older Linux kernel @@ -261,12 +263,22 @@ static int mvebu_serial_remove(struct udevice *dev) return 0; } + /* wait until TX empty */ while (!(readl(base + UART_STATUS_REG) & UART_STATUS_TX_EMPTY)) ; + /* external reset of UART via North Bridge Peripheral */ + nb_rst = readl(MVEBU_REGISTER(0x12400)); + writel(nb_rst & ~BIT(3), MVEBU_REGISTER(0x12400)); + writel(nb_rst | BIT(3), MVEBU_REGISTER(0x12400)); + + /* set baudrate and oversampling */ writel(new_divider, base + UART_BAUD_REG); writel(new_oversampling, base + UART_POSSR_REG); + /* No Parity, 1 Stop */ + writel(0, base + UART_CTRL_REG); + return 0; } @@ -306,7 +318,6 @@ U_BOOT_DRIVER(serial_mvebu) = { #ifdef CONFIG_DEBUG_MVEBU_A3700_UART #include <debug_uart.h> -#include <mach/soc.h> static inline void _debug_uart_init(void) { |