9 #include <linux/kernel.h>
10 #include <linux/types.h>
12 #include <linux/sched.h>
13 #include <linux/pci.h>
15 #include <linux/bitops.h>
17 #include <asm/ptrace.h>
20 #include <asm/mmu_context.h>
22 #include <asm/pgtable.h>
25 #include <asm/tlbflush.h>
36 static int doing_init_irq_hw = 0;
39 wildfire_update_irq_hw(
unsigned int irq)
44 volatile unsigned long * enable0;
47 if (!doing_init_irq_hw) {
49 " got irq %d for non-existent PCA %d"
57 enable0 = (
unsigned long *) &pca->
pca_int[0].enable;
65 wildfire_init_irq_hw(
void)
69 volatile unsigned long * enable0, * enable1, * enable2, *enable3;
70 volatile unsigned long * target0, * target1, * target2, *target3;
72 enable0 = (
unsigned long *) &pca->
pca_int[0].enable;
73 enable1 = (
unsigned long *) &pca->
pca_int[1].enable;
74 enable2 = (
unsigned long *) &pca->
pca_int[2].enable;
75 enable3 = (
unsigned long *) &pca->
pca_int[3].enable;
77 target0 = (
unsigned long *) &pca->
pca_int[0].target;
78 target1 = (
unsigned long *) &pca->
pca_int[1].target;
79 target2 = (
unsigned long *) &pca->
pca_int[2].target;
80 target3 = (
unsigned long *) &pca->
pca_int[3].target;
82 *enable0 = *enable1 = *enable2 = *enable3 = 0;
85 *target1 = *target2 = *target3 = 0;
89 *enable0; *enable1; *enable2; *enable3;
90 *target0; *target1; *target2; *target3;
95 doing_init_irq_hw = 1;
99 wildfire_update_irq_hw(i);
101 doing_init_irq_hw = 0;
108 unsigned int irq = d->
irq;
113 spin_lock(&wildfire_irq_lock);
114 set_bit(irq, &cached_irq_mask);
115 wildfire_update_irq_hw(irq);
116 spin_unlock(&wildfire_irq_lock);
120 wildfire_disable_irq(
struct irq_data *d)
122 unsigned int irq = d->
irq;
127 spin_lock(&wildfire_irq_lock);
129 wildfire_update_irq_hw(irq);
130 spin_unlock(&wildfire_irq_lock);
134 wildfire_mask_and_ack_irq(
struct irq_data *d)
136 unsigned int irq = d->
irq;
141 spin_lock(&wildfire_irq_lock);
143 wildfire_update_irq_hw(irq);
144 spin_unlock(&wildfire_irq_lock);
147 static struct irq_chip wildfire_irq_type = {
149 .irq_unmask = wildfire_enable_irq,
150 .irq_mask = wildfire_disable_irq,
151 .irq_mask_ack = wildfire_mask_and_ack_irq,
155 wildfire_init_irq_per_pca(
int qbbno,
int pcano)
160 .name =
"isa_enable",
167 unsigned long io_bias;
183 for (i = 0; i < 16; ++
i) {
186 irq_set_chip_and_handler(i + irq_bias, &wildfire_irq_type,
188 irq_set_status_flags(i + irq_bias,
IRQ_LEVEL);
191 irq_set_chip_and_handler(36 + irq_bias, &wildfire_irq_type,
193 irq_set_status_flags(36 + irq_bias,
IRQ_LEVEL);
194 for (i = 40; i < 64; ++
i) {
195 irq_set_chip_and_handler(i + irq_bias, &wildfire_irq_type,
197 irq_set_status_flags(i + irq_bias,
IRQ_LEVEL);
204 wildfire_init_irq(
void)
209 wildfire_init_irq_hw();
217 wildfire_init_irq_per_pca(qbbno, pcano);
225 wildfire_device_interrupt(
unsigned long vector)
229 irq = (vector - 0x800) >> 4;
296 { -1, -1, -1, -1, -1},
297 { 36, 36, 36+1, 36+2, 36+3},
298 { 40, 40, 40+1, 40+2, 40+3},
299 { 44, 44, 44+1, 44+2, 44+3},
300 { 48, 48, 48+1, 48+2, 48+3},
301 { 52, 52, 52+1, 52+2, 52+3},
302 { 56, 56, 56+1, 56+2, 56+3},
303 { 60, 60, 60+1, 60+2, 60+3},
305 long min_idsel = 0, max_idsel = 7, irqs_per_slot = 5;
311 int qbbno = hose->
index >> 3;
312 int pcano = (hose->
index >> 1) & 3;
313 irq += (qbbno << 8) + (pcano << 6);
323 struct alpha_machine_vector wildfire_mv
__initmv = {
324 .vector_name =
"WILDFIRE",
334 .device_interrupt = wildfire_device_interrupt,
337 .init_irq = wildfire_init_irq,
341 .pci_map_irq = wildfire_map_irq,