I would like to have a Linux program setup an AXI DMA transfer to DRAM then receive an interrupt when the transfer is complete and then read the data from DRAM. I know this is possible using a bare metal app (see https://www.youtube.com/watch?v=tnGzZA5VJ0M&feature=youtu.be ) but is it possible in a Linux program? Are there any examples and or documentation/API references ?
If you want to use the DMA from within Linux you can do it a number of ways. If you want to use the DMA to implement a device, you can do that with a driver. This is an example driver that can be used to run a functional test on the DMA
If you want to interface and test the DMA from userspace, you can use Userspace I/O to control the DMA reads/writes and get interrupts.
In either case, you will need to set up the devicetree to load the necessary driver (either custom or UIO). For userspace applications, you’ll need to configure the devicetree with nodes as specified here. Check out this code as a reference to get started writing a UIO application.
To configure the devicetree to use a custom driver you’ll need to configure the devicetree as shown here.
Keep in mind that the only way to guarantee cache coherence is to handle all memory at the kernel (driver) layer. If you want to properly control the DMA and handle interrupts, you should do it in a Linux driver. There are tons of examples of how to set up a DMA with various device interfaces (character or block devices, etc.) but the exact implementation will depend on your application.
Thank you for your answer
I briefly looked at the " This is an example driver that can be used to run a functional test on the DMA" and then looked at the “To configure the devicetree to use a custom driver you’ll need to configure the devicetree as shown here” but its my understanding that the driver would have to program the axi_dma PL to setup the transfer but I dont see a AXI_GP interface in the devicetree listed. This is very confusing for someone that does not write device drivers.