summaryrefslogtreecommitdiffstats
path: root/bsps/shared/dev/serial/zynq-uart.c
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2021-06-23 11:57:18 -0500
committerJoel Sherrill <joel@rtems.org>2021-06-29 11:42:06 -0500
commit26d61c867077e0b529f7ab301188101e7352022d (patch)
tree0551cb76c8b5f4713d4fb9624e791252405a1c6e /bsps/shared/dev/serial/zynq-uart.c
parentspec/aarch64: fix abi flags for xilinx_versal_ilp32_vck190 (diff)
downloadrtems-26d61c867077e0b529f7ab301188101e7352022d.tar.bz2
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.
Diffstat (limited to 'bsps/shared/dev/serial/zynq-uart.c')
-rw-r--r--bsps/shared/dev/serial/zynq-uart.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bsps/shared/dev/serial/zynq-uart.c b/bsps/shared/dev/serial/zynq-uart.c
index cd0d0e7584..8503e31d49 100644
--- a/bsps/shared/dev/serial/zynq-uart.c
+++ b/bsps/shared/dev/serial/zynq-uart.c
@@ -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;
}