Configure AXI DMA in Kernel Module
One AXI DMA Loopback Zynq 7000
Hardware Design
Create hardware design that consists of one AXI DMA and one AXIS FIFO. The M_AXIS_MM2S is looped back to S_AXIS_S2MM. Connect the interrupt via the concat IP.

In Zynq configuration, enable the S AXI HP0. Set the port to 64. Don't change it to 32.

In AXI DMA configuration, change the settings to the following.

Devicetree Settings
Create a devicetree overlay file named dma.dts.
The
clocksparameter should be set with clock value offclk_clk0<0x1 0xf>. The value for every board or OS image can be different. Please check. Failing to set this up can cause error -517.The
interrupt-parentshould be the same as the rest of devicetree.Set the
xlnx,addrwidthto 0x20 the same as in AXI DMA setting not the PS.Make sure the DMA address is the same as in Vivado, or there will be error -19 (device not found).
Compile it using the following command.
Kernel Module
Create the source code dma.c. The of_device_id compatible should be the same as in devicetree.
This is the Makefile.
Testing
Program the bitstream and devicetree from PYNQ Overlay.
Load the kernel module.
Check the kernel log.
Check the DMA interrupt (0x1F, 31+32=63 and 0x20, 32+32=64).
How many interrupts occurred can be monitored here on the CPU0 column.
One AXI DMA Loopback Zynq UltraScale+
Hardware Design
Create hardware design that consists of one AXI DMA and one AXIS FIFO. The M_AXIS_MM2S is looped back to S_AXIS_S2MM. Connect the interrupt via the concat IP.

In Zynq configuration, enable the AXI_HP0. Set the port to 128. Don't change it to 64.

In AXI DMA configuration, change the settings to the following.

Devicetree Settings
Create a devicetree overlay file named dma.dts.
The
clocksparameter should be set with clock value offclk0<0x3 0x47>. Failing to set this up can cause error -517.The
interrupt-parentshould be the same as the rest of devicetree.Set the
xlnx,addrwidthto 0x40 the same as in AXI DMA setting not the PS.Make sure the DMA address is the same as in Vivado, or there will be error -19 (device not found).
Compile it using the following command.
Kernel Module
Create the source code dma.c. The of_device_id compatible should be the same as in devicetree.
This is the Makefile.
Testing
Program the bitstream and devicetree from PYNQ Overlay.
Load the kernel module.
Check the kernel log.
Check the DMA interrupt (0x5B, 91+32=123 and 0x5C, 92+32=124).
How many interrupts occurred can be monitored here on the CPU0 column.
Two AXI DMA Loopback Zynq UltraScale+
Hardware Design
Create hardware design that consists of two AXI DMA and one AXIS FIFO. The M_AXIS_MM2S of AXI DMA 0 is looped back to S_AXIS_S2MM of AXI DMA 1. Connect the interrupt via the concat IP.

In Zynq configuration, enable the AXI_HP0 and AXI_HP2. Set the port to 128. Don't change it to 64.

In AXI DMA configuration, change the settings to the following.


Devicetree Settings
Create a devicetree overlay file named dma.dts.
The
clocksparameter should be set with clock value offclk0<0x3 0x47>. Failing to set this up can cause error -517.The
interrupt-parentshould be the same as the rest of devicetree.Set the
xlnx,addrwidthto 0x40.Make sure the DMA address is the same as in Vivado, or there will be error -19 (device not found).
Compile it using the following command.
Kernel Module
Create the source code dma.c. The of_device_id compatible should be the same as in devicetree.
This is the Makefile.
Testing
Program the bitstream and devicetree from PYNQ Overlay.
Load the kernel module.
Check the kernel log.
Check the DMA interrupt (0x5B, 91+32=123; 0x5C, 92+32=124; 0x5F, 95+32=127; and 0x60, 96+32=128).
How many interrupts occurred can be monitored here on the CPU0 column.
Last updated