UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
263 Views
Registered: ‎04-06-2018

wherer to set CMA for Petalinux

Jump to solution

Hi,

I'm here battling to use DMA + Petalinux , following

https://github.com/bperez77/xilinx_axidma

and it recognizes the DMA channels, but now with my testbench,

I get :

axidma: axidma_chrdev.c: axidma_mmap: 285: Unable to allocate contiguous DMA memory region of size 8294400.
axidma: axidma_chrdev.c: axidma_mmap: 287: Please make sure that you specified cma=<size> on the kernel command line, and the size is large enough.

and I tried to set CMA at system-user.dtsi (I'm using JTAG to program FPGA and Kernel):

chosen {
        bootargs = "console=ttyPS0,115200 CMA=28MB earlyprintk";
        stdout-path = "serial0:115200n8";
    };

 

but I do not know if this is the place to set it , I went thought petalinux-config -c kernel and rootfs , but no luck.

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor
250 Views
Registered: ‎04-06-2018

Re: wherer to set CMA for Petalinux

Jump to solution

somebody already answered it , and the commands are :

petalinux-config -c kernel:

Go to kernel features
Make sure the following settings are met:
o Contiguous Memory Allocator
 True
o CMA debug messages (DEVELOPMENT) (if you want...)
 True

Then enable and set the CMA value:

Go to Device Drivers / Generic Driver options
Make sure the following settings are met:
o DMA Contiguous Memory Allocator
 True
o Size in Mega Bytes
 25 (for example)

then when I load the driver I get :

cma: cma_alloc(cma c184d420, count 8, align 3)
cma: cma_alloc(): returned effbf900
cma: cma_alloc(cma c184d420, count 1, align 0)
cma: cma_alloc(): returned effbf880
cma: cma_alloc(cma c184d420, count 8, align 3)
cma: cma_alloc(): returned effbfa00
cma: cma_alloc(cma c184d420, count 1, align 0)
cma: cma_alloc(): returned effbf8a0
axidma: axidma_dma.c: axidma_dma_init: 718: DMA: Found 1 transmit channels and 1 receive channels.
axidma: axidma_dma.c: axidma_dma_init: 720: VDMA: Found 0 transmit channels and 0 receive channels.

 

and from dmesg

cma: dma_contiguous_reserve(limit ffffffff)
cma: dma_contiguous_reserve: reserving 25 MiB for global area

0 Kudos
1 Reply
Contributor
Contributor
251 Views
Registered: ‎04-06-2018

Re: wherer to set CMA for Petalinux

Jump to solution

somebody already answered it , and the commands are :

petalinux-config -c kernel:

Go to kernel features
Make sure the following settings are met:
o Contiguous Memory Allocator
 True
o CMA debug messages (DEVELOPMENT) (if you want...)
 True

Then enable and set the CMA value:

Go to Device Drivers / Generic Driver options
Make sure the following settings are met:
o DMA Contiguous Memory Allocator
 True
o Size in Mega Bytes
 25 (for example)

then when I load the driver I get :

cma: cma_alloc(cma c184d420, count 8, align 3)
cma: cma_alloc(): returned effbf900
cma: cma_alloc(cma c184d420, count 1, align 0)
cma: cma_alloc(): returned effbf880
cma: cma_alloc(cma c184d420, count 8, align 3)
cma: cma_alloc(): returned effbfa00
cma: cma_alloc(cma c184d420, count 1, align 0)
cma: cma_alloc(): returned effbf8a0
axidma: axidma_dma.c: axidma_dma_init: 718: DMA: Found 1 transmit channels and 1 receive channels.
axidma: axidma_dma.c: axidma_dma_init: 720: VDMA: Found 0 transmit channels and 0 receive channels.

 

and from dmesg

cma: dma_contiguous_reserve(limit ffffffff)
cma: dma_contiguous_reserve: reserving 25 MiB for global area

0 Kudos