[U-Boot] [PATCH v5 1/5] dma: lpc32xx: add DMA driver

Marek Vasut marex at denx.de
Wed Aug 5 20:48:30 CEST 2015


On Wednesday, August 05, 2015 at 08:31:54 PM, slemieux.tyco at gmail.com wrote:
> From: Sylvain Lemieux <slemieux at tycoint.com>
> 
> 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 <slemieux at tycoint.com>

[...]

> +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 <marex at denx.de>

Best regards,
Marek Vasut


More information about the U-Boot mailing list