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: 
Participant rhobincu
Participant
10,188 Views
Registered: ‎07-10-2014

Linux VDMA driver unable to request IRQ

Hello,

 

I am trying to add a AXI VDMA core to an FPGA video pipeline. I'm using a Zedboard which is running a 3.14 linux kernel with Ubuntu core RootFS.

 

root@localhost:~# uname -a
Linux localhost.localdomain 3.14.0-xilinx #8 SMP PREEMPT Thu Oct 30 17:12:07 EET 2014 armv7l armv7l armv7l GNU/Linux

 

My problem is that Linux complains about not being able to request an IRQ for the device.

 

This is my device tree entry for the core:

axi_vdma_0: axivdma@43000000 {
    compatible = "xlnx,axi-vdma";
    #dma_cells = <1>;
    reg = < 0x43000000 0x10000 >;
    xlnx,num-fstores = <0x1>;
    xlnx,flush-fsync = <0x1>;
    dma-channel@43000000 {
        compatible = "xlnx,axi-vdma-mm2s-channel";
        interrupts = < 0 56 4 >;
        xlnx,datawidth = <0x10>;
        xlnx,device-id = <0>;
    } ;
    dma-channel@43000030 {
        compatible = "xlnx,axi-vdma-s2mm-channel";
        interrupts = < 0 55 4 >;
        xlnx,datawidth = <0x10>;
        xlnx,device-id = <0>;
    } ;
} ;

 

This is the entry in the mhs file:

BEGIN axi_vdma
 PARAMETER INSTANCE = axi_vdma_0
 PARAMETER HW_VER = 5.04.a
 PARAMETER C_NUM_FSTORES = 1
 PARAMETER C_M_AXIS_MM2S_TDATA_WIDTH = 16
 PARAMETER C_S_AXIS_S2MM_TDATA_WIDTH = 16
 PARAMETER C_BASEADDR = 0x43000000
 PARAMETER C_HIGHADDR = 0x4300ffff
 BUS_INTERFACE S_AXI_LITE = axi_interconnect_1
 BUS_INTERFACE M_AXI_MM2S = axi_interconnect_2
 BUS_INTERFACE M_AXI_S2MM = axi_interconnect_2
 BUS_INTERFACE S_AXIS_S2MM = v_tpg_0_M_AXIS_VIDEO
 BUS_INTERFACE M_AXIS_MM2S = axi_vdma_0_M_AXIS_MM2S
 PORT s_axi_lite_aclk = processing_system7_0_FCLK_CLK0
 PORT m_axi_mm2s_aclk = processing_system7_0_FCLK_CLK0
 PORT m_axi_s2mm_aclk = processing_system7_0_FCLK_CLK0
 PORT m_axis_mm2s_aclk = processing_system7_0_FCLK_CLK0
 PORT s_axis_s2mm_aclk = processing_system7_0_FCLK_CLK0
 PORT mm2s_fsync = v_tc_0_fsync_out
 PORT s2mm_fsync = v_tc_0_fsync_out
 PORT mm2s_introut = axi_vdma_0_mm2s_introut
 PORT s2mm_introut = axi_vdma_0_s2mm_introut
END

 This is how the interrupts are set in XPS:

Interrupts

 

In this configuration, the output provided by the kernel during boot looks like this:

root@localhost:~# dmesg |grep vdma
[    0.646010] xilinx-vdma 43000000.axivdma: Probing xilinx axi vdma engine
[    0.652590] xilinx-vdma 43000000.axivdma: unable to request IRQ
[    0.658544] xilinx-vdma: probe of 43000000.axivdma failed with error -22

 I also tried adding a reference to the interrupt controller for both channels:

axi_vdma_0: axivdma@43000000 {
    compatible = "xlnx,axi-vdma";
    #dma_cells = <1>;
    reg = < 0x43000000 0x10000 >;
    xlnx,num-fstores = <0x1>;
    xlnx,flush-fsync = <0x1>;
    dma-channel@43000000 {
        compatible = "xlnx,axi-vdma-mm2s-channel";
        interrupt-parent = <&ps7_scugic_0>;
        interrupts = < 0 56 4 >;
        xlnx,datawidth = <0x10>;
        xlnx,device-id = <0>;
    } ;
    dma-channel@43000030 {
        compatible = "xlnx,axi-vdma-s2mm-channel";
        interrupt-parent = <&ps7_scugic_0>;
        interrupts = < 0 55 4 >;
        xlnx,datawidth = <0x10>;
        xlnx,device-id = <0>;
    } ;
} ;

 In this case, the kernel crashes during boot when trying to dereference virtual address 0.

 

I tried looking over the vdma module and error -22 is thrown when calling function request_irq... and that's as far as I got. If anyone sees an obvious mistake, I'd appreciate some feedback.

 

Thanks,

R.

 

 

0 Kudos
11 Replies
Xilinx Employee
Xilinx Employee
10,183 Views
Registered: ‎09-10-2008

Re: Linux VDMA driver unable to request IRQ

Hi,

 

Nothing is jumping out at me as being wrong.  Have you looked at /proc/interrupts after it's up without the VDMA node in the tree to make sure one of those interrupts is not already taken for some reason?

 

Thanks

John

0 Kudos
Participant rhobincu
Participant
10,181 Views
Registered: ‎07-10-2014

Re: Linux VDMA driver unable to request IRQ

Hi,

 

Thanks for the quick reply. Here's the contents of /proc/interrupts, it doesn't seem like they're used:

 

root@localhost:~# cat /proc/interrupts 
           CPU0       CPU1       
 29:      10414      10817       GIC  29  twd
 39:         43          0       GIC  39  f8007100.ps7-xadc
 43:     512971          0       GIC  43  ttc_clockevent
 45:          0          0       GIC  45  f8003000.ps7-dma
 46:          0          0       GIC  46  f8003000.ps7-dma
 47:          0          0       GIC  47  f8003000.ps7-dma
 48:          0          0       GIC  48  f8003000.ps7-dma
 49:          0          0       GIC  49  f8003000.ps7-dma
 53:          0          0       GIC  53  zynq-udc
 54:       8842          0       GIC  54  eth0
 56:      10379          0       GIC  56  mmc0
 57:          0          0       GIC  57  cdns-i2c
 72:          0          0       GIC  72  f8003000.ps7-dma
 73:          0          0       GIC  73  f8003000.ps7-dma
 74:          0          0       GIC  74  f8003000.ps7-dma
 75:          0          0       GIC  75  f8003000.ps7-dma
 80:         85          0       GIC  80  cdns-i2c
 82:         66          0       GIC  82  xuartps
146:          1          0  zynq-gpio  50  pb1
147:          1          0  zynq-gpio  51  pb2
152:          0          0  zynq-gpio  56  btnu
153:          0          0  zynq-gpio  57  btnd
154:          0          0  zynq-gpio  58  btnl
155:          0          0  zynq-gpio  59  btnr
156:          0          0  zynq-gpio  60  btnc
IPI1:          0      22330  Timer broadcast interrupts
IPI2:       8232       9725  Rescheduling interrupts
IPI3:          0          0  Function call interrupts
IPI4:         50         65  Single function call interrupts
IPI5:          0          0  CPU stop interrupts
IPI6:        817        979  IRQ work interrupts
IPI7:          0          0  completion interrupts
Err:          0

 

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

Re: Linux VDMA driver unable to request IRQ

If you are confident the flow is working (building with your device tree) this is likely a waste of time. Thinking out loud.

Build the driver as a module, then before inserting the module take a quick l look at /proc/device-tree to make sure the DMA nodes agree with what you believe should be in the device tree.
0 Kudos
Participant rhobincu
Participant
10,170 Views
Registered: ‎07-10-2014

Re: Linux VDMA driver unable to request IRQ

OK, I can try that, however, I'm curious if the interrupt-parent property should be placed in the channel node or not. 

 

Thanks!

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

Re: Linux VDMA driver unable to request IRQ

That's an interesting question. I'm using AXI DMA, not VDMA, but very similar but the device trees out of the generator have not been good for quite some time (will be in next release) and I've been hacking on them to get them to work. My device tree that is working has the interrupt parent in the channel and in the higher non-channel also. It's worth trying and I'm looking at the code more.

My other thought was to go head an put a few printks on down in the kernel thru those calls to see what's failing. I find I can talk about it a lot longer than it takes to just instrument it and see where it's failing.
0 Kudos
Xilinx Employee
Xilinx Employee
10,152 Views
Registered: ‎09-10-2008

Re: Linux VDMA driver unable to request IRQ

Looking at other examples and the code it appears like it should be fine to have the interrupt parent in the channel to me.
0 Kudos
Participant rhobincu
Participant
10,126 Views
Registered: ‎07-10-2014

Re: Linux VDMA driver unable to request IRQ

Hi John,

 

I'm back with a plot twist: it works fine on a Rev. D Zedboard with the interrupt parent placed in the channel node. On a Rev. C board however, the kernel fails to boot while trying to dereference virtual address 0:

 

[    0.701933] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    0.701933] pgd = c0004000
[    0.701933] [00000000] *pgd=00000000

 

This happends when calling function "dma_async_device_register". I will stop trying to debug the issue and continue to work on the more recent board. 

 

A last question if I may: I'm unsure how to program this VDMA from linux. Are there any example I could look at?

 

Thank you,

Radu

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

Re: Linux VDMA driver unable to request IRQ

Hi Radu,

 

Here is a thread where I attached some PDFs about Linux DMA, take a look at that.

 

http://forums.xilinx.com/t5/Embedded-Linux/AXI-DMA-with-Zynq-Running-Linux/m-p/522755/highlight/true#M10649

 

Another option is to use the UIO framework with it such that you do most of the work from user space.  If your kernel experience is low this might be a better option. Here's another thread where I posted some code and a PDF for that.

 

http://forums.xilinx.com/t5/Embedded-Linux/mmap-problems-device-tree-problem/m-p/523043/highlight/true#M10655

 

Again, my work has been with AXI DMA, but AXI VDMA is very similar and in the kernel in the same way such that the Linux DMA Engine works with it also.  I believe the real difference would be some of the cyclic type modes that are needed for video.

 

Best of luck,

John

Participant rhobincu
Participant
10,105 Views
Registered: ‎07-10-2014

Re: Linux VDMA driver unable to request IRQ

Hi John,

 

Using the UIO means that I don't need the axi vdma driver, right? Also, does UIO support interrupts? I'm trying to use this VDMA as a frame buffer to align two streams (actually there are 2 VDMAs).

 

Thanks,

Radu

0 Kudos
Xilinx Employee
Xilinx Employee
5,718 Views
Registered: ‎09-10-2008

Re: Linux VDMA driver unable to request IRQ

Hi Radu,

Yes you're right, you would not be using the AXI VMDA driver with UIO. You could use the standalone BSP driver from the UIO such that you don't need to write a lot of new code.

UIO does support interrupts but with some limitations as they are handled by a kernel driver then passed on to user space thru the file descriptor. This may not be ideal for all applications.

Thanks,
John
0 Kudos
Participant rhobincu
Participant
5,709 Views
Registered: ‎07-10-2014

Re: Linux VDMA driver unable to request IRQ

Alright, thank you very much for the assistance.

 

To conclude this, for future reference:

 

  • The "interrupt-parent" property must be present in the channel node, in the VDMA device tree entry, although that is not obvious from the wiki or the git examples;
  • There is an elusive problem with revision C Zedboards and the Xilinx VDMA IP core which prevents Linux from booting properly.

Thanks,

Radu

 

0 Kudos