6b13f685e
김민수
BSP 최초 추가
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#define pr_fmt(fmt) "intc: " fmt
#include <linux/irqdomain.h>
#include <linux/sh_intc.h>
#include <linux/export.h>
#include "internals.h"
static int intc_evt_xlate(struct irq_domain *d, struct device_node *ctrlr,
const u32 *intspec, unsigned int intsize,
unsigned long *out_hwirq, unsigned int *out_type)
{
if (WARN_ON(intsize < 1))
return -EINVAL;
*out_hwirq = evt2irq(intspec[0]);
*out_type = IRQ_TYPE_NONE;
return 0;
}
static const struct irq_domain_ops intc_evt_ops = {
.xlate = intc_evt_xlate,
};
void __init intc_irq_domain_init(struct intc_desc_int *d,
struct intc_hw_desc *hw)
{
unsigned int irq_base, irq_end;
irq_base = evt2irq(hw->vectors[0].vect);
irq_end = evt2irq(hw->vectors[hw->nr_vectors - 1].vect);
if (irq_base == 0 && irq_end == (irq_base + hw->nr_vectors - 1))
d->domain = irq_domain_add_linear(NULL, hw->nr_vectors,
&intc_evt_ops, NULL);
else
d->domain = irq_domain_add_tree(NULL, &intc_evt_ops, NULL);
BUG_ON(!d->domain);
}
|