CMA area for I2C client driver

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

CMA area for I2C client driver

342 Views
heinzhjb
Contributor V

I want to allocate memory for a cam driver by function dma_alloc_contiguous() which is using CMA internally.

I declare the cma region for my cam driver in device tree in kernel's cmdline. (cma=a=64M cma_map=mycam=a). The drivers name is "mycam". But this is field isn't set in init_name in device struct neither.

The problem is dma_alloc_contiguous needs struct device's field cma which is NULL when the probe function of mycam is called. Do I have to set this field on my own?

Im using i.MX8mp Kernel 5.10.35

0 Kudos
Reply
1 Reply

302 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @heinzhjb,

I hope you are doing well.

One can refer to the below documents to allocate and debug contiguous memory for the driver.

/Documentation/core-api/dma-api.rst

/Documentation/core-api/dma-api-howto.rst

How to work with reserved CMA memory?

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply