aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2015-11-18 09:41:14 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-13 22:59:48 -0500
commit41788f054920d591c2d44838b73457e9d33ebd2c (patch)
tree2b3a032871706f8aa204bac2ed31fa343756662d /drivers/tty
parent88679739012cda64b1a45ee9dea16d04380dba71 (diff)
ARM: meson: serial: ensure console port uart enabled
Ensure the UART's transmitter is enabled when meson_console_putchar is called. If not, then the console output is corrupt (the hardware seems to try and send /something/ even if the TX is disabled). This fixes corrupt console output on events such as trying to reboot the system since the console tx may be called after drivers shutdown method has been called. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reported-by: Edward Cragg <edward.cragg@codethink.co.uk> Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/meson_uart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 54d1b9591b8d..c7bad2b5aa49 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -472,6 +472,7 @@ static void meson_serial_console_write(struct console *co, const char *s,
472 struct uart_port *port; 472 struct uart_port *port;
473 unsigned long flags; 473 unsigned long flags;
474 int locked; 474 int locked;
475 u32 val;
475 476
476 port = meson_ports[co->index]; 477 port = meson_ports[co->index];
477 if (!port) 478 if (!port)
@@ -487,6 +488,9 @@ static void meson_serial_console_write(struct console *co, const char *s,
487 locked = 1; 488 locked = 1;
488 } 489 }
489 490
491 val = readl(port->membase + AML_UART_CONTROL);
492 writel(val | AML_UART_TX_EN, port->membase + AML_UART_CONTROL);
493
490 uart_console_write(port, s, count, meson_console_putchar); 494 uart_console_write(port, s, count, meson_console_putchar);
491 495
492 if (locked) 496 if (locked)