At the moment Linux CMA size is hard-coded on all i.MX8 and i.MX8M platforms in SoC DTSI file.
This works for NXP evaluation platforms, but may result in kernel crashes on custom boards with smaller amount of RAM.
For example, our i.MX8M board with 1GB of RAM crashes since by default 960MB area is allocated by CMA.
It is not clear why CMA size, which is board specific, is being fixed in SoC DTSI file inherited by all boards.
Is there any benefit in defining CMA parameters in DTS instead of passing CMA size as kernel command line parameter based on the actual DRAM size ?
Yes, it can be ignored, I have described the exact scenario when it happens. Assuming that CMA kernel option is not ignored, is it safe to use ?
Thanks for a prompt reply. When "linux,cma-default" property exists in DTS node, kernel ignores cma= command line parameter. You can see that here:
So you can either have "linux,cma-default" DTS node or pass CMA size via kernel command line, but not both.
Without big enough CMA area video playback and camera streaming are not going to work, so completely disabling CMA is not an option for us. The only difference I can see between DTS and command line CMA configurartion, is that in DTS you can set memory range used by CMA and in command line you cannot. My question is: is it safe to configure CMA via command line for all use cases on i.MX8 and i.MX8M platforms ?
CMA (physically-continuous memory) can be used to make sure that buffers can be used plain with DMA or some other device.
You can specify "CMA=" option among of kernel parameters in u-boot to set any CMA size you wish.
And you can disable it at all for all memory to be available usual way.