<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Contiguous Memory Allocator in kernel]]></title><description><![CDATA[<p dir="auto">Hi, I'm trying to pre-allocate contiguos block of memory.<br />
In kernel_menuconfig I'm selecting cma enabled in Kernel type submenu, and in Device drivers-&gt;Generic driver option I'm selecting DMA Contiguous Memory Allocator, trying to apply 16 MB size zone with max page order 6 (I have 16 kB kernel page size). Building image and downloadin in Omega2p.<br />
When it starts i have message in terminal:</p>
<p dir="auto">[    0.000000] Determined physical RAM map:<br />
[    0.000000]  memory: 08000000 @ 00000000 (usable)<br />
[    0.000000] cma: Failed to reserve 128 MiB</p>
<p dir="auto">and after :</p>
<p dir="auto">[    0.000000] Memory: 124736K/131072K available (4117K kernel code, 226K rwdata, 944K rodata, 208K init, 245K bss, 6336K reserved, 0K cma-reserved)</p>
<p dir="auto">Idk why it trying reserve 128 MiB, I added in device-tree of Omega2p this block to reserve 64 MB of memory:</p>
<pre><code>memory@0 {
	device_type = "memory";
	reg = &lt;0x0 0x8000000&gt;;
};

reserved-memory {
	#address-cells = &lt;1&gt;;
	#size-cells = &lt;1&gt;;
	ranges;

	/* global autoconfigured region for contiguous allocations */
	linux,cma {
		compatible = "shared-dma-pool";
		reusable;
		reg = &lt;0x4000000 0x4000000&gt;;
		alignment = &lt;0x2000&gt;;
		linux,cma-default;
	};

};
</code></pre>
<p dir="auto">It still failing to reserve,  if turn on debug messages:</p>
<p dir="auto">[    0.000000] Determined physical RAM map:<br />
[    0.000000]  memory: 08000000 @ 00000000 (usable)<br />
[    0.000000] cma: dma_contiguous_reserve(limit 08000000)<br />
[    0.000000] cma: dma_contiguous_reserve: reserving 16 MiB for global area<br />
[    0.000000] cma: cma_declare_contiguous(size 0x01000000, base 0x00000000, limit 0x08000000 alignment 0x00000000)<br />
[    0.000000] cma: Failed to reserve 128 MiB</p>
<p dir="auto">Anyway, mb someone successed with contiguous allocation for DMA buffers?</p>
]]></description><link>http://community.onion.io/topic/3840/contiguous-memory-allocator-in-kernel</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 05:50:19 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/3840.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Nov 2019 11:02:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Contiguous Memory Allocator in kernel on Thu, 07 Nov 2019 11:02:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi, I'm trying to pre-allocate contiguos block of memory.<br />
In kernel_menuconfig I'm selecting cma enabled in Kernel type submenu, and in Device drivers-&gt;Generic driver option I'm selecting DMA Contiguous Memory Allocator, trying to apply 16 MB size zone with max page order 6 (I have 16 kB kernel page size). Building image and downloadin in Omega2p.<br />
When it starts i have message in terminal:</p>
<p dir="auto">[    0.000000] Determined physical RAM map:<br />
[    0.000000]  memory: 08000000 @ 00000000 (usable)<br />
[    0.000000] cma: Failed to reserve 128 MiB</p>
<p dir="auto">and after :</p>
<p dir="auto">[    0.000000] Memory: 124736K/131072K available (4117K kernel code, 226K rwdata, 944K rodata, 208K init, 245K bss, 6336K reserved, 0K cma-reserved)</p>
<p dir="auto">Idk why it trying reserve 128 MiB, I added in device-tree of Omega2p this block to reserve 64 MB of memory:</p>
<pre><code>memory@0 {
	device_type = "memory";
	reg = &lt;0x0 0x8000000&gt;;
};

reserved-memory {
	#address-cells = &lt;1&gt;;
	#size-cells = &lt;1&gt;;
	ranges;

	/* global autoconfigured region for contiguous allocations */
	linux,cma {
		compatible = "shared-dma-pool";
		reusable;
		reg = &lt;0x4000000 0x4000000&gt;;
		alignment = &lt;0x2000&gt;;
		linux,cma-default;
	};

};
</code></pre>
<p dir="auto">It still failing to reserve,  if turn on debug messages:</p>
<p dir="auto">[    0.000000] Determined physical RAM map:<br />
[    0.000000]  memory: 08000000 @ 00000000 (usable)<br />
[    0.000000] cma: dma_contiguous_reserve(limit 08000000)<br />
[    0.000000] cma: dma_contiguous_reserve: reserving 16 MiB for global area<br />
[    0.000000] cma: cma_declare_contiguous(size 0x01000000, base 0x00000000, limit 0x08000000 alignment 0x00000000)<br />
[    0.000000] cma: Failed to reserve 128 MiB</p>
<p dir="auto">Anyway, mb someone successed with contiguous allocation for DMA buffers?</p>
]]></description><link>http://community.onion.io/post/20595</link><guid isPermaLink="true">http://community.onion.io/post/20595</guid><dc:creator><![CDATA[Mark Nagaev]]></dc:creator><pubDate>Thu, 07 Nov 2019 11:02:23 GMT</pubDate></item><item><title><![CDATA[Reply to Contiguous Memory Allocator in kernel on Fri, 08 Nov 2019 18:49:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5215">@Mark-Nagaev</a>, why you need too many memory (16Mb)? And I heard DMA can use only down memory, DMA is available only in kernel-mode.</p>
]]></description><link>http://community.onion.io/post/20602</link><guid isPermaLink="true">http://community.onion.io/post/20602</guid><dc:creator><![CDATA[Modest Polykarpovich]]></dc:creator><pubDate>Fri, 08 Nov 2019 18:49:35 GMT</pubDate></item><item><title><![CDATA[Reply to Contiguous Memory Allocator in kernel on Mon, 11 Nov 2019 11:09:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6626">@Modest-Polykarpovich</a> 16 MB just for experiment, but I need about 4 MB of contiguous memory for my DMA audio buffer, of course it works in kernel-mode. If it's interesting for u, u can read this <a href="https://community.onion.io/topic/3840/contiguous-memory-allocator-in-kernel/2" rel="nofollow">article</a></p>
]]></description><link>http://community.onion.io/post/20617</link><guid isPermaLink="true">http://community.onion.io/post/20617</guid><dc:creator><![CDATA[Mark Nagaev]]></dc:creator><pubDate>Mon, 11 Nov 2019 11:09:04 GMT</pubDate></item><item><title><![CDATA[Reply to Contiguous Memory Allocator in kernel on Mon, 11 Nov 2019 22:13:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5215">@Mark-Nagaev</a> said in <a href="/post/20617">Contiguous Memory Allocator in kernel</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6626">@Modest-Polykarpovich</a> 16 MB just for experiment, but I need about 4 MB of contiguous memory for my DMA audio buffer, of course it works in kernel-mode. If it's interesting for u, u can read this <a href="https://community.onion.io/topic/3840/contiguous-memory-allocator-in-kernel/2" rel="nofollow">article</a></p>
</blockquote>
<p dir="auto">Oh, you are trying to make your own sound driver - very well, keep me in touch, I'd like to use I2S Audio Interface too. Perhaps it's no need, because many people want sound on MIPS, many Audio Codecs Chips vendors wants to sell it, the drivers are must be. We can only select a chip. And sound driver is a very difficult, I think better choose professional variants.</p>
<p dir="auto">Look this:<br />
<a href="https://www.seeedstudio.com/LinkIt-Smart-7688.html" rel="nofollow">Breakout for LinkIt Smart 7688 v2.0</a> + <a href="https://www.seeedstudio.com/Breakout-for-LinkIt-Smart-7688-v2-0-p-2641.html" rel="nofollow">Breakout for LinkIt Smart 7688 v2.0</a></p>
<p dir="auto">It's Audio Codec <a href="https://statics.cirrus.com/pubs/proDatasheet/WM8960_v4.4.pdf" rel="nofollow">WM8960</a> on the OpenWRT via I2S interface.</p>
]]></description><link>http://community.onion.io/post/20620</link><guid isPermaLink="true">http://community.onion.io/post/20620</guid><dc:creator><![CDATA[Modest Polykarpovich]]></dc:creator><pubDate>Mon, 11 Nov 2019 22:13:12 GMT</pubDate></item><item><title><![CDATA[Reply to Contiguous Memory Allocator in kernel on Wed, 13 Nov 2019 11:26:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/6626">@Modest-Polykarpovich</a> not my own, but I'm still trying to improve existin driver, here <a href="https://community.onion.io/topic/3662/problem-with-i2s-driver-and-alsa-underrun" rel="nofollow">my post</a>, I add some of my fixes, It works better with them, but not perfect with rates higher than 96kHz, I really wanna play bit-perfect 192/24 on i2s Omega2</p>
]]></description><link>http://community.onion.io/post/20626</link><guid isPermaLink="true">http://community.onion.io/post/20626</guid><dc:creator><![CDATA[Mark Nagaev]]></dc:creator><pubDate>Wed, 13 Nov 2019 11:26:11 GMT</pubDate></item></channel></rss>