<?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 failed to allocate memory for node 'linux,cma' in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/failed-to-allocate-memory-for-node-linux-cma/m-p/1609485#M202318</link>
    <description>&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;I am bringing up an iMX8M Plus based board having 1GB DDR capacity :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@viperimx8mp:~# free                                                                            
               total        used        free      shared  buff/cache   available                    
Mem:          968116      115580      771180       10556       81356      761580                    
Swap:              0           0           0                                 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also adjusted the&amp;nbsp; memory layout in custom .dtsi as below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+
+#include "imx8mp.dtsi"
+
+/ {
+       memory@40000000 {
+               device_type = "memory";
+               reg = &amp;lt;0x0 0x40000000 0 0x40000000&amp;gt;;
+       };
+
+       resmem: reserved-memory {
+               #address-cells = &amp;lt;2&amp;gt;;
+               #size-cells = &amp;lt;2&amp;gt;;
+               ranges;
+
+               ocram: ocram@900000 {
+                       no-map;
+                       reg = &amp;lt;0 0x900000 0 0x70000&amp;gt;;
+               };
+
+/*
+ *             Memory reserved for optee usage. Please do not use.
+ *             This will be automaticky added to dtb if OP-TEE is installed.
+ *             optee@56000000 {
+ *                     reg = &amp;lt;0 0x56000000 0 0x2000000&amp;gt;;
+ *                     no-map;
+ *             };
+ */
+               /* global autoconfigured region for contiguous allocations */
+               linux,cma {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = &amp;lt;0 0x3c000000&amp;gt;;
+                       alloc-ranges = &amp;lt;0 0x40000000 0 0x40000000&amp;gt;;
+                       linux,cma-default;
+               };
+
+               dsp_reserved: dsp@92400000 {
+                       reg = &amp;lt;0 0x92400000 0 0x1000000&amp;gt;;
+                       no-map;
+               };
+               dsp_reserved_heap: dsp_reserved_heap {
+                       reg = &amp;lt;0 0x93400000 0 0xef0000&amp;gt;;
+                       no-map;
+               };
+               dsp_vdev0vring0: vdev0vring0@942f0000 {
+                       reg = &amp;lt;0 0x942f0000 0 0x8000&amp;gt;;
+                       no-map;
+               };
+               dsp_vdev0vring1: vdev0vring1@942f8000 {
+                       reg = &amp;lt;0 0x942f8000 0 0x8000&amp;gt;;
+                       no-map;
+               };
+               dsp_vdev0buffer: vdev0buffer@94300000 {
+                       compatible = "shared-dma-pool";
+                       reg = &amp;lt;0 0x94300000 0 0x100000&amp;gt;;
+                       no-map;
+               };
+
+               /* used only by tuning tool, can be removed for normal case */
+               isp0_reserved: isp0@94400000 {
+                       no-map;
+                       reg = &amp;lt;0 0x94400000 0 0x10000000&amp;gt;;
+               };
+       };
+};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I still have the following error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@viperimx8mp:~# dmesg | grep cma
[    0.000000] OF: reserved mem: failed to allocate memory for node 'linux,cma'
[    0.000000] cma: Reserved 32 MiB at 0x000000007c000000
[    0.000000] Memory: 932468K/1015808K available (17920K kernel code, 1506K rwdata, 6920K rodata, 2880K init, 553K bss, 50572K reserved, 32768K cma-reserved)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anybody help to configure the memory layout to avoid this problem, please ? I am using BSP LF-5.10.52-2.1.0.&lt;/P&gt;&lt;P&gt;Thanks in advance and best regards,&lt;/P&gt;&lt;P&gt;Khang&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Mar 2023 04:34:19 GMT</pubDate>
    <dc:creator>khang_letruong</dc:creator>
    <dc:date>2023-03-04T04:34:19Z</dc:date>
    <item>
      <title>failed to allocate memory for node 'linux,cma'</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/failed-to-allocate-memory-for-node-linux-cma/m-p/1609485#M202318</link>
      <description>&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;I am bringing up an iMX8M Plus based board having 1GB DDR capacity :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@viperimx8mp:~# free                                                                            
               total        used        free      shared  buff/cache   available                    
Mem:          968116      115580      771180       10556       81356      761580                    
Swap:              0           0           0                                 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also adjusted the&amp;nbsp; memory layout in custom .dtsi as below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;+
+#include "imx8mp.dtsi"
+
+/ {
+       memory@40000000 {
+               device_type = "memory";
+               reg = &amp;lt;0x0 0x40000000 0 0x40000000&amp;gt;;
+       };
+
+       resmem: reserved-memory {
+               #address-cells = &amp;lt;2&amp;gt;;
+               #size-cells = &amp;lt;2&amp;gt;;
+               ranges;
+
+               ocram: ocram@900000 {
+                       no-map;
+                       reg = &amp;lt;0 0x900000 0 0x70000&amp;gt;;
+               };
+
+/*
+ *             Memory reserved for optee usage. Please do not use.
+ *             This will be automaticky added to dtb if OP-TEE is installed.
+ *             optee@56000000 {
+ *                     reg = &amp;lt;0 0x56000000 0 0x2000000&amp;gt;;
+ *                     no-map;
+ *             };
+ */
+               /* global autoconfigured region for contiguous allocations */
+               linux,cma {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = &amp;lt;0 0x3c000000&amp;gt;;
+                       alloc-ranges = &amp;lt;0 0x40000000 0 0x40000000&amp;gt;;
+                       linux,cma-default;
+               };
+
+               dsp_reserved: dsp@92400000 {
+                       reg = &amp;lt;0 0x92400000 0 0x1000000&amp;gt;;
+                       no-map;
+               };
+               dsp_reserved_heap: dsp_reserved_heap {
+                       reg = &amp;lt;0 0x93400000 0 0xef0000&amp;gt;;
+                       no-map;
+               };
+               dsp_vdev0vring0: vdev0vring0@942f0000 {
+                       reg = &amp;lt;0 0x942f0000 0 0x8000&amp;gt;;
+                       no-map;
+               };
+               dsp_vdev0vring1: vdev0vring1@942f8000 {
+                       reg = &amp;lt;0 0x942f8000 0 0x8000&amp;gt;;
+                       no-map;
+               };
+               dsp_vdev0buffer: vdev0buffer@94300000 {
+                       compatible = "shared-dma-pool";
+                       reg = &amp;lt;0 0x94300000 0 0x100000&amp;gt;;
+                       no-map;
+               };
+
+               /* used only by tuning tool, can be removed for normal case */
+               isp0_reserved: isp0@94400000 {
+                       no-map;
+                       reg = &amp;lt;0 0x94400000 0 0x10000000&amp;gt;;
+               };
+       };
+};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I still have the following error :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root@viperimx8mp:~# dmesg | grep cma
[    0.000000] OF: reserved mem: failed to allocate memory for node 'linux,cma'
[    0.000000] cma: Reserved 32 MiB at 0x000000007c000000
[    0.000000] Memory: 932468K/1015808K available (17920K kernel code, 1506K rwdata, 6920K rodata, 2880K init, 553K bss, 50572K reserved, 32768K cma-reserved)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anybody help to configure the memory layout to avoid this problem, please ? I am using BSP LF-5.10.52-2.1.0.&lt;/P&gt;&lt;P&gt;Thanks in advance and best regards,&lt;/P&gt;&lt;P&gt;Khang&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2023 04:34:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/failed-to-allocate-memory-for-node-linux-cma/m-p/1609485#M202318</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2023-03-04T04:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: failed to allocate memory for node 'linux,cma'</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/failed-to-allocate-memory-for-node-linux-cma/m-p/1609884#M202361</link>
      <description>&lt;P&gt;I think I found the root cause: allocating 960MB for CMA over 1GB of memory seems not practical.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;K.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 09:10:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/failed-to-allocate-memory-for-node-linux-cma/m-p/1609884#M202361</guid>
      <dc:creator>khang_letruong</dc:creator>
      <dc:date>2023-03-06T09:10:21Z</dc:date>
    </item>
  </channel>
</rss>

