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 mainvoid
Visitor
9,672 Views
Registered: ‎12-12-2013

pl330.c DMA driver. Number of channels

I'm trying to get the pl330.c driver up and running.

When I insert the module I get "dma0chan0" entry appearing in /sys/class/dma/.

However the device tree file entry defines number of channels as 8:

 

ps7_dma_s: ps7-dma@f8003000 {
    #dma-cells = <1>;
    #dma-channels = <8>;
    #dma-requests = <4>;
    arm,primecell-periphid = <0x41330>;
    clock-names = "apb_pclk";
    clocks = <&clkc 27>;
    compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330";
    interrupt-names = "abort", "dma0", "dma1", "dma2", "dma3",
          "dma4", "dma5", "dma6", "dma7";
    interrupt-parent = <&ps7_scugic_0>;
    interrupts = <0 13 4>, <0 14 4>, <0 15 4>, <0 16 4>, <0 17 4>, <0 40 4>, <0 41 4>, <0 42 4>, <0 43 4>;
    reg = <0xf8003000 0x1000>;
} ;

 

Furthermore I cant seem to get the dmatest module running either. It can't start the test thread using the only available channel apparently because the channel doesn't have required capability (MEMCPY).

 

Could anyone suggest what could possibly be the problem here?

 

Kind regards.

 

Tags (4)
0 Kudos
10 Replies
Xilinx Employee
Xilinx Employee
9,661 Views
Registered: ‎09-10-2008

Re: pl330.c DMA driver. Number of channels

What I see looks right on the device tree as I've been running this also successfully. Here's what I did.

modprobe dmatest.ko
echo 1 > /sys/module/dmatest/parameters/run

You can also do these, but I think not required I found.

echo dma0chan0 > /sys/module/dmatest/parameters/channel
echo 2000000 > /sys/module/dmatest/parameters/timeout
echo 1 > /sys/module/dmatest/parameters/iterations (without this it does not run any)
echo 1 > /sys/module/dmatest/parameters/run

echo 1 > /sys/module/dmatest/parameters/verbose (will get a bit more info out of it)

You can also put in the kernel log of what you are seeing to help a bit more.

I'm assuming you don't have any other DMA in the kernel like AXI DMA.

Thanks,
John
0 Kudos
Visitor mainvoid
Visitor
9,646 Views
Registered: ‎12-12-2013

Re: pl330.c DMA driver. Number of channels

Hi John,

 

Thanks for your response.

For some reason I don't have the file "run" created in:

/sys/module/dmatest/parameters/run

 

oz745> modprobe dmatest
oz745> echo 1 > /sys/module/dmatest/parameters/run
-/bin/ash: can't create /sys/module/dmatest/parameters/run: nonexistent directory
oz745>
oz745> ls /sys/module/dmatest/parameters/
channel           max_channels      threads_per_chan
device            pq_sources        timeout
iterations        test_buf_size     xor_sources

 

Does this suggest dmatest module is not running fully at this moment?

I checked inside the module, particularly this call:

 

debugfs_create_file("run", S_IWUSR | S_IRUGO, info->root, info, &dtf_run_fops);

 It runs successfully (I obtained and checked return value) but the file never there in the filesystem.

 

Any suggestions?

Kind regards,

Vlad

 

0 Kudos
Xilinx Employee
Xilinx Employee
9,634 Views
Registered: ‎09-10-2008

Re: pl330.c DMA driver. Number of channels

I think you need to make sure the PL330 DMA driver came up during boot ("dmesg | grep PL330"). Or attach your kernel boot log.

Thanks
John
0 Kudos
Visitor mainvoid
Visitor
9,625 Views
Registered: ‎12-12-2013

Re: pl330.c DMA driver. Number of channels

Hi John,

 

Thaks once again.

What was happening I had pl330 driver built as a module and was instaling it manually once the kernel booted.

Apparently this way the device tree information is not available for the driver's probe function. Soffy if this sounds obvious. Im not familiar much with the kernel boot up sdquence.

 

I've got DMA working using my own test module. The dmatest module still not working for me as theres no "run" or "verbose" or "results" files created in debugfs.

 

0 Kudos
Xilinx Employee
Xilinx Employee
9,618 Views
Registered: ‎09-10-2008

Re: pl330.c DMA driver. Number of channels

No that doesn't make sense, drivers inserted as a module still use the device tree information in the same way they do when built into the kernel.

Maybe you are running a different kernel version and the dmatest is different as I don't know if it might have changed or not. I'm using kernel version 3.14.

Thanks
John
0 Kudos
Visitor ghalady
Visitor
9,087 Views
Registered: ‎02-12-2014

Re: pl330.c DMA driver. Number of channels

HI John,

            Thanks for the post. At the moment, I have installed Petalinux 2014.4 along with VIVADO / SDK 2014.4 and could successfully build the kernel / rootfs for ZYNC7000 (7010) on Microzed. However, what I am attempting is to be able to do a DMA using PL330 DMA driver from DDR to a BRAM on PL (@4000_0000).  I did also refer to :

 

http://www.wiki.xilinx.com/Zynq+Linux+pl330+DMA

 

However, this link clearly mentions that "

IMPORTANT NOTE: The reference implementation contained on this page is no longer up-to-date and is kept as a reference for design teams working with older kernels."

 

Would greatly appreciate if you could help on using the newer DMA DRIVER API for such an application.  BTW, I could get the dma_test to work on Bare Metal to confirm the Hw/ sw design integrity. Now, I am trying to port over this DMA to Peatlinux.

 

THanks in advance, Merry Christmas

 

Girish Halady

 

0 Kudos
Xilinx Employee
Xilinx Employee
9,009 Views
Registered: ‎09-10-2008

Re: pl330.c DMA driver. Number of channels

Hi Girish,

 

I attached a couple files that may be helpful for this based on some testing I did.  The tar file was a kernel module that was being used in Petalinux.

 

Happy New Year,

John

0 Kudos
Visitor ghalady
Visitor
9,001 Views
Registered: ‎02-12-2014

Re: pl330.c DMA driver. Number of channels

Thanks John,

              Happy New Year to you too.

 

Best

Girish

0 Kudos
Visitor ghalady
Visitor
8,988 Views
Registered: ‎02-12-2014

Re: pl330.c DMA driver. Number of channels

Quick quote, the patch doesn't seem to get applied, I get :

root@GHALADY-PC:/opt/pkg/petalinux-v2014.4-final/components/linux-kernel/xlnx-3.17/drivers/dma# !patch
patch < pl330.c.patch
patching file pl330.c
Hunk #1 FAILED at 1297.
Hunk #2 FAILED at 2850.
2 out of 2 hunks FAILED -- saving rejects to file pl330.c.rej

Sorry about my ignorance, From H/W background picking up the stuff.

Best
Girish
0 Kudos
Xilinx Employee
Xilinx Employee
4,409 Views
Registered: ‎09-10-2008

Re: pl330.c DMA driver. Number of channels

Hi Girish,

That patch was for a 3.14 kernel rather than a 3.17, but it's a real simple patch that I described in the PDF. You should be able to just make the changes to the file manually as the patch file is easy to read.

Thanks
John
0 Kudos