1/*
2 * Copyright 2004 PMC-Sierra Inc.
3 * Author: Manish Lachwani (lachwani@pmc-sierra.com)
4 *
5 * First-level interrupt dispatcher for the PMC-Sierra Stretch 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#define __ASSEMBLY__
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 * First level interrupt dispatcher for the PMC-Sierra Stretch Board
22 */
23
24		.align	5
25		NESTED(pmc_stretch_handle_int, PT_SIZE, sp)
26		SAVE_ALL
27		CLI
28		.set	at
29
30		mfc0	t0, CP0_CAUSE
31		mfc0	t2, CP0_STATUS
32
33		and	t0, t2
34
35		andi	t1, t0, STATUSF_IP0	/* sw0 software interrupt */
36		bnez	t1, ll_sw0_irq
37
38		andi	t1, t0, STATUSF_IP1	/* sw1 software interrupt */
39		bnez	t1, ll_sw1_irq
40
41		andi	t1, t0, STATUSF_IP7	/* Rm7000 CPU timer */
42		bnez	t1, ll_timer_irq
43
44		.set	reorder
45
46		/* wrong alarm or masked ... */
47		j	spurious_interrupt
48		nop
49		END(pmc_stretch_handle_int)
50
51		.align	5
52
53ll_sw0_irq:
54		li	a0, 1
55		move	a1, sp
56		jal	do_IRQ
57		j	ret_from_irq
58
59ll_sw1_irq:
60		li	a0, 2
61		move	a1, sp
62		jal	do_IRQ
63		j	ret_from_irq
64
65ll_timer_irq:
66		li	a0, 8
67		move	a1, sp
68		jal	do_IRQ
69		j	ret_from_irq
70
71
72