cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
2,300 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
Highlighted
Contributor
Contributor
2,287 Views
Registered: ‎04-06-2018

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

View solution in original post

0 Kudos
1 Reply
Highlighted
Contributor
Contributor
2,288 Views
Registered: ‎04-06-2018

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

View solution in original post

0 Kudos