Skip to content

Commit

Permalink
serial: mpc52xx: add delay after resetting transmitter to fix broken …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Oct 4, 2015
1 parent 0b1dd99 commit e4b4e31
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/tty/serial/mpc52xx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e4b4e31

Please sign in to comment.