cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
6,505 Views
Registered: ‎08-31-2014

cdmatest errors on linux

Jump to solution

Hi all!
I have builded linux as described in section System Software Development here http://www.wiki.xilinx.com/Getting+Started
Into my build i have included cdma driver and cdmatest from https://github.com/Xilinx/linux-xlnx/blob/master/drivers/dma/xilinx/
By booting i see message "xilinx-cdma 40000000.axi-cdma: Probing xilinx axi cdma engine...Successful"
But cdmatest always prints something like this:
...
dma0chan0-copy0: dstbuf[0x0] not copied! Expected d6, got 3f
...
dma0chan0-copy0: #4: 8 errors with
src_off=0x9 dst_off=0x0 len=0x8
dma0chan0-copy0: terminating after 5 tests, 1 failures (status 0)


So, i don't understand what is going wrong, why cdma driver not work properly?


P.S.: 
I created my .dts file as described in http://billauer.co.il/blog/2012/07/device-tree-file-xilinx-dtb-linux/ from running kernel (First I have used zynq release 14.7). And added following lines:
axi_cdma_0: axi-cdma@40000000 {
    compatible = "xlnx,axi-cdma-3.04.a";
    interrupt-parent = <0x2>;
    interrupts = <0 58 4>;
    reg = <0x40000000 0x10000>;
    xlnx,axi-lite-is-async = <0x0>;
    xlnx,dlytmr-resolution = <0x7d>;
    xlnx,enable-keyhole = <0x0>;
    xlnx,include-dre = <0x0>;
    xlnx,include-sf = <0x1>;
    xlnx,include-sg = <0x0>;
    xlnx,read-addr-pipe-depth = <0x4>;
    xlnx,use-datamover-lite = <0x0>;
    xlnx,write-addr-pipe-depth = <0x4>;
    dma-channel@40000000 {
        interrupts = < 0 59 4 >;
        xlnx,datawidth = <0x40>;
        xlnx,device-id = <0x0>;
    } ;
} ;

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
10,453 Views
Registered: ‎08-31-2014

Thank you for reply, John!

 

Actually, I have already tested my hardware using mmap() system call (in simple Linux-based application, following instructions in ug873) and made sure that my hardware works fine. 

 

I played a little with interrupts in the .dts file. But the Interrupt number must also be right for cdma channel, as I see in XPS in GIC block number 91 for axi-cdma, so 91-32=59.

 

What I actually did: I removed a few lines from a .dts file, so now node for AXI CDMA looks like this:

axi_cdma_0: axi-cdma@40000000 {
    compatible = "xlnx,axi-cdma";
    interrupt-parent = <0x2>;
    interrupts = <0 58 4>;
    reg = <0x40000000 0x10000>;
    dma-channel@40000000 {
        interrupts = < 0 59 4 >;
        xlnx,datawidth = <0x40>;
        xlnx,device-id = <0x0>;
    } ;
} ;

And cdmatest shows me now:

....

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

....

 

So, it works! 

Thank you for your help and advice, John.

 

Regards,

Paul

View solution in original post

0 Kudos
3 Replies
Highlighted
Visitor
Visitor
6,484 Views
Registered: ‎08-31-2014

Edit: the following channels are present in /sys/class/dma

lrwxrwxrwx 1 root root 0 Mar 24 16:14 dma0chan0 -> ../../devices/amba.0/f8003000.ps7-dma/dma/dma0chan0
...
lrwxrwxrwx 1 root root 0 Mar 24 16:14 dma1chan0 -> ../../devices/amba.0/40000000.axi-cdma/dma/dma1chan0

 

Also, I should control dma1chan0 test. Appropriate messages about this channel looks so:

cdmatest: Started 1 threads using dma1chan0

dma1chan0-copy0: #0: test timed out

dma1chan0-copy0: #1: test timed out

dma1chan0-copy0: #2: test timed out

dma1chan0-copy0: #3: test timed out

dma1chan0-copy0: #4: test timed out

dma1chan0-copy0: terminating after 5 tests, 5 failures (status 0)

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
6,476 Views
Registered: ‎09-10-2008

Hi,

 

I have not used that core personally yet, but I use AXI DMA a lot. Since the driver probed OK the hardware seems to be at that address and somewhat functional or the kernel would likely have crashed.

 

Are you sure the interrupt number for the DMA is correct?

 

You could also do some testing of the hardware system to verify it's working.  You could use with devmem from the command line in Linux or the Xilinx SDK with the command line (XMD like) to do a few peeks and pokes and make sure it's working. 

 

CDMA should be easy to test as there's not much to it, source, destination, and length to some extent and then you could look at the registers to see what happened and at memory. If all looks good then the interrupt would be my guess still.

 

Thanks

John

0 Kudos
Highlighted
Visitor
Visitor
10,454 Views
Registered: ‎08-31-2014

Thank you for reply, John!

 

Actually, I have already tested my hardware using mmap() system call (in simple Linux-based application, following instructions in ug873) and made sure that my hardware works fine. 

 

I played a little with interrupts in the .dts file. But the Interrupt number must also be right for cdma channel, as I see in XPS in GIC block number 91 for axi-cdma, so 91-32=59.

 

What I actually did: I removed a few lines from a .dts file, so now node for AXI CDMA looks like this:

axi_cdma_0: axi-cdma@40000000 {
    compatible = "xlnx,axi-cdma";
    interrupt-parent = <0x2>;
    interrupts = <0 58 4>;
    reg = <0x40000000 0x10000>;
    dma-channel@40000000 {
        interrupts = < 0 59 4 >;
        xlnx,datawidth = <0x40>;
        xlnx,device-id = <0x0>;
    } ;
} ;

And cdmatest shows me now:

....

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

....

 

So, it works! 

Thank you for your help and advice, John.

 

Regards,

Paul

View solution in original post

0 Kudos