11 #include <linux/kernel.h>
12 #include <linux/types.h>
14 #include <linux/sched.h>
15 #include <linux/pci.h>
18 #include <asm/ptrace.h>
21 #include <asm/mmu_context.h>
23 #include <asm/pgtable.h>
25 #include <asm/tlbflush.h>
49 static void sable_lynx_init_irq(
int nr_of_irqs);
51 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_SABLE)
93 sable_update_irq_hw(
unsigned long bit,
unsigned long mask)
100 }
else if (bit >= 8) {
109 sable_ack_irq_hw(
unsigned long bit)
111 int port, val1, val2;
115 val1 = 0xE0 | (bit - 16);
117 }
else if (bit >= 8) {
119 val1 = 0xE0 | (bit - 8);
123 val1 = 0xE0 | (bit - 0);
133 -1, 6, -1, 8, 15, 12, 7, 9,
134 -1, 16, 17, 18, 3, -1, 21, 22,
135 -1, -1, -1, -1, -1, -1, -1, -1,
136 -1, -1, -1, -1, -1, -1, -1, -1,
137 2, 1, 0, 4, 5, -1, -1, -1,
138 -1, -1, -1, -1, -1, -1, -1, -1,
139 -1, -1, -1, -1, -1, -1, -1, -1,
140 -1, -1, -1, -1, -1, -1, -1, -1
143 34, 33, 32, 12, 35, 36, 1, 6,
144 3, 7, -1, -1, 5, -1, -1, 4,
145 9, 10, 11, -1, -1, 14, 15, -1,
146 -1, -1, -1, -1, -1, -1, -1, -1,
147 -1, -1, -1, -1, -1, -1, -1, -1,
148 -1, -1, -1, -1, -1, -1, -1, -1,
149 -1, -1, -1, -1, -1, -1, -1, -1,
150 -1, -1, -1, -1, -1, -1, -1, -1
165 sable_lynx_irq_swizzle = &sable_irq_swizzle;
166 sable_lynx_init_irq(40);
200 { 32+0, 32+0, 32+0, 32+0, 32+0},
201 { 32+1, 32+1, 32+1, 32+1, 32+1},
202 { -1, -1, -1, -1, -1},
203 { -1, -1, -1, -1, -1},
204 { -1, -1, -1, -1, -1},
205 { -1, -1, -1, -1, -1},
206 { 32+2, 32+2, 32+2, 32+2, 32+2},
207 { 32+3, 32+3, 32+3, 32+3, 32+3},
208 { 32+4, 32+4, 32+4, 32+4, 32+4}
210 long min_idsel = 0, max_idsel = 8, irqs_per_slot = 5;
215 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_LYNX)
292 lynx_update_irq_hw(
unsigned long bit,
unsigned long mask)
308 lynx_ack_irq_hw(
unsigned long bit)
317 -1, 6, -1, 8, 15, 12, 7, 9,
318 -1, 16, 17, 18, 3, -1, 21, 22,
319 -1, -1, -1, -1, -1, -1, -1, -1,
320 -1, -1, -1, -1, 28, -1, -1, -1,
321 32, 33, 34, 35, 36, 37, 38, 39,
322 40, 41, 42, 43, 44, 45, 46, 47,
323 48, 49, 50, 51, 52, 53, 54, 55,
324 56, 57, 58, 59, 60, 61, 62, 63
327 -1, -1, -1, 12, -1, -1, 1, 6,
328 3, 7, -1, -1, 5, -1, -1, 4,
329 9, 10, 11, -1, -1, 14, 15, -1,
330 -1, -1, -1, -1, 28, -1, -1, -1,
331 32, 33, 34, 35, 36, 37, 38, 39,
332 40, 41, 42, 43, 44, 45, 46, 47,
333 48, 49, 50, 51, 52, 53, 54, 55,
334 56, 57, 58, 59, 60, 61, 62, 63
344 sable_lynx_irq_swizzle = &lynx_irq_swizzle;
345 sable_lynx_init_irq(64);
382 { -1, -1, -1, -1, -1},
383 { -1, -1, -1, -1, -1},
384 { 28, 28, 28, 28, 28},
385 { -1, -1, -1, -1, -1},
386 { 32, 32, 33, 34, 35},
387 { 36, 36, 37, 38, 39},
388 { 40, 40, 41, 42, 43},
389 { 44, 44, 45, 46, 47},
390 { -1, -1, -1, -1, -1},
392 { -1, -1, -1, -1, -1},
393 { 28, 28, 28, 28, 28},
394 { -1, -1, -1, -1, -1},
395 { -1, -1, -1, -1, -1},
396 { -1, -1, -1, -1, -1},
397 { -1, -1, -1, -1, -1},
398 { 48, 48, 49, 50, 51},
399 { 52, 52, 53, 54, 55},
400 { 56, 56, 57, 58, 59},
401 { 60, 60, 61, 62, 63}
403 const long min_idsel = 2, max_idsel = 20, irqs_per_slot = 5;
412 if (dev->
bus->number == 0) {
430 dev = dev->
bus->self;
433 }
while (dev->
bus->self);
445 sable_lynx_enable_irq(
struct irq_data *
d)
450 spin_lock(&sable_lynx_irq_lock);
453 spin_unlock(&sable_lynx_irq_lock);
455 printk(
"%s: mask 0x%lx bit 0x%lx irq 0x%x\n",
456 __func__, mask, bit, irq);
461 sable_lynx_disable_irq(
struct irq_data *d)
466 spin_lock(&sable_lynx_irq_lock);
469 spin_unlock(&sable_lynx_irq_lock);
471 printk(
"%s: mask 0x%lx bit 0x%lx irq 0x%x\n",
472 __func__, mask, bit, irq);
477 sable_lynx_mask_and_ack_irq(
struct irq_data *d)
482 spin_lock(&sable_lynx_irq_lock);
486 spin_unlock(&sable_lynx_irq_lock);
489 static struct irq_chip sable_lynx_irq_type = {
490 .name =
"SABLE/LYNX",
491 .irq_unmask = sable_lynx_enable_irq,
492 .irq_mask = sable_lynx_disable_irq,
493 .irq_mask_ack = sable_lynx_mask_and_ack_irq,
497 sable_lynx_srm_device_interrupt(
unsigned long vector)
505 bit = (vector - 0x800) >> 4;
508 printk(
"%s: vector 0x%lx bit 0x%x irq 0x%x\n",
509 __func__, vector, bit, irq);
515 sable_lynx_init_irq(
int nr_of_irqs)
519 for (i = 0; i < nr_of_irqs; ++
i) {
520 irq_set_chip_and_handler(i, &sable_lynx_irq_type,
529 sable_lynx_init_pci(
void)
542 #if defined(CONFIG_ALPHA_GENERIC) || \
543 (defined(CONFIG_ALPHA_SABLE) && !defined(CONFIG_ALPHA_GAMMA))
546 struct alpha_machine_vector sable_mv
__initmv = {
547 .vector_name =
"Sable",
557 .device_interrupt = sable_lynx_srm_device_interrupt,
560 .init_irq = sable_init_irq,
562 .init_pci = sable_lynx_init_pci,
564 .pci_map_irq = sable_map_irq,
574 #if defined(CONFIG_ALPHA_GENERIC) || \
575 (defined(CONFIG_ALPHA_SABLE) && defined(CONFIG_ALPHA_GAMMA))
577 #define GAMMA_BIAS _GAMMA_BIAS
578 struct alpha_machine_vector sable_gamma_mv __initmv = {
579 .vector_name =
"Sable-Gamma",
589 .device_interrupt = sable_lynx_srm_device_interrupt,
592 .init_irq = sable_init_irq,
594 .init_pci = sable_lynx_init_pci,
596 .pci_map_irq = sable_map_irq,
606 #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_LYNX)
608 #define GAMMA_BIAS _GAMMA_BIAS
609 struct alpha_machine_vector lynx_mv __initmv = {
610 .vector_name =
"Lynx",
620 .device_interrupt = sable_lynx_srm_device_interrupt,
623 .init_irq = lynx_init_irq,
625 .init_pci = sable_lynx_init_pci,
627 .pci_map_irq = lynx_map_irq,
628 .pci_swizzle = lynx_swizzle,