cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
omeriode
Visitor
Visitor
5,969 Views
Registered: ‎10-11-2016

AXI DMA Proxy driver timeout

Hello,

I am trying to use the DMA Proxy driver and associated application but i am stucked with a DMA timeout.

The hardware config has been done from this tutorial

Here is the design block-diagram (TX looped back to RX sing a FIFO):

 

diagram.jpg
I am working on petalinux 2016.2, create a project using the HDF.
The DTS seems to be correct:

/*
 * CAUTION: This file is automatically generated by Xilinx.
 * Version: HSI 2016.2
 * Today is: Thu Oct 20 17:27:03 2016
*/


/ {
	amba_pl: amba_pl {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "simple-bus";
		ranges ;
		axi_dma_0: dma@40400000 {
			#dma-cells = <1>;
			compatible = "xlnx,axi-dma-1.00.a";
			interrupt-parent = <&intc>;
			interrupts = <0 29 4 0 30 4>;
			reg = <0x40400000 0x10000>;
			xlnx,include-sg ;
			dma-channel@40400000 {
				compatible = "xlnx,axi-dma-mm2s-channel";
				dma-channels = <0x1>;
				interrupts = <0 29 4>;
				xlnx,datawidth = <0x20>;
				xlnx,device-id = <0x0>;
			};
			dma-channel@40400030 {
				compatible = "xlnx,axi-dma-s2mm-channel";
				dma-channels = <0x1>;
				interrupts = <0 30 4>;
				xlnx,datawidth = <0x20>;
				xlnx,device-id = <0x0>;
			};
		};
	};
};



And i add the axidmatest DTS entry:

/dts-v1/;
/include/ "system-conf.dtsi"
/ {
};

&clkc {
  fclk-enable = <0xf>;
};
/ {
  xlnk {
    compatible = "xlnx,xlnk-1.0";
    clock-names = "xclk0", "xclk1", "xclk2", "xclk3";
    clocks = <&clkc 15>, <&clkc 16>, <&clkc 17>, <&clkc 18>;
  };
};
/ {
  dmatest_0: dmatest@0 {
    compatible ="xlnx,axi-dma-test-1.00.a";
    dmas = <&axi_dma_0 0
      &axi_dma_0 1>;
    dma-names = "axidma0", "axidma1";
  };
};


The kernel axidmatest test-driver seams to run fine on my platform, so i think the hardware config is OK (not sure about this axidmatest..):

dmatest: Started 1 threads using dma1chan0 dma1chan1
dma1chan0-dma1c: terminating after 5 tests, 0 failures (status 0)



Now i want to use the Proxy DMA driver found on this thread:
I get a DMA timeout when a run the Proxy test application.
I also tried to activate the DMA Proxy INTERNAL_TEST, and the result is the same:

 

 

dma_proxy module initialized
Allocating uncached memory at 0xF23D1000
Allocating uncached memory at 0xF26D3000
length = 1048576 tx direction
Starting DMA transfers
length = 1048576 rx direction
Starting DMA transfers
DMA timed out
DMA timed out


 
Does anyone get the Proxy DMA working using petalinux 2016.2 ? A working basic example would be great to start with.

Thanks for helping,
Olivier

 

0 Kudos
6 Replies
hokim
Scholar
Scholar
5,286 Views
Registered: ‎10-21-2015

 There seems to be something wrong in axidmatest driver.

  Large test buffer size cause the problem.

$ sudo insmod axidmatest.ko
[   50.542480] dmatest: Started 1 threads using dma1chan0 dma1chan1
[   50.548119] dma1chan0-dma1c: terminating after 5 tests, 0 failures (status 0)

$ sudo insmod axidmatest.ko test_buf_size=16384
[  144.318216] dmatest: Started 1 threads using dma1chan0 dma1chan1
[  144.318757] dma1chan0-dma1c: dstbuf[0x7c] not copied! Expected d7, got 23
[  144.318769] dma1chan0-dma1c: dstbuf[0x7d] not copied! Expected d6, got 22
[  144.318777] dma1chan0-dma1c: dstbuf[0x7e] not copied! Expected d5, got 21
[  144.318784] dma1chan0-dma1c: dstbuf[0x7f] not copied! Expected d4, got 20
[  144.318790] dma1chan0-dma1c: dstbuf[0x80] not copied! Expected d3, got 3f
[  144.318797] dma1chan0-dma1c: dstbuf[0x81] not copied! Expected d2, got 3e
[  144.318803] dma1chan0-dma1c: dstbuf[0x82] not copied! Expected d1, got 3d
[  144.318810] dma1chan0-dma1c: dstbuf[0x83] not copied! Expected d0, got 3c
[  144.318817] dma1chan0-dma1c: dstbuf[0x84] not copied! Expected cf, got 3b
[  144.318824] dma1chan0-dma1c: dstbuf[0x85] not copied! Expected ce, got 3a
[  144.318830] dma1chan0-dma1c: dstbuf[0x86] not copied! Expected cd, got 39
[  144.318837] dma1chan0-dma1c: dstbuf[0x87] not copied! Expected cc, got 38
[  144.318843] dma1chan0-dma1c: dstbuf[0x88] not copied! Expected cb, got 37
[  144.318850] dma1chan0-dma1c: dstbuf[0x89] not copied! Expected ca, got 36
[  144.318857] dma1chan0-dma1c: dstbuf[0x8a] not copied! Expected c9, got 35
[  144.318863] dma1chan0-dma1c: dstbuf[0x8b] not copied! Expected c8, got 34
[  144.318870] dma1chan0-dma1c: dstbuf[0x8c] not copied! Expected c7, got 33
[  144.318877] dma1chan0-dma1c: dstbuf[0x8d] not copied! Expected c6, got 32
[  144.318883] dma1chan0-dma1c: dstbuf[0x8e] not copied! Expected c5, got 31
[  144.318890] dma1chan0-dma1c: dstbuf[0x8f] not copied! Expected c4, got 30
[  144.318896] dma1chan0-dma1c: dstbuf[0x90] not copied! Expected c3, got 2f
[  144.318903] dma1chan0-dma1c: dstbuf[0x91] not copied! Expected c2, got 2e
[  144.318910] dma1chan0-dma1c: dstbuf[0x92] not copied! Expected c1, got 2d
[  144.318916] dma1chan0-dma1c: dstbuf[0x93] not copied! Expected c0, got 2c
[  144.318923] dma1chan0-dma1c: dstbuf[0x94] not copied! Expected df, got 2b
[  144.318929] dma1chan0-dma1c: dstbuf[0x95] not copied! Expected de, got 2a
[  144.318936] dma1chan0-dma1c: dstbuf[0x96] not copied! Expected dd, got 29
[  144.318942] dma1chan0-dma1c: dstbuf[0x97] not copied! Expected dc, got 28
[  144.318949] dma1chan0-dma1c: dstbuf[0x98] not copied! Expected db, got 27
[  144.318956] dma1chan0-dma1c: dstbuf[0x99] not copied! Expected da, got 26
[  144.318962] dma1chan0-dma1c: dstbuf[0x9a] not copied! Expected d9, got 25
[  144.318969] dma1chan0-dma1c: dstbuf[0x9b] not copied! Expected d8, got 24
[  144.319076] dma1chan0-dma1c: 5608 errors suppressed
[  144.319085] dma1chan0-dma1c: #0: 5640 errors with 
[  144.319093] src_off=0x48 dst_off=0x7c len=0x234
[  144.321906] dma1chan0-dma1c: terminating after 5 tests, 1 failures (status 0)

I think xilinx_dma.c should be checked in the latest kernel version.

I used xilinx-v2016.4.

In the small buffer(<16KB), axi dma proxy driver works.

0 Kudos
hokim
Scholar
Scholar
5,252 Views
Registered: ‎10-21-2015

I have tested axidmatest and dma_proxy in the kernel versions of xilinx-v2015.4(vivado 2015.4) and xilinx-2016.4(vivado 2016.4).

Both of them work in only low buffer size(<~16KB). 

I would like to ask xilinx guy to check xilinx dma driver(xilinx_dma.c) again.

I attached vivado project tcl scripts

0 Kudos
hokim
Scholar
Scholar
5,241 Views
Registered: ‎10-21-2015

axidma.png

 

It is not due to xilinx kernel.

TEST_SIZE in dma_proxy.h should be less than  [Width of Buffer Length Register]^2.

Check [Width of Buffer Length Register] in your vivado project.

This is my test result with TEST_SIZE=4*1024*1024

[  149.674845] Allocating uncached memory at 0xDF100000
[  149.688345] Allocating uncached memory at 0xDF600000
[  162.808928] length = 4194304 tx direction 
[  162.808939] Starting DMA transfers
[  163.757517] length = 4194304 rx direction 
[  163.757528] Starting DMA transfers

 

axidma.png
0 Kudos
majic@xilinx
Contributor
Contributor
1,860 Views
Registered: ‎05-03-2018

i got the same error on zynq7020 with petalinux2017.4&vivado2017.4,
I tried the way you show below,but it sitll got this error.hope your help
majic
0 Kudos
cychen
Observer
Observer
690 Views
Registered: ‎01-08-2019

I have the same problem

I set the test_size over 16384 , it will timeout and lag

 

is there any solution?

0 Kudos
sabankocal
Voyager
Voyager
647 Views
Registered: ‎08-02-2019

Hi @cychen,

To investigate problem, I can strongly recommend to you, to test your Vivado design with Bare Metal first.

It seems waste of time, but it is not.

If you read previous messaging, it helped a lot to other users to find out problem.

For example, one of previous problems was related with  [Width of Buffer Length Register] in your vivado project. 

Can you check it again and can you share your tool versions?

Regards,

Saban

 

If you it is helpful, you should give KUDO...

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
0 Kudos