<?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 Re: How to Disable Memory Barrier in SDMA in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433831#M66265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi igorpadykov,&lt;/P&gt;&lt;P&gt;in my script SDMA works independently from the processor&amp;amp;Linux. The script read&amp;amp;write to the EIM bus periodically. The following code is an example of my peripheral operation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#Reg[4] = FPGA_BASE_ADDR;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// EIM_BUS_ADDRESS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#Reg[7] = 0xFFFFFFFF;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// for always loop&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;getdescription:&lt;/P&gt;&lt;P&gt;################################################### CHECK READY FLAG&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; stf r5, 0xc7&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;# Get the Desciptor (To MSA, incremented mode, 32 bit data width)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; ldf r0, 0xc8&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;# Copy first dw of SDMA descriptor (pd,)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; btsti r7, 0&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;# always loop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; bf getdescription&lt;/TD&gt;&lt;TD&gt;# always loop&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;As I said before, by this code SDMA has no dependency to main processor. It is an infitinite loop to read 1Dword from EIM_BUS&amp;nbsp; and it cause huge gaps between the read operations.&lt;/P&gt;&lt;P&gt;I think this gap is caused from memory barrier for two reasons. First the gap duration in SDMA operation is the same with the main processor read operation with memory barrier. Second in &lt;A href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHEDAAF.html"&gt;ARM site&lt;/A&gt;, it is stated that "&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small;"&gt;A barrier is required between a CPU memory access and a DMA operation". &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Anyway, I may totally wrong about "memory barrier" but I could not understand why SDMA needs these huge gaps between its operations. The problem is not from EIM_BUS because when I run a kthread concurrently with sdma operation, I can reach the EIM_BUS &lt;SPAN style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: small;"&gt;and complete a read&amp;amp;write operation&lt;/SPAN&gt; between the SDMA operations!!&lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Turgay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 May 2015 07:58:19 GMT</pubDate>
    <dc:creator>turgaypamuklu</dc:creator>
    <dc:date>2015-05-15T07:58:19Z</dc:date>
    <item>
      <title>How to Disable Memory Barrier in SDMA</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433829#M66263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For my I.MX6 chip, I wrote a script for SDMA core which transferred data between the arm memory and the EIM Bus (FPGA on the other side). When I run the script, I monitored that each transfer duration is approximately 5 EIM clock cycles (address+1DWord Data + wait time) and the time gaps between these transfers are around 25 EIM clock cycles. So I thought I have a performance problem and I operated the same operation by a kernel thread in ARM CPU. The timings were the same! At the end of the day, I realized that the memory barrier in write&amp;amp;read operation caused this tremendous gap time between the operations. So, I used writel_relaxed&amp;amp;readl_relaxed operations, which does not call barrier functions, and the new gap time reduced to only 4 EIM clock cycles. So, I think the same problem occurs in the SDMA operations, because the gap durations are exactly the same.&lt;/P&gt;&lt;P&gt;In conclusion, I would like to know if there is any configuration&amp;amp;method to disable memory barrier in SDMA? I saw this gap problem in every SDMA function units (Peripheral&amp;amp;Burst) and every type of operations (prefetch, copy mode, read and write modes...).&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;Turgay Pamuklu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2015 12:14:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433829#M66263</guid>
      <dc:creator>turgaypamuklu</dc:creator>
      <dc:date>2015-05-14T12:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to Disable Memory Barrier in SDMA</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433830#M66264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi turgay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sdma itself does not affected by memory barriers, however&lt;/P&gt;&lt;P&gt;initiating sdma transfer is done as usual linux command and it may&lt;/P&gt;&lt;P&gt;be affected by barriers. Suggest to post this on kernel.org as&lt;/P&gt;&lt;P&gt;seems this is specific kernel issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;igor&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 00:51:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433830#M66264</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2015-05-15T00:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Disable Memory Barrier in SDMA</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433831#M66265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi igorpadykov,&lt;/P&gt;&lt;P&gt;in my script SDMA works independently from the processor&amp;amp;Linux. The script read&amp;amp;write to the EIM bus periodically. The following code is an example of my peripheral operation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------------------&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;#Reg[4] = FPGA_BASE_ADDR;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// EIM_BUS_ADDRESS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;#Reg[7] = 0xFFFFFFFF;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;// for always loop&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;getdescription:&lt;/P&gt;&lt;P&gt;################################################### CHECK READY FLAG&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; stf r5, 0xc7&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;# Get the Desciptor (To MSA, incremented mode, 32 bit data width)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; ldf r0, 0xc8&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;# Copy first dw of SDMA descriptor (pd,)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; btsti r7, 0&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;# always loop&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; bf getdescription&lt;/TD&gt;&lt;TD&gt;# always loop&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;As I said before, by this code SDMA has no dependency to main processor. It is an infitinite loop to read 1Dword from EIM_BUS&amp;nbsp; and it cause huge gaps between the read operations.&lt;/P&gt;&lt;P&gt;I think this gap is caused from memory barrier for two reasons. First the gap duration in SDMA operation is the same with the main processor read operation with memory barrier. Second in &lt;A href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHEDAAF.html"&gt;ARM site&lt;/A&gt;, it is stated that "&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small;"&gt;A barrier is required between a CPU memory access and a DMA operation". &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Anyway, I may totally wrong about "memory barrier" but I could not understand why SDMA needs these huge gaps between its operations. The problem is not from EIM_BUS because when I run a kthread concurrently with sdma operation, I can reach the EIM_BUS &lt;SPAN style="color: #000000; font-family: arial, helvetica, sans-serif; font-size: small;"&gt;and complete a read&amp;amp;write operation&lt;/SPAN&gt; between the SDMA operations!!&lt;/SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Turgay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 May 2015 07:58:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433831#M66265</guid>
      <dc:creator>turgaypamuklu</dc:creator>
      <dc:date>2015-05-15T07:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Disable Memory Barrier in SDMA</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433832#M66266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I attach the Chipscope waveforms of three situations at this post. First one shows the signal values of EIM operations between the CPU and FPGA without barrier (relaxed mode). CS2 is the chip selection of the operation. It is an active low signal and when it is low, CPU is allowed to operate an EIM operation. CS2 is at high value between the X and O vertical lines and this value is around 5 EIM clock cycles for relaxed mode. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="relaxed.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/36766iFFD22A2ADE4C4350/image-size/large?v=v2&amp;amp;px=999" role="button" title="relaxed.png" alt="relaxed.png" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;The second image (below) shows the signal values of EIM operations between the CPU and FPGA with barrier (normal mode). The gap between the X and O vertical lines is 25 EIM clock cycles, which means that with the barrier mode, the utilization of EIM bus is around %20. I solved this utilization problem by reading&amp;amp;writing at relaxed mode during the EIM operations and I add only one barrier at the end&amp;amp;beginning of the overall operation. However we could not run CPU in burst mode without SDMA so I should solve this utilization problem in SDMA. &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="normal.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/36848i416B96B70C4534A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="normal.png" alt="normal.png" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;The last image (below) show the signal values of EIM operations between the SDMA and FPGA.&amp;nbsp; The gap between the X and O vertical lines is 25 EIM clock cycles, which is the same as the barrier mode CPU &amp;amp; FPGA communication.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="sdma.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/36901i4C46B6F8BA469B80/image-size/large?v=v2&amp;amp;px=999" role="button" title="sdma.png" alt="sdma.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope someone know the reason of this gap between the EIM operations in the SDMA. I think the reason is barrier mode operation in SDMA because the second and last image has the same gap values but I do not know how to prove and disable it.&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;P&gt;Turgay Pamuklu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2015 12:37:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-Disable-Memory-Barrier-in-SDMA/m-p/433832#M66266</guid>
      <dc:creator>turgaypamuklu</dc:creator>
      <dc:date>2015-06-16T12:37:03Z</dc:date>
    </item>
  </channel>
</rss>

