bsps/zynq-uart: Make post baud change kick global

The existing fix for the ZynqMP UART hardware bug only caught the vast
majority of instances where it could occur. To fully fix the data
corruption, this fix must be applied after every baud rate change. This
makes the logic reset and kick apply in any locations where the baud
rate could be changed.
This commit is contained in:
Kinsey Moore
2021-06-23 11:57:18 -05:00
committed by Joel Sherrill
parent 4515ccf241
commit 26d61c8670
3 changed files with 14 additions and 5 deletions

View File

@@ -144,6 +144,12 @@ void zynq_uart_initialize(rtems_termios_device_context *base)
regs->control = ZYNQ_UART_CONTROL_RXEN
| ZYNQ_UART_CONTROL_TXEN
| ZYNQ_UART_CONTROL_RSTTO;
/*
* Some ZynqMP UARTs have a hardware bug that causes TX/RX logic restarts to
* require a kick after baud rate registers are initialized.
*/
zynq_uart_write_polled(base, 0);
}
int zynq_uart_read_polled(rtems_termios_device_context *base)

View File

@@ -214,9 +214,17 @@ static bool zynq_uart_set_attributes(
if (baud > 0) {
regs->baud_rate_gen = ZYNQ_UART_BAUD_RATE_GEN_CD(brgr);
regs->baud_rate_div = ZYNQ_UART_BAUD_RATE_DIV_BDIV(bauddiv);
regs->control |= ZYNQ_UART_CONTROL_RXRES
| ZYNQ_UART_CONTROL_TXRES;
}
regs->control |= ZYNQ_UART_CONTROL_RXEN | ZYNQ_UART_CONTROL_TXEN;
/*
* Some ZynqMP UARTs have a hardware bug that causes TX/RX logic restarts to
* require a kick after baud rate registers are initialized.
*/
zynq_uart_write_polled(context, 0);
return true;
}