FSL DMA engine transfer to PCI memory
Scott Wood
scottwood at freescale.com
Tue Jan 25 09:44:23 EST 2011
On Mon, 24 Jan 2011 23:47:22 +0200
Felix Radensky <felix at embedded-sol.com> wrote:
> static int dma_transfer(struct dma_chan *chan, void *dst, void *src,
> size_t len)
> {
> int rc = 0;
> dma_addr_t dma_src;
> dma_addr_t dma_dst;
> dma_cookie_t cookie;
> struct completion cmp;
> enum dma_status status;
> enum dma_ctrl_flags flags = 0;
> struct dma_device *dev = chan->device;
> struct dma_async_tx_descriptor *tx = NULL;
> unsigned long tmo = msecs_to_jiffies(FPGA_DMA_TIMEOUT_MS);
>
> dma_src = dma_map_single(dev->dev, src, len, DMA_TO_DEVICE);
> if (dma_mapping_error(dev->dev, dma_src)) {
> printk(KERN_ERR "Failed to map src for DMA\n");
> return -EIO;
> }
>
> dma_dst = (dma_addr_t)dst;
Why are you casting a virtual address to dma_addr_t?
> The destination address is PCI memory address returned by
> pci_ioremap_bar().
You need the physical address.
-Scott
More information about the Linuxppc-dev
mailing list