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 eduardoparra
Participant
3,208 Views
Registered: ‎06-28-2016

Custom IP driver interrupt

Hi,

I have created a custom IP on my hw design on Vivado. The custom ip has 10 interrupts connected to the pl_ps interrupt port on the Zynq using a Concat block. I'm working on Linux so now i need to create a kernel module and a node on the device tree that allow me to get the interrupts signals. Firstly i have create a default driver using the template of petalinux-create module and i have add a node on the pl dtsi with the region of the ip core, but i have no idea of what to do next. Is there any tutorial or could you tell me how to get those interrupts?

Thank you

0 Kudos
2 Replies
Xilinx Employee
Xilinx Employee
3,178 Views
Registered: ‎08-01-2008

Re: Custom IP driver interrupt

you can check these resources
https://www.xilinx.com/support/answers/51138.html
https://www.xilinx.com/support/answers/50572.html
https://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf
https://www.xilinx.com/support/documentation/ip_documentation/processing_system7/v4_00_a/ds871_processing_system7.pdf
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Observer edu30692
Observer
3,166 Views
Registered: ‎11-25-2016

Re: Custom IP driver interrupt

I have create a kernel module to control GPIO leds. I'm working on an zcu102+ evaluation board. This is my device tree:

 / {
    amba_pl: amba_pl {
        #address-cells = <2>;
        #size-cells = <2>;
        compatible = "simple-bus";
        ranges ;
        axi_gpio_0: gpio@80000000 {
            #gpio-cells = <2>;
            #interrupt-cells = <2>;
            compatible = "xlnx,custom-gpio";
            gpio-controller ;
            interrupt-controller ;
            interrupt-parent = <&gic>;
            interrupts = <0 89 0>;
            reg = <0x0 0x80000000 0x0 0x10000>;
            xlnx,all-inputs = <0x0>;
            xlnx,all-inputs-2 = <0x0>;
            xlnx,all-outputs = <0x1>;
            xlnx,all-outputs-2 = <0x0>;
            xlnx,dout-default = <0x00000000>;
            xlnx,dout-default-2 = <0x00000000>;
            xlnx,gpio-width = <0x8>;
            xlnx,gpio2-width = <0x20>;
            xlnx,interrupt-present = <0x1>;
            xlnx,is-dual = <0x0>;
            xlnx,tri-default = <0xFFFFFFFF>;
            xlnx,tri-default-2 = <0xFFFFFFFF>;
        };

};
    
};

 

I have written a device driver an i can turn on /off the leds of my board, but the interrupt on /proc/interrupts does not increase:

           CPU0       CPU1       CPU2       CPU3       
  1:          0          0          0          0     GICv2  29 Edge      arch_timer
  2:       8225       8626       7774       6971     GICv2  30 Edge      arch_timer
 12:          0          0          0          0     GICv2 156 Level     zynqmp-dma
 13:          0          0          0          0     GICv2 157 Level     zynqmp-dma
 14:          0          0          0          0     GICv2 158 Level     zynqmp-dma
 15:          0          0          0          0     GICv2 159 Level     zynqmp-dma
 16:          0          0          0          0     GICv2 160 Level     zynqmp-dma
 17:          0          0          0          0     GICv2 161 Level     zynqmp-dma
 18:          0          0          0          0     GICv2 162 Level     zynqmp-dma
 19:          0          0          0          0     GICv2 163 Level     zynqmp-dma
 20:          0          0          0          0     GICv2 164 Level     Mali_GP_MMU, Mali_GP, Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
198:          0          0          0          0     GICv2  49 Level     cdns-i2c
199:          0          0          0          0     GICv2  50 Level     cdns-i2c
201:          0          0          0          0     GICv2 150 Level     nwl_pcie:misc
206:         15          0          0          0     GICv2  47 Level     ff0f0000.spi
207:          0          0          0          0     GICv2  58 Level     ffa60000.rtc
208:          0          0          0          0     GICv2  59 Level     ffa60000.rtc
209:          0          0          0          0     GICv2 165 Level     ahci-ceva[fd0c0000.ahci]
210:         81          0          0          0     GICv2  81 Level     mmc0
211:          0          0          0          0     GICv2 187 Level     arm-smmu global fault
212:       2267          0          0          0     GICv2  53 Level     xuartps
215:          0          0          0          0     GICv2 154 Level     fd4c0000.dma
216:          0          0          0          0     GICv2 121 Edge      GPIO_AXI_driver
227:          0          0          0          0     GICv2  97 Level     xhci-hcd:usb1

 

The irq of the axi_gpio on Vivado is connected to the pl_ps_irq pin of the MPSoC.

What have i to do to get my interrupt working?

 

I have upload the kernel module without format because it doesn't allow to me.

0 Kudos