diff mbox series

tty: serial: lpc32xx_hs: fix missing console boot messages

Message ID 20190115171814.21789-1-alexandre.belloni@bootlin.com (mailing list archive)
State Mainlined, archived
Commit b30fd1a6f6f2920e037fc659a015d0b76c604931
Headers show
Series tty: serial: lpc32xx_hs: fix missing console boot messages | expand

Commit Message

Alexandre Belloni Jan. 15, 2019, 5:18 p.m. UTC
When probing the HSUART, it is put in loopback mode in order to prevent a
potential issue that may happen on RX (Errata HSUART.1).

serial_lpc32xx_startup() moves it out of loopback mode but this is too late
to get the kernel boot messages before userspace opens the device.

Also get out of loopback mode in lpc32xx_hsuart_console_setup().

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/tty/serial/lpc32xx_hs.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Vladimir Zapolskiy Jan. 22, 2019, 10:38 p.m. UTC | #1
Hi Alexandre,

On 01/15/2019 07:18 PM, Alexandre Belloni wrote:
> When probing the HSUART, it is put in loopback mode in order to prevent a
> potential issue that may happen on RX (Errata HSUART.1).
> 
> serial_lpc32xx_startup() moves it out of loopback mode but this is too late
> to get the kernel boot messages before userspace opens the device.
> 
> Also get out of loopback mode in lpc32xx_hsuart_console_setup().
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

the change looks good, thank you.

Acked-by: Vladimir Zapolskiy <vz@mleia.com>

--
Best wishes,
Vladimir
diff mbox series

Patch

diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index d1d73261575b..f4e27d0ad947 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -151,6 +151,8 @@  static void lpc32xx_hsuart_console_write(struct console *co, const char *s,
 	local_irq_restore(flags);
 }
 
+static void lpc32xx_loopback_set(resource_size_t mapbase, int state);
+
 static int __init lpc32xx_hsuart_console_setup(struct console *co,
 					       char *options)
 {
@@ -170,6 +172,8 @@  static int __init lpc32xx_hsuart_console_setup(struct console *co,
 	if (options)
 		uart_parse_options(options, &baud, &parity, &bits, &flow);
 
+	lpc32xx_loopback_set(port->mapbase, 0); /* get out of loopback mode */
+
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }