summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLoic Poulain <[email protected]>2023-01-12 18:19:51 +0100
committerStefano Babic <[email protected]>2023-01-30 23:23:02 +0100
commitad725073d1666d94a96fbf9cba03777c3d58de24 (patch)
tree0521c3d7fe69748fc989894d037d1689b68231ba /drivers
parent7150f56a85fd8d3b8ad162621026b0ba7bb6a367 (diff)
serial: mxc: Speed-up character transmission
Instead of waiting for empty FIFO condition before writing a character, wait for non-full FIFO condition. This helps in saving several tens of milliseconds during boot (depending verbosity). Signed-off-by: Loic Poulain <[email protected]> Tested-by: Lothar Waßmann <[email protected]> Acked-by: Pali Rohár <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Tested-by: Fabio Estevam <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_mxc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
index e4ffa9c3f6b..cc85a502726 100644
--- a/drivers/serial/serial_mxc.c
+++ b/drivers/serial/serial_mxc.c
@@ -240,11 +240,11 @@ static void mxc_serial_putc(const char c)
if (c == '\n')
serial_putc('\r');
- writel(c, &mxc_base->txd);
-
/* wait for transmitter to be ready */
- while (!(readl(&mxc_base->ts) & UTS_TXEMPTY))
+ while (readl(&mxc_base->ts) & UTS_TXFULL)
schedule();
+
+ writel(c, &mxc_base->txd);
}
/* Test whether a character is in the RX buffer */
@@ -335,7 +335,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);