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