12 #include <linux/kernel.h>
13 #include <linux/types.h>
15 #include <linux/sched.h>
16 #include <linux/pci.h>
18 #include <linux/bitops.h>
20 #include <asm/ptrace.h>
23 #include <asm/mmu_context.h>
26 #include <asm/pgtable.h>
29 #include <asm/tlbflush.h>
40 static unsigned long cached_irq_mask[2] = { -1, -1 };
43 eiger_update_irq_hw(
unsigned long irq,
unsigned long mask)
47 mask = (irq >= 64 ? mask << 16 : mask >> ((irq - 16) & 0x30));
48 regaddr = 0x510 + (((
irq - 16) >> 2) & 0x0c);
57 mask = (cached_irq_mask[irq >= 64] &= ~(1
UL << (irq & 63)));
58 eiger_update_irq_hw(irq, mask);
66 mask = (cached_irq_mask[irq >= 64] |= 1
UL << (irq & 63));
67 eiger_update_irq_hw(irq, mask);
70 static struct irq_chip eiger_irq_type = {
72 .irq_unmask = eiger_enable_irq,
73 .irq_mask = eiger_disable_irq,
74 .irq_mask_ack = eiger_disable_irq,
78 eiger_device_interrupt(
unsigned long vector)
98 intstatus =
inw(0x500) & 15;
115 eiger_srm_device_interrupt(
unsigned long vector)
117 int irq = (vector - 0x800) >> 4;
132 alpha_mv.device_interrupt = eiger_srm_device_interrupt;
134 for (i = 16; i < 128; i += 16)
135 eiger_update_irq_hw(i, -1);
139 for (i = 16; i < 128; ++
i) {
159 return irq_orig - 0x80;
167 int bridge_count = 0;
170 int backplane =
inw(0x502) & 0x0f;
174 case 0x00: bridge_count = 0;
break;
175 case 0x01: bridge_count = 1;
break;
176 case 0x03: bridge_count = 2;
break;
177 case 0x07: bridge_count = 3;
break;
178 case 0x0f: bridge_count = 4;
break;
182 while (dev->
bus->self) {
186 > 20 - bridge_count)) {
194 dev = dev->
bus->self;
205 .vector_name =
"Eiger",
216 .device_interrupt = eiger_device_interrupt,
219 .init_irq = eiger_init_irq,
223 .pci_map_irq = eiger_map_irq,
224 .pci_swizzle = eiger_swizzle,