upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / arch / mips / pmc-sierra / yosemite / irq-handler.S
1 /*
2  * Copyright 2003, 04 PMC-Sierra Inc.
3  * Author: Manish Lachwani (lachwani@pmc-sierra.com
4  * Copyright 2004 Ralf Baechle (ralf@linux-mips.org)
5  *
6  * First-level interrupt router for the PMC-Sierra Titan board
7  *
8  * This program is free software; you can redistribute  it and/or modify it
9  * under  the terms of  the GNU General  Public License as published by the
10  * Free Software Foundation;  either version 2 of the  License, or (at your
11  * option) any later version.
12  *
13  * Titan supports Hypertransport or PCI but not both. Hence, one interrupt
14  * line is shared between the PCI slot A and Hypertransport. This is the
15  * Processor INTB #0.
16  */
17
18 #include <linux/config.h>
19 #include <asm/asm.h>
20 #include <asm/mipsregs.h>
21 #include <asm/addrspace.h>
22 #include <asm/regdef.h>
23 #include <asm/stackframe.h>
24
25                 .align  5
26                 NESTED(titan_handle_int, PT_SIZE, sp)
27                 SAVE_ALL
28                 CLI
29                 .set    at
30                 .set    noreorder
31                 la      ra, ret_from_irq
32                 mfc0    t0, CP0_CAUSE
33                 mfc0    t2, CP0_STATUS
34
35                 and     t0, t2
36
37                 andi    t1, t0, STATUSF_IP2     /* INTB0 hardware line */
38                 bnez    t1, ll_pcia_irq         /* 64-bit PCI */
39                 andi    t1, t0, STATUSF_IP3     /* INTB1 hardware line */
40                 bnez    t1, ll_pcib_irq         /* second 64-bit PCI slot */
41                 andi    t1, t0, STATUSF_IP4     /* INTB2 hardware line */
42                 bnez    t1, ll_duart_irq        /* UART */
43                 andi    t1, t0, STATUSF_IP5     /* SMP inter-core interrupts */
44                 bnez    t1, ll_smp_irq
45                 andi    t1, t0, STATUSF_IP6
46                 bnez    t1, ll_ht_irq           /* Hypertransport */
47                 andi    t1, t0, STATUSF_IP7     /* INTB5 hardware line */
48                 bnez    t1, ll_timer_irq        /* Timer */
49
50                 nop
51                 nop
52
53                 /* Extended interrupts */
54                 mfc0    t0, CP0_CAUSE
55                 cfc0    t1, CP0_S1_INTCONTROL
56
57                 sll     t2, t1, 8
58
59                 and     t0, t2
60                 srl     t0, t0, 16
61
62                 .set    reorder
63
64                 j       spurious_interrupt
65                 nop
66                 END(titan_handle_int)
67
68                 .align  5
69
70 ll_pcia_irq:
71                 li      a0, 2
72                 move    a1, sp
73 #ifdef CONFIG_HYPERTRANSPORT
74                 j       ll_ht_smp_irq_handler
75 #else
76                 j       do_IRQ
77 #endif
78
79 ll_pcib_irq:
80                 li      a0, 3
81                 move    a1, sp
82                 j       do_IRQ
83
84 ll_duart_irq:
85                 li      a0, 4
86                 move    a1, sp
87                 j       do_IRQ
88
89 ll_smp_irq:
90                 li      a0, 5
91                 move    a1, sp
92 #ifdef CONFIG_SMP
93                 j       titan_mailbox_irq
94 #else
95                 j       do_IRQ
96 #endif
97
98 ll_ht_irq:
99                 li      a0, 6
100                 move    a1, sp
101                 j       ll_ht_smp_irq_handler
102
103 ll_timer_irq:
104                 li      a0, 7
105                 move    a1, sp
106                 j       do_IRQ