imx8mp kernel 6.6 dma_heap rename of linux,cma to reserved

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

imx8mp kernel 6.6 dma_heap rename of linux,cma to reserved

2,190 次查看
MicMoba
Contributor V

After switching from Kernel 5.15.52 to Kernel 6.6 I recognized that the devices

/dev/dma_heap/linux,cma and /dev/dma_heap/linux,cma-uncached were renamed to /dev/dma_heap/reserved and /dev/dma_heap/reserved-uncached

Why? Where can I change this back?

0 项奖励
回复
2 回复数

2,171 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

That is part of the Torvalds kernel works don't know why but the CMA works.

Regards

0 项奖励
回复

2,165 次查看
MicMoba
Contributor V

I found the reason for the renaming. If the kernel config CONFIG_CMA_SIZE_MBYTES is below the

given size of linux,cma item in the devicetree the new kernel rename the device to "reserved".
 
In my case the kernel config was:

 

CONFIG_CMA_SIZE_MBYTES=320

 

 
The devicetree (imx8mp.dtsi):

 

resmem: reserved-memory {
   #address-cells = <2>;
   #size-cells = <2>;
   ranges;

   ocram: ocram@900000 {
      no-map;
      reg = <0 0x900000 0 0x70000>;
   };

/*
*    Memory reserved for optee usage. Please do not use.
*    This will be automaticky added to dtb if OP-TEE is installed.
*    optee@56000000 {
*       reg = <0 0x56000000 0 0x2000000>;
*       no-map;
*    };
*/
   /* global autoconfigured region for contiguous allocations */
   linux,cma {
      compatible = "shared-dma-pool";
      reusable;
      size = <0 0x3C000000>;
      alloc-ranges = <0 0x40000000 0 0xC0000000>;
      linux,cma-default;
   };
...

 

0x3C000000 is 960MiB. So it was over the 320MiB from the kernel configuration. After I changed the size to 0x14000000 the device names in /dev/dma_heap were as expect with linux,cma and linux,cma-uncached.