UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor jwoeber
Visitor
60 Views
Registered: ‎04-04-2019

DMA Proxy for zynqmp_dma

Hi,

I am using a Ultra96 Board and I want to use the DMAs there from the userland to transfer data to the periphery. I tried following https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842418/Linux+DMA+From+User+Space . This tutorial is for the AXI DMAs in the FPGA though and I would like to use the fixed FPD/LPD DMAs. I tried it anyway under the asumption that the xilinx_dma as well as the zynqmp_dma driver are compatible with the linux dmaengine api and as far as I understood the dma-proxy it only access the dmas via the dmaengine api.

I connected the dma-proxy in the device tree to the fpd dma:

 

fpd_dma_chan1: dma@fd500000 {
	#dma-cells = <1>;
	status = "okay";
	compatible = "xlnx,zynqmp-dma-1.0";
	reg = <0x0 0xfd500000 0x0 0x1000>;
	interrupt-parent = <0x4>;
	interrupts = <0x0 0x7c 0x4>;
	clock-names = "clk_main", "clk_apb";
	xlnx,bus-width = <0x80>;
	#stream-id-cells = <0x1>;
	iommus = <0x9 0x14e8>;
	power-domains = <0xa>;
	clocks = <0x3 0x13 0x3 0x1f>;
};

dma_proxy {
         compatible ="xlnx,dma_proxy";
	 dmas = <&fpd_dma_chan1 0
         &fpd_dma_chan1 1>;
         dma-names = "dma_proxy_tx", "dma_proxy_rx";
};

 

But this does not work because dma_request_slave_channel(..) in the proxy module fails. Specifically the  of_dma_find_controller(..) function which gets called from the of_dma_request_slave_channel(..). The of_dma_find_controller searches the registered dmas for the one referenced in the dmas entry of the dma-proxy ( /amba/dma@fd500000 ) and there is one with the exactly same name in the list but because it only compares the pointer values it says it cant find it.

 

[ 1.899010] dma_proxy module initialized
[ 1.902760] (NULL device *): DMA channel request error
[ 1.907868] dma_proxy_driver: probe of amba:dma_proxy failed with error -1
[ 1.915244] xilinx-dpdma fd4c0000.dma: Xilinx DPDMA engine is probed
[ 1.921838] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
of_dma_find_controller: can't find DMA controller /amba/dma@fd500000

 

/**
 * of_dma_find_controller - Get a DMA controller in DT DMA helpers list
 * @dma_spec:	pointer to DMA specifier as found in the device tree
 *
 * Finds a DMA controller with matching device node and number for dma cells
 * in a list of registered DMA controllers. If a match is found a valid pointer
 * to the DMA data stored is retuned. A NULL pointer is returned if no match is
 * found.
 */
static struct of_dma *of_dma_find_controller(struct of_phandle_args *dma_spec)
{
	struct of_dma *ofdma;

	list_for_each_entry(ofdma, &of_dma_list, of_dma_controllers)
		if (ofdma->of_node == dma_spec->np)
			return ofdma;

	pr_debug("%s: can't find DMA controller %pOF\n", __func__,
		 dma_spec->np);

	return NULL;
}

 

TLDR: Should the dma-proxy driver work with any generic dma that conforms to the dmaengine api. If so, why can the dma engine client not find the dma?

Has anyone every used other DMAs with that driver?

Thanks

 

MfG

Johannes

 

 

 

0 Kudos