<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use Linux dmaengine (via SDMA) to do memory-to-memory copy? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250690#M22814</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing a Linux kernel driver that must transfer up to 512KB of data from an FPGA (connected via the i.mx53's EIM) to a memory buffer.&lt;/P&gt;&lt;P&gt;I have it working with memcpy() right now, but need to use DMA to offload the copying from the CPU.&lt;/P&gt;&lt;P&gt;The FPGA has been mapped such that it can be read as a 512KB contiguous region of memory, and the EIM is set up so that it does not do burst/page accesses to the FPGA.&lt;/P&gt;&lt;P&gt;The 512KB destination buffer has been allocated using dma_alloc_coherent(), and the FPGA's read address range has been made available using dev_ioremap_nocache().&lt;/P&gt;&lt;P&gt;I&amp;nbsp; would like to use the generic Linux DMA layer (the dmaengine) rather than talk to the imx-sdma driver for best portability in the future.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, my attempts to get DMA working have been met with kernel crashes and/or a lack of access to the FPGA (I have an oscilloscope connected that will show when the FPGA RAM addresses are accessed).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the 2.6.38 kernel, if it matters.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a greatly simplified version of my code (with error handling and other stuff removed) that shows the DMA-related operations.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone suggest a fix that might get this working?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336286"&gt;dma_example.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Apr 2013 18:37:13 GMT</pubDate>
    <dc:creator>bikenomad</dc:creator>
    <dc:date>2013-04-03T18:37:13Z</dc:date>
    <item>
      <title>How to use Linux dmaengine (via SDMA) to do memory-to-memory copy?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250690#M22814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm writing a Linux kernel driver that must transfer up to 512KB of data from an FPGA (connected via the i.mx53's EIM) to a memory buffer.&lt;/P&gt;&lt;P&gt;I have it working with memcpy() right now, but need to use DMA to offload the copying from the CPU.&lt;/P&gt;&lt;P&gt;The FPGA has been mapped such that it can be read as a 512KB contiguous region of memory, and the EIM is set up so that it does not do burst/page accesses to the FPGA.&lt;/P&gt;&lt;P&gt;The 512KB destination buffer has been allocated using dma_alloc_coherent(), and the FPGA's read address range has been made available using dev_ioremap_nocache().&lt;/P&gt;&lt;P&gt;I&amp;nbsp; would like to use the generic Linux DMA layer (the dmaengine) rather than talk to the imx-sdma driver for best portability in the future.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, my attempts to get DMA working have been met with kernel crashes and/or a lack of access to the FPGA (I have an oscilloscope connected that will show when the FPGA RAM addresses are accessed).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the 2.6.38 kernel, if it matters.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached a greatly simplified version of my code (with error handling and other stuff removed) that shows the DMA-related operations.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone suggest a fix that might get this working?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336286"&gt;dma_example.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 18:37:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250690#M22814</guid>
      <dc:creator>bikenomad</dc:creator>
      <dc:date>2013-04-03T18:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Linux dmaengine (via SDMA) to do memory-to-memory copy?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250691#M22815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I gave up and moved to the 2.6.35 kernel maintenance branch from the Freescale git repository.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the sample SDMA test driver code from the imx-test package as an example, and got it working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The downside is that my code is now using the Freescale-specific mxc_dma routines, which are even more unstable than the Linux-standard dmaengine layer. So if we ever have to move off 2.6.35 for any reason, we'll have to port the driver again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 14:11:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250691#M22815</guid>
      <dc:creator>bikenomad</dc:creator>
      <dc:date>2013-04-10T14:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Linux dmaengine (via SDMA) to do memory-to-memory copy?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250692#M22816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ned, can you post your sample dma code? I also want to accelerate memcpy() with dma on imx? Can you also post the link to &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;sample SDMA test driver code from the imx-test package&lt;/SPAN&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 15:10:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250692#M22816</guid>
      <dc:creator>DraganOstojic</dc:creator>
      <dc:date>2013-04-22T15:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Linux dmaengine (via SDMA) to do memory-to-memory copy?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250693#M22817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I actually had some problems with doing multiple-buffer transfers, and will try re-doing the code to just set up a single transfer and then start the next chunk when the prior chunk has finished (triggering from the callback).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 15:24:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250693#M22817</guid>
      <dc:creator>bikenomad</dc:creator>
      <dc:date>2013-04-24T15:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Linux dmaengine (via SDMA) to do memory-to-memory copy?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250694#M22818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mr. Konz,&lt;/P&gt;&lt;P&gt; We are also try to transfer data from FPGA to cpu memory. We are using imx-tespackage from 3.0.35. And using the mxc_memcopy_test.c code. I just replace wbuf with FPGA Physical address but I got core dump, unable to handle paging request at address FPGA Phyical address. I couldnt find any solution if you can help us we will be very appreciated.&lt;/P&gt;&lt;P&gt; I will be very appreciated if you send us the sample code of SDMA.&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 17:04:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-use-Linux-dmaengine-via-SDMA-to-do-memory-to-memory-copy/m-p/250694#M22818</guid>
      <dc:creator>sedat_altun</dc:creator>
      <dc:date>2014-12-25T17:04:14Z</dc:date>
    </item>
  </channel>
</rss>

