[PATCH v3 2/2] serial: mxc: have putc use the TXFIFO

Peng Fan peng.fan at oss.nxp.com
Tue Sep 6 14:04:17 CEST 2022



On 9/6/2022 1:39 PM, Johannes Schneider wrote:
> 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 <johannes.schneider at leica-geosystems.com>
> Reviewed-by: Peng Fan <peng.fan at oss.nxp.com>

Reviewed-by: Peng Fan <peng.fan at nxp.com>

> ---
> 
> (no changes since v1)
> 
>   drivers/serial/serial_mxc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c
> index fa344c8b8f..0520c7929a 100644
> --- a/drivers/serial/serial_mxc.c
> +++ b/drivers/serial/serial_mxc.c
> @@ -310,7 +310,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);


More information about the U-Boot mailing list