15 #include <linux/module.h>
23 #include <asm/exception.h>
25 #include <mach/hardware.h>
26 #include <mach/irqs.h>
37 #define IPR(i) (((i) < 32) ? (0x01c + ((i) << 2)) : \
38 ((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) : \
39 (0x144 + (((i) - 64) << 2)))
40 #define ICHP_VAL_IRQ (1 << 31)
41 #define ICHP_IRQ(i) (((i) >> 16) & 0x7fff)
42 #define IPR_VALID (1 << 31)
43 #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
45 #define MAX_INTERNAL_IRQS 128
51 static void __iomem *pxa_irq_base;
52 static int pxa_internal_irq_nr;
53 static bool cpu_has_ipr;
55 static inline void __iomem *irq_base(
int i)
57 static unsigned long phys_base_offset[] = {
63 return pxa_irq_base + phys_base_offset[
i];
84 static struct irq_chip pxa_internal_irq_chip = {
112 __asm__ __volatile__(
"mrc p6, 0, %0, c5, c0, 0\n":
"=r"(ichp));
127 pxa_internal_irq_nr = irq_nr;
129 pxa_irq_base =
io_p2v(0x40d00000);
131 for (n = 0; n < irq_nr; n += 32) {
136 for (i = n; (i < (n + 32)) && (i < irq_nr); i++) {
142 irq_set_chip_and_handler(irq, &pxa_internal_irq_chip,
163 for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
171 for (i = 0; i < pxa_internal_irq_nr; i++)
182 for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
190 for (i = 0; i < pxa_internal_irq_nr; i++)
196 #define pxa_irq_suspend NULL
197 #define pxa_irq_resume NULL
208 static int pxa_irq_map(
struct irq_domain *
h,
unsigned int virq,
217 irq_set_chip_and_handler(hw, &pxa_internal_irq_chip,
231 { .compatible =
"marvell,pxa-intc", },
239 struct pxa_intc_conf *conf;
245 pr_err(
"Failed to find interrupt controller in arch-pxa\n");
251 ret = of_property_read_u32(node,
"marvell,intc-nr-irqs",
252 &pxa_internal_irq_nr);
254 pr_err(
"Not found marvell,intc-nr-irqs property\n");
260 pr_err(
"No registers defined for node\n");
268 ret = irq_alloc_descs(-1, 0, pxa_internal_irq_nr, 0);
270 pr_err(
"Failed to allocate IRQ numbers\n");
277 panic(
"Unable to add PXA IRQ domain\n");
281 for (n = 0; n < pxa_internal_irq_nr; n += 32) {
282 void __iomem *base = irq_base(n >> 5);