[PATCH v2] fsldma: Add DMA_SLAVE support

Ira Snyder iws at ovro.caltech.edu
Sat Jun 20 04:26:00 EST 2009


On Thu, Jun 18, 2009 at 03:53:45PM -0700, Ira Snyder wrote:
> Use the DMA_SLAVE capability of the DMAEngine API to copy/from a
> scatterlist into an arbitrary list of hardware address/length pairs.
> 
> This allows a single DMA transaction to copy data from several different
> devices into a scatterlist at the same time.
> 
> This also adds support to enable some controller-specific features such as
> external start and external pause for a DMA transaction.
> 
> Signed-off-by: Ira W. Snyder <iws at ovro.caltech.edu>
> ---
> 
> After discussion with Dan Williams, this is the second version of the
> DMA_SLAVE API for the Freescale DMA controller. I've tested it heavily
> with both drivers I have written against this API, an FPGA programmer
> and an FPGA data grabber.
> 
> Kumar, Dan asked me to add you to the CC list, so you can have a look at
> this patch before he adds it to his tree.
> 
> The other two small patches I posted earlier are very helpful in testing
> this functionality. They make the fsldma driver leave the BWC (bandwidth
> control) bits alone on the 83xx controller, as well as making the
> external start feature available on 83xx.
> 
> In order for the external start/pause features to be useful, the
> bandwidth control bits (in the mode register) need to be set before
> attempting to use the controller. I could spin a v3 of this patch that
> adds a field to struct fsl_dma_slave to set the bits appropriately. Or I
> could send another patch for that. Thoughts?
> 
> Many thanks to all that have participated in the discussion about this
> patch.
> 
> v1 -> v2:
> * move fsldma.h from include/linux to arch/powerpc/include/asm
> * add kerneldoc documentation
> 

[snip]

> +
> +	/* Enable extra controller features */
> +	if (fsl_chan->set_src_loop_size)
> +		fsl_chan->set_src_loop_size(fsl_chan, slave->src_loop_size);
> +
> +	if (fsl_chan->set_dest_loop_size)
> +		fsl_chan->set_dest_loop_size(fsl_chan, slave->dst_loop_size);
> +
> +	if (fsl_chan->toggle_ext_start)
> +		fsl_chan->toggle_ext_start(fsl_chan, slave->external_start);
> +
> +	if (fsl_chan->toggle_ext_pause)
> +		fsl_chan->toggle_ext_pause(fsl_chan, slave->external_pause);

I just noticed that I got this wrong for external pause. It takes a
size, not a boolean enable/disable. I'll split the size out from the
external pause feature, and send another patch.

> +
> +	return &first->async_tx;
> +


More information about the Linuxppc-dev mailing list