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(struct irq_data
*d
)
34 pyxis_update_irq_hw(cached_irq_mask
|= 1UL << (d
->irq
- 16));
38 pyxis_disable_irq(struct irq_data
*d
)
40 pyxis_update_irq_hw(cached_irq_mask
&= ~(1UL << (d
->irq
- 16)));
44 pyxis_mask_and_ack_irq(struct irq_data
*d
)
46 unsigned long bit
= 1UL << (d
->irq
- 16);
47 unsigned long mask
= cached_irq_mask
&= ~bit
;
49 /* Disable the interrupt. */
50 *(vulp
)PYXIS_INT_MASK
= mask
;
52 /* Ack PYXIS PCI interrupt. */
53 *(vulp
)PYXIS_INT_REQ
= bit
;
55 /* Re-read to force both writes. */
56 *(vulp
)PYXIS_INT_MASK
;
59 static struct irq_chip pyxis_irq_type
= {
61 .irq_mask_ack
= pyxis_mask_and_ack_irq
,
62 .irq_mask
= pyxis_disable_irq
,
63 .irq_unmask
= pyxis_enable_irq
,
67 pyxis_device_interrupt(unsigned long vector
)
72 /* Read the interrupt summary register of PYXIS */
73 pld
= *(vulp
)PYXIS_INT_REQ
;
74 pld
&= cached_irq_mask
;
77 * Now for every possible bit set, work through them and call
78 * the appropriate interrupt handler.
82 pld
&= pld
- 1; /* clear least bit set */
84 isa_device_interrupt(vector
);
91 init_pyxis_irqs(unsigned long ignore_mask
)
95 *(vulp
)PYXIS_INT_MASK
= 0; /* disable all */
96 *(vulp
)PYXIS_INT_REQ
= -1; /* flush all */
99 /* Send -INTA pulses to clear any pending interrupts ...*/
102 for (i
= 16; i
< 48; ++i
) {
103 if ((ignore_mask
>> i
) & 1)
105 set_irq_chip_and_handler(i
, &pyxis_irq_type
, handle_level_irq
);
106 irq_set_status_flags(i
, IRQ_LEVEL
);
109 setup_irq(16+7, &isa_cascade_irqaction
);