Skip to content
guruofquality edited this page Dec 16, 2014 · 12 revisions

DMA support for Xilinx Zynq FPGAs

The Pothos Zynq toolkit provides zero-copy DMA support blocks for Xilinx Zynq FPGAs. The toolkit provides:

  • DMA source and sink blocks for zero-copy buffer integration with a Pothos data flow,
  • a userspace driver for interfacing with an AXI DMA engine in the programmable logic,
  • loopback examples in Vivado, Zynq boot files, and documentation to recreate the demo.
https://raw.githubusercontent.com/wiki/pothosware/pothos-zynq/images/framework_dma.png

MicroZed loopback demo

Checkout the loopback demo for the MicroZed Zynq evaluation board.

AXI DMA userspace driver

The AXI DMA userspace driver is a combined kernel module and C userspace API for DMA buffer access. Also, the C API is in general, useful for individuals that want to interface with DMA on a Zynq FPGA.

  • The kernel module is responsible for parsing the device tree for available AXI DMA engines, allocating DMA buffers for the userspace driver, and implementing waiting and interrupt interfacing.
  • The userspace driver implements the buffer interface, handles the scatter/gather tables, and reads and writes to the DMA control registers in the FPGA.
  • Because Pothos is a userspace library, the userspace driver is implemented to only call into the kernel for initialization, cleanup, and waiting for completion. We otherwise stay out of the kernel during runtime operations.

References:

Zero-copy buffer integration

The Zynq DMA source and sink blocks integrate the userspace driver above with the Pothos framework hooks for buffer integration. This includes a custom buffer manager to handle releasing buffers into the DMA engine, and DMA block work functions that wait on completion and acquire buffers from the DMA engine.

References: