[U-Boot] [PATCH] serial: zynq: Change logic in putc

Moritz Fischer moritz.fischer at ettus.com
Sun Feb 7 22:24:41 CET 2016


On Wed, Feb 3, 2016 at 6:34 AM, Michal Simek <michal.simek at xilinx.com> wrote:
> Sync logic with Linux kernel where TX empty flag is checked before char
> is sent.
> This logic is fixing problem with console on zynqmp platform.
>
> For example:
> DRAM:  2 GiB
> Enabling Caches...
> EL Level:       ��   sdhci at ff170000: 0
> Using default environment
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
Reviewed-by: Moritz Fischer <moritz.fischer at ettus.com>
> ---
>
>  drivers/serial/serial_zynq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
> index e79d997cbab7..66d54e32ab38 100644
> --- a/drivers/serial/serial_zynq.c
> +++ b/drivers/serial/serial_zynq.c
> @@ -19,7 +19,7 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> -#define ZYNQ_UART_SR_TXFULL    0x00000010 /* TX FIFO full */
> +#define ZYNQ_UART_SR_TXEMPTY   (1 << 3) /* TX FIFO empty */
>  #define ZYNQ_UART_SR_TXACTIVE  (1 << 11)  /* TX active */
>  #define ZYNQ_UART_SR_RXEMPTY   0x00000002 /* RX FIFO empty */
>
> @@ -97,7 +97,7 @@ static void _uart_zynq_serial_init(struct uart_zynq *regs)
>
>  static int _uart_zynq_serial_putc(struct uart_zynq *regs, const char c)
>  {
> -       if (readl(&regs->channel_sts) & ZYNQ_UART_SR_TXFULL)
> +       if (!(readl(&regs->channel_sts) & ZYNQ_UART_SR_TXEMPTY))
>                 return -EAGAIN;
>
>         writel(c, &regs->tx_rx_fifo);
> --
> 1.9.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


More information about the U-Boot mailing list