Definition of : IRQ (interrupt request)
An IRQ (interrupt request) value is an assigned location in memory where the computer can expect a particular device to interrupt it when the device sends the computer signals about its operation.
Note that communication via Interrupts is a one way process (Device to Computer) !
For example, when a printer has finished printing, it sends an interrupt signal to the computer. The signal momentarily interrupts the computer so that it can decide what processing to do next.
Since multiple signals to the computer on the same interrupt line might not be understood by the computer, a unique value must be specified for each device and its path to the computer.
Prior to Plug-and Play (PnP) devices, users often had to set IRQ values manually (or be aware of them) when adding a new device to a computer.
If you add a device that does not support Pnp, the manufacturer will hopefully provide explicit directions on how to assign IRQ values for it. If you don’t know what IRQ value to specify, you’ll probably save time by checking the manufacturers web site or calling their technical support phone number for the device and asking them.
LINUX OS and IRQ’s
Linux keeps a map of all allocated IRQ’s in the /proc/interrupts file. You can view this file using an editor or use the following command to output its content to a terminal.
cat /proc/interrupts
as an example I have listed and saved the /proc/interrupts file from different computer systems, these being a (Toshiba L300 laptop, Radxa rock board and Raspberry pi( B+, B2 and B3)). You can see from the below listings that each type of system has very different devices installed and that some systems contain more helpful details in this “interrupts” file than others.
The Raspberry Pi systems for example show the starting memory address for the GPIO interrupts, yet the Radxa rock system only shows you the IRQ numbers for the configured GPIO devices that are using IRQ’s.
The below details then at the very least can help you see that you will have a very different path to take when it comes to writing code to control the same type of hardware on different devices, such as GPIO input and output hardware (LED’s for example !).
IRQ’s for a Toshiba L300
IRQ Num, CPU0, CPU1, details
0: 1608280 84979 IO-APIC-edge timer
1: 5054 109 IO-APIC-edge i8042
8: 0 1 IO-APIC-edge rtc0
9: 37955 82 IO-APIC-fasteoi acpi
12: 1950 68 IO-APIC-edge i8042
16: 0 0 IO-APIC-fasteoi uhci_hcd:usb3, uhci_hcd:usb7
18: 0 0 IO-APIC-fasteoi uhci_hcd:usb8
19: 0 0 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb6
21: 0 0 IO-APIC-fasteoi uhci_hcd:usb4
23: 104886 4581 IO-APIC-fasteoi ehci_hcd:usb2, uhci_hcd:usb5
42: 298749 54 PCI-MSI-edge eth4
43: 97179 17118 PCI-MSI-edge ahci
44: 240576 624194 PCI-MSI-edge i915
45: 27 30 PCI-MSI-edge snd_hda_intel
NMI: 14 20 Non-maskable interrupts
LOC: 705389 1336849 Local timer interrupts
SPU: 0 0 Spurious interrupts
PMI: 14 20 Performance monitoring interrupts
IWI: 32832 32161 IRQ work interrupts
RTR: 0 0 APIC ICR read retries
RES: 381401 345539 Rescheduling interrupts
CAL: 215 829 Function call interrupts
TLB: 240504 200521 TLB shootdowns
TRM: 0 0 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 50 50 Machine check polls
ERR: 0
MIS: 0
IRQ’s for the Radxa Rock development board
IRQ num, CPU0, CPU1, CPU2, CPU3, details
32: 221 0 0 0 GIC rk29-pl330.1
33: 0 0 0 0 GIC rk29-pl330.1
34: 53855 0 0 0 GIC rk29-pl330.2
35: 0 0 0 0 GIC rk29-pl330.2
38: 0 0 0 0 GIC bvalid
41: 0 0 0 0 GIC vepu
42: 0 0 0 0 GIC vdpu
43: 0 0 0 0 GIC rk3066b-camera
46: 60525 0 0 0 GIC rk30-lcdc.1
48: 3565 0 0 0 GIC dwc_otg, dwc_otg_hcd:usb1, dwc_otg_pcd
49: 3970695 0 0 0 GIC dwc_otg, host20_hcd:usb2
51: 1753 0 0 0 GIC eth0
55: 41944 0 0 0 GIC rk29_sdmmc.0
57: 2 0 0 0 GIC emmc
58: 4804 0 0 0 GIC rk30-adc
71: 0 0 0 0 GIC rk29xx_spim
72: 0 0 0 0 GIC rk30_i2c.0
73: 8420 0 0 0 GIC rk30_i2c.1
74: 4176 0 0 0 GIC rk30_i2c.2
75: 121 0 0 0 GIC rk30_i2c.3
76: 21176 0 0 0 GIC rk_timer0
77: 0 6426 0 0 GIC rk_timer1
84: 596 0 0 0 GIC rk30_i2c.4
91: 0 0 4959 0 GIC rk_timer2
92: 0 0 0 6607 GIC rk_timer3
95: 0 0 0 0 GIC rga
112: 0 0 0 0 GIC debug-signal
164: 0 0 0 0 GPIO play
165: 0 0 0 0 GPIO bt_default_wake_host_irq
170: 27 0 0 0 GPIO remotectl
173: 0 0 0 0 GPIO rtc_hym8563
FIQ: fiq_glue
IPI0: 0 0 0 0 Timer broadcast interrupts
IPI1: 4559 4984 4185 7763 Rescheduling interrupts
IPI2: 19 32 32 28 Function call interrupts
IPI3: 17 59 232 98 Single function call interrupts
IPI4: 0 0 0 0 CPU stop interrupts
IPI5: 0 0 0 0 CPU backtrace
LOC: 0 0 0 0 Local timer interrupts
Err: 0
IRQ table for the Raspberry Pi B+
IRQ num, CPU0, details
3: 18089 ARMCTRL 3 Edge BCM2708 Timer Tick
16: 0 ARMCTRL 16 Edge bcm2708_fb dma
32: 138475 ARMCTRL 32 Edge dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
49: 0 ARMCTRL 49 Edge 20200000.gpio:bank0
50: 0 ARMCTRL 50 Edge 20200000.gpio:bank1
65: 16 ARMCTRL 65 Edge 2000b880.mailbox
66: 2 ARMCTRL 66 Edge VCHIQ doorbell
75: 1 ARMCTRL 75 Edge
77: 5535 ARMCTRL 77 Edge DMA IRQ
82: 746 ARMCTRL 82 Edge mmc0
83: 5 ARMCTRL 83 Edge uart-pl011
FIQ: usb_fiq
Err: 0
IRQ table for the Raspberry Pi B 2
IRQ num, CPU0, CPU1, CPU2, CPU3, details
16: 0 0 0 0 ARMCTRL 16 Edge bcm2708_fb dma
20: 0 0 0 0 ARMCTRL 20 Edge DMA IRQ
21: 0 0 0 0 ARMCTRL 21 Edge DMA IRQ
32: 106364 0 0 0 ARMCTRL 32 Edge dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
49: 0 0 0 0 ARMCTRL 49 Edge 3f200000.gpio:bank0
50: 0 0 0 0 ARMCTRL 50 Edge 3f200000.gpio:bank1
65: 36 0 0 0 ARMCTRL 65 Edge 3f00b880.mailbox
66: 2274 0 0 0 ARMCTRL 66 Edge VCHIQ doorbell
75: 1 0 0 0 ARMCTRL 75 Edge
77: 5487 0 0 0 ARMCTRL 77 Edge DMA IRQ
79: 0 0 0 0 ARMCTRL 79 Edge 3f804000.i2c
80: 0 0 0 0 ARMCTRL 80 Edge 3f204000.spi
82: 520 0 0 0 ARMCTRL 82 Edge mmc0
96: 0 0 0 0 ARMCTRL 96 Edge arch_timer
97: 3336 3138 2762 2616 ARMCTRL 97 Edge arch_timer
FIQ: usb_fiq
IPI0: 0 0 0 0 CPU wakeup interrupts
IPI1: 0 0 0 0 Timer broadcast interrupts
IPI2: 10445 12060 18171 14350 Rescheduling interrupts
IPI3: 10 16 16 13 Function call interrupts
IPI4: 32 43 67 202 Single function call interrupts
IPI5: 0 0 0 0 CPU stop interrupts
IPI6: 0 0 0 0 IRQ work interrupts
IPI7: 0 0 0 0 completion interrupts
Err: 0
IRQ table for the Raspberry Pi B 3
IRQ num, CPU0, CPU1, CPU2, CPU3, details
16: 0 0 0 0 ARMCTRL 16 Edge bcm2708_fb dma
20: 0 0 0 0 ARMCTRL 20 Edge DMA IRQ
32: 12410673 0 0 0 ARMCTRL 32 Edge dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
49: 0 0 0 0 ARMCTRL 49 Edge 3f200000.gpio:bank0
50: 0 0 0 0 ARMCTRL 50 Edge 3f200000.gpio:bank1
65: 1494 0 0 0 ARMCTRL 65 Edge 3f00b880.mailbox
66: 2 0 0 0 ARMCTRL 66 Edge VCHIQ doorbell
75: 1 0 0 0 ARMCTRL 75 Edge
77: 21849 0 0 0 ARMCTRL 77 Edge DMA IRQ
82: 14846 0 0 0 ARMCTRL 82 Edge mmc0
83: 4962 0 0 0 ARMCTRL 83 Edge uart-pl011
84: 753993 0 0 0 ARMCTRL 84 Edge mmc1
96: 0 0 0 0 ARMCTRL 96 Edge arch_timer
97: 558639 362236 427497 330519 ARMCTRL 97 Edge arch_timer
FIQ: usb_fiq
IPI0: 0 0 0 0 CPU wakeup interrupts
IPI1: 0 0 0 0 Timer broadcast interrupts
IPI2: 351505 410401 258035 378912 Rescheduling interrupts
IPI3: 5 10 10 11 Function call interrupts
IPI4: 7 142 88 58 Single function call interrupts
IPI5: 0 0 0 0 CPU stop interrupts
IPI6: 0 0 0 0 IRQ work interrupts
IPI7: 0 0 0 0 completion interrupts
Err: 0
The first column refers to the IRQ number. Each CPU in the system has its own column and its own number of interrupts per IRQ. The next column reports the type of interrupt, and the last column contains the name of the device that is located at that IRQ.
The first two tables are interesting as they show you the difference between the types of devices installed on a more traditional pc and those of a ARM CPU based development board such as the Radxa Rock.
Some of the devices listed are easier to identify than others e.g.
e.g. for the Radxa rock :
43: 0 0 0 0 GIC rk3066b-camera
This very clearly shows that IRQ 43 is allocated as the interupt for the rk3066b-camera module that can be plugged into the Radxa Rock camera port.
Other devices on the Radxa rock, such as :
173: 0 0 0 0 GPIO rtc_hym8563
are a lot less clear as to what they are, two great sources to find out are the Radxa rock peripherals Manual , or just browse the web for this device name, “rtc hym8563” for example.
As a final note for this post!, you may have noticed that on the Raspberry pi systems there is a listing of three lines for GPIO IRQ’s as follows
Raspberry Pi B+
49: 0 ARMCTRL 49 Edge 20200000.gpio:bank0
50: 0 ARMCTRL 50 Edge 20200000.gpio:bank1
65: 16 ARMCTRL 65 Edge 2000b880.mailbox
Raspberry Pi 2
49: 0 0 0 0 ARMCTRL 49 Edge 3f200000.gpio:bank0
50: 0 0 0 0 ARMCTRL 50 Edge 3f200000.gpio:bank1
65: 36 0 0 0 ARMCTRL 65 Edge 3f00b880.mailbox
Raspberry Pi 3
49: 0 0 0 0 ARMCTRL 49 Edge 3f200000.gpio:bank0
50: 0 0 0 0 ARMCTRL 50 Edge 3f200000.gpio:bank1
65: 1494 0 0 0 ARMCTRL 65 Edge 3f00b880.mailbox
from these details you can extract the simple fact that the IRQ physical memory address (given in HEX DECIMAL!)for the GPIO devices of (GPIO-BANK1 and 2, GPIO-mailbox) changed their addresses from models B+ to B2 but did not change form the Raspberry Pi b2 to b3!
NB : A future area for study relating to IRQ’s is to detail exactly how system software uses these IRQ/Interrupts but for this post this is just about the correct amount of information.
More reading on Irq’s and Interrupts
Note : This post is followed in study order by: I/O Ports and I/O memory