All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 1/5] dma: lpc32xx: add DMA driver
Date: Wed, 5 Aug 2015 20:48:30 +0200	[thread overview]
Message-ID: <201508052048.30587.marex@denx.de> (raw)
In-Reply-To: <1438799517-24273-1-git-send-email-slemieux.tyco@gmail.com>

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

Best regards,
Marek Vasut

  reply	other threads:[~2015-08-05 18:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05 18:31 [U-Boot] [PATCH v5 1/5] dma: lpc32xx: add DMA driver slemieux.tyco at gmail.com
2015-08-05 18:48 ` Marek Vasut [this message]
2015-08-05 20:48 ` Vladimir Zapolskiy
2015-08-06 13:50   ` LEMIEUX, SYLVAIN
2015-08-06 18:42     ` Vladimir Zapolskiy
2015-08-06 21:04       ` LEMIEUX, SYLVAIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201508052048.30587.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.