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 kallensf
Participant
721 Views
Registered: ‎07-31-2017

ZCU102 linux platform driver, interrupt handler examples

Jump to solution

I'm used to older kernels where the IRQ argument passed to request_irq( ) is just the cpu's IRQ number + some constant offset.  I've heard that the newer kernels now map the chip's IRQ numbers dynamically and I have to obtain it from the device tree using a platform driver. 

 

I'm using petalinux 2017.4 on a zcu102.  Does anyone know of a simple example of a platform driver  for the zcu102, preferably one that obtains the IRQ number from the device tree to pass to request_irq()?  Thanks!

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
661 Views
Registered: ‎06-27-2017

Re: ZCU102 linux platform driver, interrupt handler examples

Jump to solution

Hi @kallensf,

You can refer Xilinx GPIO driver and you can find device tree summary i2c xilinx wiki

it uses Platform driver ""drivers/i2c/busses/i2c-cadence.c"" and when compatible name(xps-iic-2.00.a  is matched then it will parse the device tree node mentioned in below,

i2c@81600000 {
    compatible = "xlnx,xps-iic-2.00.a";
    interrupt-parent = <&xps_intc_0>;
    interrupts = <0x0 0x11 0x4>;
    #address-cells = <1>;
    #size-cells = <0>;
 

 

where interrupts = <0x0 0x11 0x4> where 

first number represents category of interrupt (SPI or not)

second number is interrupt ID

third number is type of interrupt(edge or level trigger).
you can get description about interrupts member in device tree node in below wiki tutorial

http://xillybus.com/tutorials/device-tree-zynq-4 

 

 

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.

View solution in original post

0 Kudos
1 Reply
Moderator
Moderator
662 Views
Registered: ‎06-27-2017

Re: ZCU102 linux platform driver, interrupt handler examples

Jump to solution

Hi @kallensf,

You can refer Xilinx GPIO driver and you can find device tree summary i2c xilinx wiki

it uses Platform driver ""drivers/i2c/busses/i2c-cadence.c"" and when compatible name(xps-iic-2.00.a  is matched then it will parse the device tree node mentioned in below,

i2c@81600000 {
    compatible = "xlnx,xps-iic-2.00.a";
    interrupt-parent = <&xps_intc_0>;
    interrupts = <0x0 0x11 0x4>;
    #address-cells = <1>;
    #size-cells = <0>;
 

 

where interrupts = <0x0 0x11 0x4> where 

first number represents category of interrupt (SPI or not)

second number is interrupt ID

third number is type of interrupt(edge or level trigger).
you can get description about interrupts member in device tree node in below wiki tutorial

http://xillybus.com/tutorials/device-tree-zynq-4 

 

 

Best Regards
Kranthi
--------------------------
Don't forget to reply, kudo, and accept as solution.

View solution in original post

0 Kudos