From: Johannes Schneider Date: Tue, 6 Sep 2022 12:15:04 +0000 (+0200) Subject: serial: mxc: have putc use the TXFIFO X-Git-Tag: v2022.10~14^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7878a0483c59c48a730123bc0f4659fd40921bf;p=platform%2Fkernel%2Fu-boot.git serial: mxc: have putc use the TXFIFO only waiting for TXEMPTY leads to corrupted messages going over the wire - which is fixed by making use of the FIFO this change is following the linux kernel uart driver (drivers/tty/serial/imx.c), which also checks UTS_TXFULL instead of UTS_TXEMPTY Signed-off-by: Johannes Schneider Reviewed-by: Peng Fan Reviewed-by: Fabio Estevam --- diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index ee17a96..af1fd1e 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -311,7 +311,7 @@ static int mxc_serial_putc(struct udevice *dev, const char ch) struct mxc_serial_plat *plat = dev_get_plat(dev); struct mxc_uart *const uart = plat->reg; - if (!(readl(&uart->ts) & UTS_TXEMPTY)) + if (readl(&uart->ts) & UTS_TXFULL) return -EAGAIN; writel(ch, &uart->txd);