Support has responded to me via e-mail. I'll add some notes here, so I can find the information in one place later.
Here's the output from my /proc/interrupts when I connect to IRQ5, specifying irq 121 in the device tree. I'm using the gpio-keys module on a PCA9555 gpio expander.
Here's the portion of the device tree:
{ /* drivers/gpio/gpio-pca953x.c */ compatible = "nxp,pca9555"; pinctrl-names = "default"; // interrupts = <123>; /* CN5 B21, aka IRQ7 */ // interrupts = <122>; /* CN5 B22, aka IRQ6 */ interrupts = <121>; /* CN5 B23, aka IRQ5 */ gpio-controller; #gpio-cells = <2>; base = <192>; interrupt-controller; #interrupt-cells = <2>; reg = <0x22>; status = "okay"; }
I did have to modify the pca9555 driver to use the device tree entries.
root@n-p1080:~# cat /proc/interrupts CPU0 CPU1 17: 112819 116475 GIC 29 Edge twd 18: 0 0 armada_370_xp_irq 5 Level armada_370_xp_per_cpu_tick 21: 1002 24864 GIC 34 Level mv64xxx_i2c 22: 783 548 GIC 44 Level serial 36: 291 64 armada_370_xp_irq 8 Level eth0 37: 0 0 GIC 50 Level ehci_hcd:usb1 107: 2 0 GIC 97 Level f1060900.xor 121: 23 0 armada_370_xp_msi_irq 13 Edge 1-0022 126: 1 0 pca953x 2 Edge GPIO Key UP 127: 0 0 pca953x 3 Edge GPIO Key DOWN 128: 2 0 pca953x 4 Edge GPIO Key RIGHT 129: 2 0 pca953x 5 Edge GPIO Key LEFT IPI0: 0 1 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 5071 3447 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 11 61 Single function call interrupts IPI5: 0 0 CPU stop interrupts IPI6: 0 0 IRQ work interrupts IPI7: 0 0 completion interrupts Err: 0 root@n-p1080:~#
I can get interrupt activity when I twiddle the B23 pin on the
PC104 header. I do have a separate problem with the PCA9555
hardware I'm using, the INT output on that chip doesn't work, so
the interrupt counts don't add up - the counts from the
pca953x should add up to the count on irq 121.
Changing the device tree to use irq 124 returns an EINVAL (-22) during initialization:
If I specify irq 123, initialization succeeds, and I can twiddle B21 (IRQ7) to see counts in the /proc/interrupts. This is after pressing the 'UP' key and releasing it. The keypad driver appropriately generated key-down and key-up events.
root@n-p1080:~# cat /proc/interrupts CPU0 CPU1 17: 26533 25897 GIC 29 Edge twd 18: 0 0 armada_370_xp_irq 5 Level armada_370_xp_per_cpu_tick 21: 1002 4752 GIC 34 Level mv64xxx_i2c 22: 706 275 GIC 44 Level serial 36: 196 3 armada_370_xp_irq 8 Level eth0 37: 0 0 GIC 50 Level ehci_hcd:usb1 107: 2 0 GIC 97 Level f1060900.xor 123: 366 0 armada_370_xp_msi_irq 15 Edge 1-0022 126: 2 0 pca953x 2 Edge GPIO Key UP 127: 0 0 pca953x 3 Edge GPIO Key DOWN 128: 0 0 pca953x 4 Edge GPIO Key RIGHT 129: 0 0 pca953x 5 Edge GPIO Key LEFT IPI0: 0 1 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 3869 3072 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 22 47 Single function call interrupts IPI5: 0 0 CPU stop interrupts IPI6: 0 0 IRQ work interrupts IPI7: 0 0 completion interrupts Err: 0 root@n-p1080:~#
It really looks like irq number 123 is IRQ7 pin and irq number 121 is IRQ5 pin.
New information: I rebuilt the original kernel and added a little driver to show which interrupt was triggered from the PC104 header. The interrupts in that build are as documented, so my original issue is a non-issue.
it appears that because I disabled SATA in my device tree the interrupt that it used is now used by the next device asking for an interrupt. By the time my i2c device is asking for an interrupt, the PC104 irq numbers are indeed different from documentation.
I suppose that detail could be noted in the board manual. "Disabling peripherals in the device tree file will cause interrupt numbers to be different from that documented here."
Sorry for the bother!
Tim Braun
Hello, Techno-folk
We've got a system design using the ts7800v2 and we are planning to use some interrupts from the ISA / GPIO system for our custom peripherals.
There are some challenges with this.
1. Attempting to use irq number 124 in a driver fails. It seems (from the boot messages) that interrupts up to 123 are supported by the 4.4.186 linux kernel supplied for the board. The manual references irq's from 109 to 124, while the boot messages reference irq's 108 to 123. Is this a documentation error?
2. I'd like to use the device tree to allocate my irq to the gpio expander that we're adding to the system. There doesn't seem to be any way to specify an 'interrupt-parent' that works for the irq 122. I have a work-around for this by side-stepping the open firmware interrupt allocation framework for these interrupts. I would still appreciate comment on accessing the msi irq's from the device tree. Is there a way to do that?