aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Baozi <chenbaozi@phytium.com.cn>2021-07-19 15:36:04 +0800
committerTom Rini <trini@konsulko.com>2021-07-23 18:53:46 -0400
commit198201509a460c8f1b85e3447b35599129f4f885 (patch)
treee65ac8899e2458471f415e39c475ddb91bcab422
parent8f20c480799c54f2ff6ee9ef3d735c342bca8054 (diff)
downloadu-boot-198201509a460c8f1b85e3447b35599129f4f885.zip
u-boot-198201509a460c8f1b85e3447b35599129f4f885.tar.gz
u-boot-198201509a460c8f1b85e3447b35599129f4f885.tar.bz2
serial: pl011: Resend the character if FIFO is full in debug uart
pl01x_putc() might return -EAGAIN if there was no space in FIFO. In that case, high-level caller should wait until there is space and resend the character. Signed-off-by: Chen Baozi <chenbaozi@phytium.com.cn> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/serial/serial_pl01x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index 76b96ad..8ff19ac 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -417,7 +417,8 @@ static inline void _debug_uart_putc(int ch)
{
struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE;
- pl01x_putc(regs, ch);
+ while (pl01x_putc(regs, ch) == -EAGAIN)
+ ;
}
DEBUG_UART_FUNCS