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-cells = <2>;
   #interrupt-cells = <2>;

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.


As meuh suggested, this information should be available in the kernel device tree bindings documentation. However, it might not be obvious what file to look at, so here are some advice:

First check the compatible property string(s) in the interrupt-parent node (i.e. gpio5 in this case). If you are lucky, the documentation will have a list of all compatible property strings that the information relates to, and the file will show up directly when searching for any of these strings.
If this is not the case, you have to browse the documentation directories and look for files with a name similar to the compatible property string. Often the same documentation applies to a range of devices and things like model number have been omitted in the file name. You can also look for older model numbers.

Check relevant subdirectories first (in this case it was located under the "gpio" directory).

Be aware of name changes. For example that Freescale ("fsl") is now owned by NXP, so file names containing both "fsl" and "nxp" might provide useful information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.