Linux – What are the values of the device tree interrupts property

device-treelinux

I'm trying to understand the device tree interrupts property and can not find a good explanation.

For example if there is a node with the following lines:

interrupt-parent = <&gpio5>;
interrupts = <9 0>;

How do I figure out what the magic numbers <9 0> relate to?
Is it a bitmask, gpio port number, pin number, priority, edge or something else?

Theinterrupt-parent node look like this (I guess it would be similar for most ARM devices):

gpio5: gpio@1234 {
   compatible = "fsl,imx7d-gpio", "fsl,imx35-gpio";  
   reg = <0x30240000 0x10000>;  
   interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
           <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
   gpio-controller;
   #gpio-cells = <2>;
   interrupt-controller;
   #interrupt-cells = <2>;
};

Best Answer

You can get some information from the kernel documentation which describes the interrupts property.

It goes on with the example of the OpenPIC interrupt controller which has 2 cells:

The first cell defines the interrupt number. The second cell defines the sense and level information. Sense and level information should be encoded as follows:

  0 = low to high edge sensitive type enabled
  ...

Your case is probably similar, but it often needs you to have intimate knowledge of the chipset and the driver.

Related Question