ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[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
13 #include <linux/config.h>
14 #include <asm/asm.h>
15 #include <asm/mipsregs.h>
16 #include <asm/addrspace.h>
17 #include <asm/regdef.h>
18 #include <asm/stackframe.h>
19
20 /*
21  * IRQ router for the Titan board
22  */
23
24                 .align  5
25                 NESTED(titan_handle_int, PT_SIZE, sp)
26                 SAVE_ALL
27                 CLI
28                 .set    at
29                 mfc0    t0, CP0_CAUSE
30                 mfc0    t2, CP0_STATUS
31
32                 and     t0, t2
33         
34                 andi    t1, t0, STATUSF_IP0     /* INTB0 hardware line */
35                 bnez    t1, ll_pcia_irq         /* 64-bit PCI */
36                 andi    t1, t0, STATUSF_IP1     /* INTB1 hardware line */
37                 bnez    t1, ll_pcib_irq         /* second 64-bit PCI slot */
38                 andi    t1, t0, STATUSF_IP2     /* INTB2 hardware line */
39                 bnez    t1, ll_duart_irq        /* UART */
40                 andi    t1, t0, STATUSF_IP3     /* INTB3 hardware line*/
41                 bnez    t1, ll_ht_smp_irq               /* Hypertransport */
42                 andi    t1, t0, STATUSF_IP5     /* INTB5 hardware line */
43                 bnez    t1, ll_timer_irq        /* Timer */
44
45                 nop
46                 nop
47
48                 /* Extended interrupts */
49                 mfc0    t0, CPU_CAUSE
50                 cfc0    t1, CP0_S1_INTCONTROL
51
52                 sll     t2, t1, 8
53                 
54                 and     t0, t2
55                 srl     t0, t0, 16
56
57                 
58                 andi    t1, t0, STATUSF_IP6     /* INTB6 hardware line */
59                 bnez    t1, ll_phy0_irq         /* Ethernet port 0 */
60                 andi    t1, t0, STATUSF_IP7     /* INTB7 hardware line */
61                 bnez    t1, ll_phy1_irq         /* Ethernet port 1 */
62                 andi    t1, t0, STATUSF_IP8     /* INTB8 hardware line */
63                 bnez    t1, ll_phy2_irq         /* Ethernet Port 2 */
64
65                 nop
66                 nop
67
68                 .set    reorder
69
70                 /* No handler */
71                 j       spurious_interrupt
72                 nop
73                 END(titan_handle_int)
74
75                 .align  5
76
77 /* Individual Handlers */
78
79 ll_pcia_irq:
80                 li      a0, 1
81                 move    a2, sp
82                 jal     do_IRQ
83                 j       ret_from_irq
84
85 ll_pcib_irq:
86                 li      a0, 2
87                 move    a1, sp
88                 jal     do_IRQ
89                 j       ret_from_irq
90
91 ll_duart_irq:
92                 li      a0, 3
93                 move    a1, sp
94                 jal     do_IRQ
95                 j       ret_from_irq
96
97 ll_ht_irq:
98                 li      a0, 4
99                 move    a1, sp
100                 jal     ll_ht_smp_irq_handler   /* Detailed HT & SMP IRQ handling */
101                 j       ret_from_irq
102
103 ll_timer_irq:
104                 li      a0, 5
105                 move    a1, sp
106                 jal     do_IRQ
107                 j       ret_from_irq
108
109 ll_phy0_irq:
110                 li      a0, 6
111                 move    a1, sp
112                 jal     do_IRQ
113                 j       ret_from_irq    
114
115 ll_phy1_irq:
116                 li      a0, 7
117                 move    a1, sp
118                 jal     do_IRQ
119                 j       ret_from_irq
120
121 ll_phy2_irq:
122                 li      a0, 8
123                 move    a1, sp
124                 jal     do_IRQ
125                 j       ret_from_irq