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: 
Contributor
Contributor
378 Views
Registered: ‎10-28-2018

How does interrupt nums in hw, sw, dts related?

Jump to solution

Hi guys,

I'v been working with device drivers related to some design in zynq PL. For a single interrupt signal, there are three interrupt numbers related to it.

1. the one in "ug1085 Technical Reference Manual " pg.314 (starts from 121,corresponding to 89 in dtsi):

2. The one in generated " pl.dtsi " in petalinux project:

3. the one used by device driver for calling request_irq() kernel api.

All these three numbers are different from each other.

Any one knows how does these three numbers related to each other?

Is there an algorithm or does it depend on some hardware structure?

How can one get to know this? 

What document or book should one refer to?

Thanks

Appendix:

interrupt number in ug1085 pg314:

Untitled.jpg 

interrupt number in pl.dtsi: 

 

Capture.JPG

interrupt in device driver:

[just another number not equal to previous two]

 

Regards,
Kang
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
247 Views
Registered: ‎06-03-2015

Re: How does interrupt nums in hw, sw, dts related?

Jump to solution

The no . provided by you (89) is hardware supported number.

Hi

Flow of IRQ Subsystem is as follows:

request_irq() -> struct irq_chip-> IRQ Domain mapping (Linear map/Tree map etc.)-> IRQ chip GPIO controller -> SoC -> GIC

89 is one taking care by GIC in hardware level.

when it is come to Linux, its no. changes and you can print the same using request_irq()  first argument.

request_irq () returns 59 is IRQ no. generated by Linux Irq sub system

 89 is IRQ no. provided by hardware IRQ Controller.

In between Linux IRQ sub system & Hardware IRQ Controller , IRQ Domain mapping present which will map Linux generated IRQ no. hardware supported IRQ No.

now 89 becomes 121 becuase this I/O is Shared Peripheral interrupt , these are added with +32 provide in .dts irq no.s

so 89+32=121

  so final IRQ no. is 121

Note: If it is Private Periphral Interrupt, it will be same as dts IRQ no.

Provide Kudos if the reply is helpful

Thanks & Regards

Satish G

 

 

Thanks & Regards

Satish G

G Satish Kumar
4 Replies
Moderator
Moderator
300 Views
Registered: ‎12-04-2016

Re: How does interrupt nums in hw, sw, dts related?

Jump to solution

Hi Kang

If I can understand query correctly, you are interested in knowing the device tree interrupt property in brief. If thats correct, here is the interpretation:

The first value is a flag indicating if the interrupt is an SPI (shared peripheral interrupt). A nonzero value means it is an SPI.

The second value is the interrupt number.

The third value is the type of interrupt. Edge Triggered (1) or level sensitive (4)

 

Let me know if your query is different

 

Best Regards

Shabbir

0 Kudos
Contributor
Contributor
266 Views
Registered: ‎10-28-2018

Re: How does interrupt nums in hw, sw, dts related?

Jump to solution

Hi,  @shabbirk 

Thank you, but this seems not my question's answer.

So,

In my work, when writing a driver, the request_irq() api interface takes a paramter of iterrupt number, let's say, for example, 59 (I logged this number with the code below).

irq.JPG

And the irq number in dts, for example, interrupts=<0 89 4>, the number is 89

And that number is actually related to the interrupt number described in ug1085 document, which is 121

My question is about the three interrupt numbers: 59 ( for use in request_irq API ) and 89 ( generated in dts file) and 121 ( in manual ).

How does these three related and what's the difference?

Thank you

Regards,
Kang
0 Kudos
Highlighted
Explorer
Explorer
248 Views
Registered: ‎06-03-2015

Re: How does interrupt nums in hw, sw, dts related?

Jump to solution

The no . provided by you (89) is hardware supported number.

Hi

Flow of IRQ Subsystem is as follows:

request_irq() -> struct irq_chip-> IRQ Domain mapping (Linear map/Tree map etc.)-> IRQ chip GPIO controller -> SoC -> GIC

89 is one taking care by GIC in hardware level.

when it is come to Linux, its no. changes and you can print the same using request_irq()  first argument.

request_irq () returns 59 is IRQ no. generated by Linux Irq sub system

 89 is IRQ no. provided by hardware IRQ Controller.

In between Linux IRQ sub system & Hardware IRQ Controller , IRQ Domain mapping present which will map Linux generated IRQ no. hardware supported IRQ No.

now 89 becomes 121 becuase this I/O is Shared Peripheral interrupt , these are added with +32 provide in .dts irq no.s

so 89+32=121

  so final IRQ no. is 121

Note: If it is Private Periphral Interrupt, it will be same as dts IRQ no.

Provide Kudos if the reply is helpful

Thanks & Regards

Satish G

 

 

Thanks & Regards

Satish G

G Satish Kumar
Moderator
Moderator
217 Views
Registered: ‎04-24-2017

Re: How does interrupt nums in hw, sw, dts related?

Jump to solution

Hi @hu_kang,

Whatever @gsatish10 is correct in older version of TRM we had a section describing this not sure why they removed it.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------