DMA in Linux

Questions and discussions about the Xillybus IP core and drivers

DMA in Linux

Postby SO007 »

We are trying to implement a data acquisition system on ZC706 board. DMA is used to transfer data from the ADC to the PL DDR (SODIMM memory).
The entire project runs perfectly on SDK, however on porting the system design to Xillinux we are facing issues.
I have used to following code to memory map my DMA base address, however its unable to get mapped.



void *dma_base;
int dma_fd = open("/dev/mem", O_RDWR);
if (dma_fd < 1) {
printf("ERROR Opening mem\n");
return 1;
}

dma_base = mmap(NULL, 64*1024, PROT_READ | PROT_WRITE, MAP_SHARED, dma_fd, XPAR_AXI_DMA_0_BASEADDR);

printf(" Dma Reg is : %02x \n", *((uint32_t *) ((uint32_t*)dma_base)));


This code section is functional for all other base address mapping. Is there any specific way to memory map DMA base address?
SO007
 
Posts: 1
Joined:

Re: DMA in Linux

Postby support »

Hello,

To begin with, Xillinux isn't available for ZC706 -- I suppose you've made the porting yourselves.

As for your problem, it's a general-Linux issues, and not Xillinux specific. I suppose you can get plenty of information on memory mapping /dev/mem on the internet. Xillinux is just another Linux distribution for this purpose.

Besides, since you're using Xillinux, I would suggest trying out the Xillybus IP core that comes built-in, which supplies a simple solution for end-to-end DMA communication.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to Xillybus