OSDN Git Service

serial: mvebu-uart: add soft reset at probe
authorAllen Yan <yanwei@marvell.com>
Fri, 13 Oct 2017 09:01:50 +0000 (11:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Oct 2017 12:20:06 +0000 (14:20 +0200)
The existing UART driver relies on the bootloader to initialize the
port(s). However, the secondary uart port may not be initialized
properly in early boot stage. This patch adds the UART soft reset when
probing, for all ports.

Signed-off-by: Allen Yan <yanwei@marvell.com>
Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mvebu-uart.c

index 900fe85..e233f46 100644 (file)
@@ -660,6 +660,11 @@ static int mvebu_uart_probe(struct platform_device *pdev)
        port->private_data = mvuart;
        platform_set_drvdata(pdev, mvuart);
 
+       /* UART Soft Reset*/
+       writel(CTRL_SOFT_RST, port->membase + UART_CTRL(port));
+       udelay(1);
+       writel(0, port->membase + UART_CTRL(port));
+
        ret = uart_add_one_port(&mvebu_uart_driver, port);
        if (ret)
                return ret;