diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-04-12 14:41:43 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-04-16 09:58:09 +0200 |
commit | 46b940ddf837aa118bd514fa35e7ca6e7a5339a3 (patch) | |
tree | 045bcd0e2ade78c4fcc07bdaa9d0b2e361b46cd4 /include | |
parent | 567050a8c516d88e0047ba30c12d36d02ec89bc1 (diff) | |
download | barebox-46b940ddf837aa118bd514fa35e7ca6e7a5339a3.tar.gz barebox-46b940ddf837aa118bd514fa35e7ca6e7a5339a3.tar.xz |
serial/lpuart: Do not enable UART FIFO
Using FIFO in LPUART results in subtle serial input draining issues
which are quite difficult to reproduce and troubleshoot. Since the
change offered only moderate performance gain revert the code to
operate in no-FIFO mode to avoid FIFO-related problems alltogether.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/serial/lpuart.h | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/include/serial/lpuart.h b/include/serial/lpuart.h index 917f644a59..a920291dec 100644 --- a/include/serial/lpuart.h +++ b/include/serial/lpuart.h @@ -238,22 +238,17 @@ static inline void lpuart_setbrg(void __iomem *base, writeb(bfra, base + UARTCR4); } -static inline void lpuart_setup_with_fifo(void __iomem *base, - unsigned int refclock, - unsigned int twfifo) +static inline void lpuart_setup(void __iomem *base, + unsigned int refclock) { /* Disable UART */ writeb(0, base + UARTCR2); writeb(0, base + UARTMODEM); writeb(0, base + UARTCR1); - if (twfifo) { - writeb(UARTPFIFO_TXFE | UARTPFIFO_RXFE, base + UARTPFIFO); - writeb((u8)twfifo, base + UARTTWFIFO); - } else { - writeb(0, base + UARTPFIFO); - writeb(0, base + UARTTWFIFO); - } + writeb(0, base + UARTPFIFO); + writeb(0, base + UARTTWFIFO); + writeb(1, base + UARTRWFIFO); writeb(UARTCFIFO_RXFLUSH | UARTCFIFO_TXFLUSH, base + UARTCFIFO); @@ -262,12 +257,6 @@ static inline void lpuart_setup_with_fifo(void __iomem *base, writeb(UARTCR2_TE | UARTCR2_RE, base + UARTCR2); } -static inline void lpuart_setup(void __iomem *base, - unsigned int refclock) -{ - lpuart_setup_with_fifo(base, refclock, 0x00); -} - static inline void lpuart_putc(void __iomem *base, int c) { if (!(readb(base + UARTCR2) & UARTCR2_TE)) |