summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/mpc52xx_uart.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2015-09-24 21:18:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 18:27:56 +0200
commite4b4e3176f4dc1c3bb13aab54982381c5cf10217 (patch)
tree9e04c7c0d2777fa1622e94a6bbdf149d04ed89bb /drivers/tty/serial/mpc52xx_uart.c
parentdrivers/tty: make serial 8250_lpc18xx.c Kconfig a tristate (diff)
downloadlinux-e4b4e3176f4dc1c3bb13aab54982381c5cf10217.tar.xz
linux-e4b4e3176f4dc1c3bb13aab54982381c5cf10217.zip
serial: mpc52xx: add delay after resetting transmitter to fix broken chars
This fixes receiving broken characters on the console from an MPC5125 system when systemd comes up which repeatedly opens and shuts down the console device. Trial and error with the needed interval showed that 500 us are good enough most of the time when using 38400 Bd, so I think 1 ms is a good compromise between fixing the issue and not penalize faster setups too much. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/mpc52xx_uart.c')
-rw-r--r--drivers/tty/serial/mpc52xx_uart.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c
index 41de374d9784..8c3e51314470 100644
--- a/drivers/tty/serial/mpc52xx_uart.c
+++ b/drivers/tty/serial/mpc52xx_uart.c
@@ -1135,6 +1135,13 @@ mpc52xx_uart_startup(struct uart_port *port)
psc_ops->command(port, MPC52xx_PSC_RST_RX);
psc_ops->command(port, MPC52xx_PSC_RST_TX);
+ /*
+ * According to Freescale's support the RST_TX command can produce a
+ * spike on the TX pin. So they recommend to delay "for one character".
+ * One millisecond should be enough for everyone.
+ */
+ msleep(1);
+
psc_ops->set_sicr(port, 0); /* UART mode DCD ignored */
psc_ops->fifo_init(port);