AR# 38881: 12.3 EDK, XPS Central DMA - How can I use a Central DMA properly in my EDK design
12.3 EDK, XPS Central DMA - How can I use a Central DMA properly in my EDK design
I have added an XPS Central DMA into my EDK design and written a code, but the DMA does not work.
What could I do wrong?
To make the Central DMA work, one needs to make sure that the DMA controller is connected properly in the hardware system and the DMA registers are configured properly.
There are two bus interfaces for the XPS Central DMA controller, the SPLB and MPLB. The SPLB interface is used for configuring the DMA internal registers, usually by a processor in the system. The MPLB interface is used by the DMA itself to initiate a DMA transaction. When making the connection, make sure that the processor, or any masters that will be used to configure the DMA registers, has access to the SPLB interface. This means that the SPLB interface of the DMA should be connected to the same PLB bus as the processor, and a proper address has been assigned to the DMA. In cases wherethe SPLB of DMA is connected to a different PLB bus, a PLBv46 to PLBv46 bridge will be required to pass the processor request to the DMA. In this case, please make sure that the address range of the bridge has the DMA address covered.
Please also make sure that the MPLB interface of DMA has access to both the source and destination devices. This usually means that in the MPLB of DMA, the source and the destination devices should be connected to the same PLB bus. In cases where the source or destination device is not on the same PLB bus as the MPLB of DMA, a PLBv46 to PLBv46 bridge will be required to pass the DMA request to the device too. Again, make sure the address range of the bridge has the source or destination device address covered too.
Please also note that XPS Central DMA has no access to any devices that are not on a PLB bus, such as LMB BRAMs. So a device that is not on a PLB bus cannot be used as a source or a destination device for DMA.
Starting a DMA transaction is relative easy, just configure the SA, DA and LENGTH registers. The DMA transaction will start after the LENGTH register is written. The only thing to be noted is that if using a buffer instead of a physical address as source or destination address, make sure that the buffer is allocated in a memory device that the DMA has access to. For instance, if the application is linked to LMB BRAMs, the buffer should be in LMB BRAMs too. In this case, the DMA will fail since it has no access to LMB BRAMs.