1/*
2 * Cobalt interrupt handler
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License.  See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
9 * Copyright (C) 2001, 2002, 2003 by Liam Davies (ldavies@agile.tv)
10 */
11#include <asm/asm.h>
12#include <asm/mipsregs.h>
13#include <asm/cobalt/cobalt.h>
14#include <asm/regdef.h>
15#include <asm/stackframe.h>
16
17/*
18 * cobalt_handle_int: Interrupt handler for Cobalt boards
19 */
20		.text
21		.set	noreorder
22		.set	noat
23		.align	5
24		NESTED(cobalt_handle_int, PT_SIZE, sp)
25		SAVE_ALL
26		CLI
27		.set	at
28
29		/*
30		 * Get pending Interrupts
31		 */
32		mfc0	s0,CP0_CAUSE	# get raw irq status
33		mfc0	a0,CP0_STATUS	# get irq mask
34		and	s0,s0,a0	# compute masked irq status
35
36		andi	a0,s0,CAUSEF_IP2	/* Check for Galileo timer */
37		beq	a0,zero,1f
38		 andi	a0,s0,CAUSEF_IP6	/* Check for Via chip */
39
40		/* Galileo interrupt */
41		jal	galileo_irq
42		 move	a0,sp
43		j	ret_from_irq
44		 nop
45
461:
47		beq	a0,zero,1f		/* Check IP6 */
48		 andi	a0,s0,CAUSEF_IP3
49
50		/* Via interrupt */
51		jal	via_irq
52		 move	a0,sp
53		j	ret_from_irq
54		 nop
55
561:
57		beq	a0,zero,1f		/* Check IP3 */
58		 andi	a0,s0,CAUSEF_IP4
59
60		/* Ethernet 0 interrupt */
61		li	a0,COBALT_ETH0_IRQ
62		jal     do_IRQ
63		 move	a1,sp
64
65		j	ret_from_irq
66		 nop
67
681:
69		beq	a0,zero,1f		/* Check IP4 */
70		 andi	a0,s0,CAUSEF_IP5
71
72		/* Ethernet 1 interrupt */
73		li	a0,COBALT_ETH1_IRQ
74		jal     do_IRQ
75		 move	a1,sp
76
77		j	ret_from_irq
78		 nop
791:
80		beq	a0,zero,1f		/* Check IP5 */
81		 andi	a0,s0,CAUSEF_IP7
82
83		/* Serial interrupt */
84		li	a0,COBALT_SERIAL_IRQ
85		jal     do_IRQ
86		 move	a1,sp
87
88		j	ret_from_irq
89		 nop
901:
91		beq	a0,zero,1f		/* Check IP7 */
92		  nop
93
94		/* PCI interrupt */
95		li	a0,COBALT_QUBE_SLOT_IRQ
96		jal     do_IRQ
97		 move	a1,sp
98
991:
100		j	ret_from_irq
101		 nop
102
103		END(cobalt_handle_int)
104
105