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: 
Explorer
Explorer
7,980 Views
Registered: ‎07-09-2012

xfifo-dma pl330 example DMA fault at runtime.

Hello,

 

I am able to build and insmod the xfifo-dma.ko example driver per the instructions in the 

http://wiki.xilinx.com/zynq-linux-pl330-dma

wiki article.  

 

The addresses are correclly read from the device tree as can be seen from the diagnostics printed when I load the driver.

 

When I try the test  "dd if=/dev/urandom bs=2048 count=1 of=/dev/fifo-dma0"

 

I receive a fault "DMA fault type 0x20000 at address 0x2e196021 on channel 1"

 

the PL300 documentation indicates the 0x20000 bit is data write error.

 

The /proc/driver/xfifl_dma status shows the correct number of opens and writes but 0 bytes written.  This is correct due to the faults.

 

Any thoughts on what would cause this?

 

Thanks

 

 Dave

 

0 Kudos
13 Replies
Observer s381168
Observer
7,895 Views
Registered: ‎02-09-2013

Re: xfifo-dma pl330 example DMA fault at runtime.

You've gotten a little bit farther than I have.

When I try to start the DMA with the dd command, it just hangs on me.

I can control-C out of it, though.

 

Do you happen to know how one would invoke this DMA in actual source code ?  The example gives a file operation that can be given from a command line, however, what I'm really interested in is performing writes and reads to the PL from a application.

 

0 Kudos
Xilinx Employee
Xilinx Employee
7,893 Views
Registered: ‎11-12-2007

Re: xfifo-dma pl330 example DMA fault at runtime.

The PL330 is probably not what you want for general reads and writes to PL peripherals from a user application. To simplify the process of creating a driver under Linux you might want to look into using either /dev/mem or UIO wrappers.

 

--Rob

0 Kudos
Observer s381168
Observer
7,888 Views
Registered: ‎02-09-2013

Re: xfifo-dma pl330 example DMA fault at runtime.

Oh, why is that?

DMAs free up the processor so I can do other stuff.

Do you not think the DMA engine is worthy of transferring this way?

 

/dev/mem method, you mean mapping the address to virtual space and using processor to to the reading?

 

I eagerly await your response, as the dma sounded like a good option.

 

0 Kudos
Observer s381168
Observer
7,885 Views
Registered: ‎02-09-2013

Re: xfifo-dma pl330 example DMA fault at runtime.

Rob, what I'm interested in doing is moving stuff from a device in PL (A fifo) into a DDR buffer somewhere.

If you know of a good way to do this that doesn't drag down the processor too much and is not too slow, you could help me out a lot.

0 Kudos
Xilinx Employee
Xilinx Employee
7,861 Views
Registered: ‎11-12-2007

Re: xfifo-dma pl330 example DMA fault at runtime.

I don't mean that the PL330 isn't a good DMA engine, just that there are a lot of other options out there as well. There's some overhead that goes into configuring the PL330 it that goes beyond what you'd find in a less programmable DMA engine and you would probably have to write a driver for it yourself - the driver that I put up on the Wiki site is really just an example. It's not really a general-purpose implementation, so outside of its specific application (transferring blocks of data to the AXI MM2S FIFO core) you'd have to modify it on your own.

 

There are a few other options that you might want to look into, including the AXI Central DMA, AXI Video DMA, etc. depending on the specifics of what you're trying to do. Those can bolt directly onto the HP ports in the PS block giving you direct, high-bandwidth access to DDR from the PL. 

 

Depending on your level of comfort with HDL coding, you could even build a (very) lightweight AXI master interface and connect it to the HP port yourself, depending on the complexity of your use case.

 

--Rob

0 Kudos
Observer s381168
Observer
7,855 Views
Registered: ‎02-09-2013

Re: xfifo-dma pl330 example DMA fault at runtime.

Ok Rob,

I appreciate the response.  It does seem somehwat involved to set up a transfer.

I will look into the AXI DMA and other cores that could be set up in the PL.

My main concern was on the SW side, working in a Linux environment, what would be the easiest, most efficient way to get data from PL to DDR where PS can access it, without having to deal with the whole driver aspect of it.

0 Kudos
Observer s381168
Observer
7,833 Views
Registered: ‎02-09-2013

Re: xfifo-dma pl330 example DMA fault at runtime.

Rob,
Is it similar code to implement the axi dma driver?
One question i have is who defines and fills out pdev in your example driver?
0 Kudos
Xilinx Employee
Xilinx Employee
7,822 Views
Registered: ‎11-12-2007

Re: xfifo-dma pl330 example DMA fault at runtime.

The information in pdev comes from either the DTS file or the platform configuration structure. For Zynq, most (if not all) of the platform configuration is done via the DTS file these days.

 

The AXI DMA driver works differently from the PL330 DMA, but to be honest I haven't had the opportunity to use it much yet so unfortunately I don't have much guidance to offer here. One of the other members of the forum may have more experience with it.

 

-Rob

0 Kudos
Explorer
Explorer
7,739 Views
Registered: ‎07-09-2012

Re: xfifo-dma pl330 example DMA fault at runtime.

Hello visitor,

 

It sounds like you want to do exactly what I need to do, get a lot of data from the PL to the PS or PS to the PL efficiently, without burdening the CPU.  I don't think the PL330 has been fully tested and I haven't heard of anyone successfully using it. I have searched....

 

 I have spent way too much time trying to get it to work.  I have been able to get it to "almost" work, except that the wrong number of bytes acually get transfered.  Program the DMAC to xfer 100 bytes and 105 actually get written!!  Further, you can't create and setup the dma channel from wihtin in an ISR.  A read_dma() routine that works when called from normal driver space can't be called from an ISR.  Go figure.

 

I have a driver implementation limping along currently using the CPU to read out of the FIFO word by word.  It is incredibly ineffient and we can't seem to get any guidance from Xilinx or their support on the best way to do this.  This is incredible since one would think this very thing the zynq would be used for.

 

Let me know if you find a reasonable solution.

 

- Dave

0 Kudos
Scholar vanmierlo
Scholar
3,833 Views
Registered: ‎06-10-2008

Re: xfifo-dma pl330 example DMA fault at runtime.

Hi,

 

I'm looking for exactly the same. I need to transfer data from the PS to the PL and back, preferably through a FIFO in the PL. But it is very unclear what is the best way to implement this.

 

Maarten

0 Kudos
Contributor
Contributor
3,763 Views
Registered: ‎12-24-2009

Re: xfifo-dma pl330 example DMA fault at runtime.

The same use case here as well.  We have a cpu intnesive mem map driver working, but we need 2x-10x faster transfer.

 

Gudience would be great.

0 Kudos
Explorer
Explorer
3,754 Views
Registered: ‎10-25-2011

Re: xfifo-dma pl330 example DMA fault at runtime.

This (and other very similar) thread/s have been on for several months and the moment questions about drivers appear, well, questions are all that seem to appear from then on. Is anyone at Xilinx even reading these and listening to customers? Because this isn't Stack Overflow where people do users a favor. We paid for these products and demand some support for that money. 

 

If we are going to spend two months on setting this platform up before useful work can begin, this is a serious fail on Xilinx's part.

 

Here's a really good product/SoC... oh by the by, you'll need a few months before you can use it so make sure you tell the guys that fund you to take that extra time into account... it's on us.

0 Kudos
Explorer
Explorer
3,744 Views
Registered: ‎07-09-2012

Re: xfifo-dma pl330 example DMA fault at runtime.

I am afraid we could never get the PL330 DMA working.  As far as I can tell there are no actual working examples available and no one has ever made the statement that they successfully implemented a PL330 driver.  (Someone must have though since it is listed in the /proc/interrrups catalog...)  I agree this is a Xilinx deficiency...

 

Anyway, we saw no successful end in sight for the PL330 driver so we shifted gears to use the AXI DMA IP Core (6.03) and are nearing completion with that.  We are using it in simple mode (not scatter gather).   Note that we were forced to put a FIFO in front of the DMA Core as the core would drop a packet at the beginning of the PL->PS transfer.  

 

I hope this helps.

 

Regards,

 

Dave

0 Kudos