aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/IRQ-domain.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/IRQ-domain.txt')
-rw-r--r--Documentation/IRQ-domain.txt34
1 files changed, 33 insertions, 1 deletions
diff --git a/Documentation/IRQ-domain.txt b/Documentation/IRQ-domain.txt
index 1401cece745a..9bc95942ec22 100644
--- a/Documentation/IRQ-domain.txt
+++ b/Documentation/IRQ-domain.txt
@@ -7,6 +7,21 @@ systems with multiple interrupt controllers the kernel must ensure
7that each one gets assigned non-overlapping allocations of Linux 7that each one gets assigned non-overlapping allocations of Linux
8IRQ numbers. 8IRQ numbers.
9 9
10The number of interrupt controllers registered as unique irqchips
11show a rising tendency: for example subdrivers of different kinds
12such as GPIO controllers avoid reimplementing identical callback
13mechanisms as the IRQ core system by modelling their interrupt
14handlers as irqchips, i.e. in effect cascading interrupt controllers.
15
16Here the interrupt number loose all kind of correspondence to
17hardware interrupt numbers: whereas in the past, IRQ numbers could
18be chosen so they matched the hardware IRQ line into the root
19interrupt controller (i.e. the component actually fireing the
20interrupt line to the CPU) nowadays this number is just a number.
21
22For this reason we need a mechanism to separate controller-local
23interrupt numbers, called hardware irq's, from Linux IRQ numbers.
24
10The irq_alloc_desc*() and irq_free_desc*() APIs provide allocation of 25The irq_alloc_desc*() and irq_free_desc*() APIs provide allocation of
11irq numbers, but they don't provide any support for reverse mapping of 26irq numbers, but they don't provide any support for reverse mapping of
12the controller-local IRQ (hwirq) number into the Linux IRQ number 27the controller-local IRQ (hwirq) number into the Linux IRQ number
@@ -40,6 +55,10 @@ required hardware setup.
40When an interrupt is received, irq_find_mapping() function should 55When an interrupt is received, irq_find_mapping() function should
41be used to find the Linux IRQ number from the hwirq number. 56be used to find the Linux IRQ number from the hwirq number.
42 57
58The irq_create_mapping() function must be called *atleast once*
59before any call to irq_find_mapping(), lest the descriptor will not
60be allocated.
61
43If the driver has the Linux IRQ number or the irq_data pointer, and 62If the driver has the Linux IRQ number or the irq_data pointer, and
44needs to know the associated hwirq number (such as in the irq_chip 63needs to know the associated hwirq number (such as in the irq_chip
45callbacks) then it can be directly obtained from irq_data->hwirq. 64callbacks) then it can be directly obtained from irq_data->hwirq.
@@ -119,4 +138,17 @@ numbers.
119 138
120Most users of legacy mappings should use irq_domain_add_simple() which 139Most users of legacy mappings should use irq_domain_add_simple() which
121will use a legacy domain only if an IRQ range is supplied by the 140will use a legacy domain only if an IRQ range is supplied by the
122system and will otherwise use a linear domain mapping. 141system and will otherwise use a linear domain mapping. The semantics
142of this call are such that if an IRQ range is specified then
143descriptors will be allocated on-the-fly for it, and if no range is
144specified it will fall through to irq_domain_add_linear() which meand
145*no* irq descriptors will be allocated.
146
147A typical use case for simple domains is where an irqchip provider
148is supporting both dynamic and static IRQ assignments.
149
150In order to avoid ending up in a situation where a linear domain is
151used and no descriptor gets allocated it is very important to make sure
152that the driver using the simple domain call irq_create_mapping()
153before any irq_find_mapping() since the latter will actually work
154for the static IRQ assignment case.