09-23-2014 05:16 PM
Hello Dear All,
I would like to use AXI DMA in order to pass data to my custom ip. I think it is not a hard job for bare metal applications(an example tutorial: http://www.fpgadeveloper.com/2014/08/using-the-axi-dma-in-vivado.html) however, I couldn't find any complete guide to use AXI DMA in Linux. I am trying to put pieces together but I couldn't do what I want so far.
Would you please help me with that, do you have any suggestion or do you know any sources related to this subject?
09-24-2014 06:40 AM
09-23-2014 11:56 PM
09-24-2014 06:40 AM
09-24-2014 08:51 PM
Awesome! This is what I was looking for. Thank you very much!
Is this presentation from a workshop/lecture series? I mean, If there are some smilar presentations, I would like to get them also.
09-25-2014 06:21 AM
This thread has more posted and we are going to make a lot of this stuff more public in the future.
Glad you liked it. I also attached a new one that I'm just finishing for user space DMA. I'm putting this out here hoping that some of you will start using the methods and give some feedback.
09-25-2014 02:25 PM
Looking forward to see for more in the future. I see a lot of questions about DMA but there are not enough resources, I think. Now, I feel like I found a treat.
Thanks for helping. Have a great day!
09-29-2014 06:58 AM
I am working on AXI DMA on petalinux and when i modprobe xilinx_axidma.c i always get the error :
Unhandled fault: imprecise external abort (0x406) at 0x000a58a7
Internal error: : 406 [#1] PREEMPT SMP ARM
as far as i understandi get an error at dma_reset function which try to read the control_register. So i couldnot reach the registers. But, when i check the /proc/iomem, system handle the correct register addresses.
root@Xilinx-ZC702-2013_3:~# cat /proc/iomem
00000000-1fffffff : System RAM
00008000-00522053 : Kernel code
00c80000-00ccec2f : Kernel data
40400000-4040ffff : /amba@0/axidma@40400000
e0001000-e0001ffe : xuartps
e0002000-e0002fff : /amba@0/ps7-usb@e0002000
e0002000-e0002fff : e0002000.ps7-usb
e000a000-e000afff : e000a000.ps7-gpio
e000d000-e000dfff : e000d000.ps7-qspi
e0100000-e0100fff : mmc0
f8003000-f8003fff : /amba@0/ps7-dma@f8003000
f8003000-f8003fff : dma-pl330
f8007000-f80070ff : xdevcfg
f8007100-f800711f : f8007100.ps7-xadc
So do you have an idea what could be the problem. I also added the system.dts.
03-27-2015 05:18 AM
i started a few days ago to move my simple DMA implementation from standalone to linux.
this is the first "usefull" thread i found about this step. Is there also a lab discription or example code for
the hardware design which is described in this documentation from linnj.
at the moment i dont know how and where i should start.
03-27-2015 06:04 AM
Just to comment a little. As a Linux newbe I have been working on DMA device drivers for a few months now. I started just using everything in user space. I reserved the DMA buffers as a memory hole (memory linux did not touch). things such as the AXI DMA registers and the buffers were mapped to user space using device /dev/mem mmap. I did not use interrupts. I had everthing working, however there was a big problem, it was too slow. Copy from user space to DMA buffers was very slow. I am sure clever people who understand caching etc could tell you why but suffice to say don't use a user space only DMA.
I have now written my own char device driver, I ignore the Linux and Xilinx DMA drivers and program the AXI DMA directly. This works fine, if it will help anyone I attach the source.
P.S. Thanks to John Linn who was very helpful when I had problems
03-27-2015 07:16 AM
Hi Max and Dave,
Dave, based on your small description, the only reason I can think of for it being slow was used /dev/mem to map buffers to user space such that they were maybe cached. It takes CPU time to do the cache operations.
I believe that a user/kernel space hybrid approach is likely best and I think you should be able to map the buffers into user space without sacrificing performance. The kernel space lets you use interrupts more effectively and control buffers with respect to caching also. Allocating non-cached memory for buffers (dma_alloc_coherent) may be the best answer to avoid cache issues (depending on the application).
I see a lot of people trying user space stuff only without wanting to get into the kernel. Knowing more details about what the kernel is doing is a big benefit and likely a requirement even when doing user space code for devices like this.
Max, the systems I used in the past were built in Vivado and were extremely simple. An AXI DMA connected to Zynq using the interrupts and then a loopback from the Tx stream to the Rx stream on the DMA. My work has been more focused on using the Linux DMA drivers since they are provided and work.