On Wednesday, August 05, 2015 at 08:31:54 PM, [email protected] wrote:
> From: Sylvain Lemieux <[email protected]>
> 
> Incorporate DMA driver from legacy LPCLinux NXP BSP.
> The files taken from the legacy patch are:
> - lpc32xx DMA driver
> - lpc3250 header file DMA registers definition.
> 
> The legacy driver was updated and clean-up as part of the integration with
> the latest u-boot.
> 
> Signed-off-by: Sylvain Lemieux <[email protected]>

[...]

> +int lpc32xx_dma_wait_status(int channel)
> +{
> +     unsigned long start;
> +     u32 reg;
> +
> +     start = get_timer(0);
> +     while (1) {
> +             reg = readl(&dma->raw_tc_stat);
> +             reg |= readl(dma->raw_err_stat);
> +             if (reg & BIT_MASK(channel))
> +                     break;
> +
> +             if (get_timer(start) > 10000)
> +                     return -1;

return -ETIMEDOUT;

> +             udelay(1);
> +     }
> +
> +     if (unlikely(readl(&dma->raw_err_stat) & BIT_MASK(channel))) {
> +             setbits_le32(&dma->int_err_clear, BIT_MASK(channel));
> +             setbits_le32(&dma->raw_err_stat, BIT_MASK(channel));
> +             return -1;
> +     }
> +     setbits_le32(&dma->int_tc_clear, BIT_MASK(channel));
> +     setbits_le32(&dma->raw_tc_stat, BIT_MASK(channel));
> +     return 0;
> +}

Acked-by: Marek Vasut <[email protected]>

Best regards,
Marek Vasut
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to