Where to configure CMA memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where to configure CMA memory

5,392 Views
erlend_eriksen
Contributor III

It is possible to reserve cma memory by using the CONFIG_CMA_SIZE_MBYTES in the kernel, as mentioned here: How does imx6qp increase cma memory 

However, it is also possible to configure it in the device tree, as mentioned here: Custom CMA reserved memory on i.MX8MM mini 

Question 1:

What is the difference between setting CMA memory in the kernel menuconfig and in the device tree?

Question 2:

What will happen if I use both options?

Question 3:

Which one should I use if my goal is to reserve enough memory for the VPU?

Labels (3)
0 Kudos
Reply
2 Replies

5,053 Views
igorpadykov
NXP Employee
NXP Employee

Hi Erlend

>Question 1: What is the difference between setting CMA memory in the kernel menuconfig

>and in the device tree?

Kernel config option CONFIG_CMA_SIZE_MBYTES sets the default CMA size.

Note some kernels (for example old) do not support device tree.

Additional description can be found on

Changing memory size reserved for CMA · alliedvision/documentation Wiki · GitHub 

 

>Question 2: What will happen if I use both options?

if kernel supports device tree, setting CMA memory in the device tree will be used.

 

>Question 3: Which one should I use if my goal is to reserve enough memory for the VPU?

one can use device tree settings for i.MX6 Sabre boards from nxp linux

source.codeaurora.org/external/imx/linux-imx repository

dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Linux  documentation

i.MX Software and Development Tools | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

5,053 Views
864535720
Contributor II

Hi,igorpadykov:

      I found CONFIG_CMA_SIZE_MBYTES = 0 on the board of IMX7D. I set CONFIG_CMA_SIZE_MBYTES = 256 through make menuconfig. After I set it, I found that the kernel crashed after running for 1 day. I modified it back to CONFIG_CMA_SIZE_MBYTES = 0, the kernel will not crash, but it will always print alloc_contig_range: [ac0c0, ac0d4) PFNs busy information.
How do I set CONFIG_CMA_SIZE_MBYTES?

0 Kudos
Reply