3 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
5 * Module name: ppc403_pic.c
8 * Interrupt controller driver for PowerPC 403-based processors.
12 * The PowerPC 403 cores' Asynchronous Interrupt Controller (AIC) has
13 * 32 possible interrupts, a majority of which are not implemented on
14 * all cores. There are six configurable, external interrupt pins and
15 * there are eight internal interrupts for the on-chip serial port
16 * (SPU), DMA controller, and JTAG controller.
20 #include <linux/init.h>
21 #include <linux/sched.h>
22 #include <linux/signal.h>
23 #include <linux/stddef.h>
25 #include <asm/processor.h>
26 #include <asm/system.h>
28 #include <asm/ppc4xx_pic.h>
30 /* Function Prototypes */
32 static void ppc403_aic_enable(unsigned int irq);
33 static void ppc403_aic_disable(unsigned int irq);
34 static void ppc403_aic_disable_and_ack(unsigned int irq);
36 static struct hw_interrupt_type ppc403_aic = {
42 ppc403_aic_disable_and_ack,
47 ppc403_pic_get_irq(struct pt_regs *regs)
53 * Only report the status of those interrupts that are actually
57 bits = mfdcr(DCRN_EXISR) & mfdcr(DCRN_EXIER);
60 * Walk through the interrupts from highest priority to lowest, and
61 * report the first pending interrupt found.
62 * We want PPC, not C bit numbering, so just subtract the ffs()
67 if (irq == NR_AIC_IRQS)
74 ppc403_aic_enable(unsigned int irq)
81 ppc_cached_irq_mask[word] |= (1 << (31 - bit));
82 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]);
86 ppc403_aic_disable(unsigned int irq)
93 ppc_cached_irq_mask[word] &= ~(1 << (31 - bit));
94 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]);
98 ppc403_aic_disable_and_ack(unsigned int irq)
105 ppc_cached_irq_mask[word] &= ~(1 << (31 - bit));
106 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[word]);
107 mtdcr(DCRN_EXISR, (1 << (31 - bit)));
111 ppc4xx_pic_init(void)
116 * Disable all external interrupts until they are
117 * explicity requested.
119 ppc_cached_irq_mask[0] = 0;
121 mtdcr(DCRN_EXIER, ppc_cached_irq_mask[0]);
123 ppc_md.get_irq = ppc403_pic_get_irq;
125 for (i = 0; i < NR_IRQS; i++)
126 irq_desc[i].handler = &ppc403_aic;