<div dir="ltr"><div><div><div>Hi,<br>Ion memory, i think, is the solution to the scenario. This is boot time carved out memory which only you would have the access to.<br><br></div>To have your own share, you can declare some in device tree files if you have access to them. You may want to read more about it <a href="http://lwn.net/Articles/480055/">here</a>. One more <a href="http://lwn.net/Articles/565469/">link</a>. In general you can search for ION memory and study the proper api&#39;s.<br>
<br></div>Regards,<br></div>Manty<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 7, 2014 at 10:45 AM, haresh langaraman <span dir="ltr">&lt;<a href="mailto:hareshel@gmail.com" target="_blank">hareshel@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">There are two ways to do this 1. Allocate a physical memory at boot time itself by reserve_mem fn pointer and you could use this large buffer when you need dma using dma map single fn.</p>

<p dir="ltr">2. Patch the kernel with bigphysarea patch and allocate large buffer with that patch. And you can use that buffer for dma. </p>
<p dir="ltr">I have used both methods it works for large physical buffer you need for dma. </p>
<p dir="ltr">Thanks, <br>
Haresh</p>
<p dir="ltr">Thanks, <br>
Haresh. </p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On 7 Jan 2014 03:27, &quot;Steven Bell&quot; &lt;<a href="mailto:botsnlinux@gmail.com" target="_blank">botsnlinux@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

&gt;&gt; I want to allocate a contiguous 8MB buffer and use it for streaming DMA.  I don&#39;t need or want<br>
&gt;&gt; a coherent buffer, since I&#39;m using streaming DMA, and so dma_alloc_coherent() seems like<br>
&gt;&gt; the wrong method to use.  Is that true, or should I use it anyway?  If not, what method do I use?<br>
&gt;&gt;<br>
&gt;&gt; The DMA-API and DMA-API-HOWTO documents don&#39;t seem to say anything about allocating<br>
&gt;&gt; memory for streaming DMA operations.  Have I missed something?<br>
<br>
On Mon, Jan 6, 2014 at 1:29 AM, saumendra dash &lt;<a href="mailto:saumendradash@gmail.com" target="_blank">saumendradash@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; For streaming DMA, you can use the function dma_map_single().<br>
&gt; Alternatively, you can create your own DMA pool using dma_pool_create(), and allocate memory from that using dma_pool_alloc(().<br>
&gt;<br>
&gt; The later case will be more suitable for you, since you want a 8MB DMA buffer for your DMA.<br>
&gt; Hope that helps/<br>
<br>
I am using dma_map_single, but it doesn&#39;t allocate any memory.  From<br>
what I understand, it takes a pointer to a buffer and performs the<br>
necessary cache flushes or invalidations to make sure that the memory<br>
is safe to DMA.  Is there a correct way to allocate large buffers for<br>
streaming DMA?  Right now, I&#39;m allocating memory with get_free_pages,<br>
but that is prone to fail on large allocations, and only works up to<br>
4MB on my system (i.e get_free_pages order 10).<br>
<br>
&gt;From reading LDD3 and DMA-API.txt, DMA pools are for allocating &quot;small<br>
dma-coherent memory regions&quot;.  LDD3 specifically states that pools are<br>
useful where the driver needs regions smaller than 1 page.  Since I<br>
want large, non-coherent buffers, I don&#39;t see how this helps.<br>
<br>
Steven<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div>