2 * linux/arch/alpha/kernel/irq_pyxis.c
4 * Based on code written by David A Rusling (david.rusling@reo.mts.dec.com).
6 * IRQ Code common to all PYXIS core logic chips.
9 #include <linux/init.h>
10 #include <linux/sched.h>
11 #include <linux/irq.h>
14 #include <asm/core_cia.h>
20 /* Note mask bit is true for ENABLED irqs. */
21 static unsigned long cached_irq_mask;
24 pyxis_update_irq_hw(unsigned long mask)
26 *(vulp)PYXIS_INT_MASK = mask;
28 *(vulp)PYXIS_INT_MASK;
32 pyxis_enable_irq(unsigned int irq)
34 pyxis_update_irq_hw(cached_irq_mask |= 1UL << (irq - 16));
38 pyxis_disable_irq(unsigned int irq)
40 pyxis_update_irq_hw(cached_irq_mask &= ~(1UL << (irq - 16)));
44 pyxis_startup_irq(unsigned int irq)
46 pyxis_enable_irq(irq);
51 pyxis_end_irq(unsigned int irq)
53 if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
54 pyxis_enable_irq(irq);
58 pyxis_mask_and_ack_irq(unsigned int irq)
60 unsigned long bit = 1UL << (irq - 16);
61 unsigned long mask = cached_irq_mask &= ~bit;
63 /* Disable the interrupt. */
64 *(vulp)PYXIS_INT_MASK = mask;
66 /* Ack PYXIS PCI interrupt. */
67 *(vulp)PYXIS_INT_REQ = bit;
69 /* Re-read to force both writes. */
70 *(vulp)PYXIS_INT_MASK;
73 static struct hw_interrupt_type pyxis_irq_type = {
75 .startup = pyxis_startup_irq,
76 .shutdown = pyxis_disable_irq,
77 .enable = pyxis_enable_irq,
78 .disable = pyxis_disable_irq,
79 .ack = pyxis_mask_and_ack_irq,
84 pyxis_device_interrupt(unsigned long vector)
89 /* Read the interrupt summary register of PYXIS */
90 pld = *(vulp)PYXIS_INT_REQ;
91 pld &= cached_irq_mask;
94 * Now for every possible bit set, work through them and call
95 * the appropriate interrupt handler.
99 pld &= pld - 1; /* clear least bit set */
101 isa_device_interrupt(vector);
108 init_pyxis_irqs(unsigned long ignore_mask)
112 *(vulp)PYXIS_INT_MASK = 0; /* disable all */
113 *(vulp)PYXIS_INT_REQ = -1; /* flush all */
116 /* Send -INTA pulses to clear any pending interrupts ...*/
119 for (i = 16; i < 48; ++i) {
120 if ((ignore_mask >> i) & 1)
122 irq_desc[i].status = IRQ_DISABLED | IRQ_LEVEL;
123 irq_desc[i].chip = &pyxis_irq_type;
126 setup_irq(16+7, &isa_cascade_irqaction);