diff options
Diffstat (limited to 'drivers/serial/serial_pl01x.c')
| -rw-r--r-- | drivers/serial/serial_pl01x.c | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 7a064ffb2..ed581ae22 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -194,7 +194,17 @@ int serial_tstc (void)  void serial_setbrg (void)  { +	struct pl01x_regs *regs = pl01x_get_regs(CONSOLE_PORT); +  	baudrate = gd->baudrate; +	/* +	 * Flush FIFO and wait for non-busy before changing baudrate to avoid +	 * crap in console +	 */ +	while (!(readl(®s->fr) & UART_PL01x_FR_TXFE)) +		WATCHDOG_RESET(); +	while (readl(®s->fr) & UART_PL01x_FR_BUSY) +		WATCHDOG_RESET();  	serial_init();  } |