2005-07-26 06:45:45 +08:00
|
|
|
/*
|
2006-10-04 05:01:26 +08:00
|
|
|
* linux/arch/mips/tx4938/common/irq.c
|
2005-07-26 06:45:45 +08:00
|
|
|
*
|
|
|
|
* Common tx4938 irq handler
|
|
|
|
* Copyright (C) 2000-2001 Toshiba Corporation
|
|
|
|
*
|
|
|
|
* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the
|
|
|
|
* terms of the GNU General Public License version 2. This program is
|
|
|
|
* licensed "as is" without any warranty of any kind, whether express
|
|
|
|
* or implied.
|
|
|
|
*
|
|
|
|
* Support for TX4938 in 2.6 - Manish Lachwani (mlachwani@mvista.com)
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
2007-08-02 22:36:02 +08:00
|
|
|
#include <asm/irq_cpu.h>
|
2005-07-26 06:45:45 +08:00
|
|
|
#include <asm/mipsregs.h>
|
|
|
|
#include <asm/tx4938/rbtx4938.h>
|
|
|
|
|
|
|
|
void __init
|
|
|
|
tx4938_irq_init(void)
|
|
|
|
{
|
2007-08-02 22:36:02 +08:00
|
|
|
mips_cpu_irq_init();
|
|
|
|
txx9_irq_init(TX4938_IRC_REG);
|
|
|
|
set_irq_chained_handler(TX4938_IRQ_NEST_PIC_ON_CP0, handle_simple_irq);
|
2005-07-26 06:45:45 +08:00
|
|
|
}
|
|
|
|
|
2007-08-02 22:36:02 +08:00
|
|
|
int toshiba_rbtx4938_irq_nested(int irq);
|
2006-04-04 00:56:36 +08:00
|
|
|
|
2006-10-08 02:44:33 +08:00
|
|
|
asmlinkage void plat_irq_dispatch(void)
|
2006-04-04 00:56:36 +08:00
|
|
|
{
|
|
|
|
unsigned int pending = read_c0_cause() & read_c0_status();
|
|
|
|
|
|
|
|
if (pending & STATUSF_IP7)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(TX4938_IRQ_CPU_TIMER);
|
2006-04-04 00:56:36 +08:00
|
|
|
else if (pending & STATUSF_IP2) {
|
2007-08-02 22:36:02 +08:00
|
|
|
int irq = txx9_irq();
|
|
|
|
if (irq == TX4938_IRQ_PIC_BEG + TX4938_IR_INT(0))
|
|
|
|
irq = toshiba_rbtx4938_irq_nested(irq);
|
|
|
|
if (irq >= 0)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(irq);
|
2006-04-04 00:56:36 +08:00
|
|
|
else
|
2006-10-08 02:44:33 +08:00
|
|
|
spurious_interrupt();
|
2006-04-04 00:56:36 +08:00
|
|
|
} else if (pending & STATUSF_IP1)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(TX4938_IRQ_USER1);
|
2006-04-04 00:56:36 +08:00
|
|
|
else if (pending & STATUSF_IP0)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(TX4938_IRQ_USER0);
|
2006-04-04 00:56:36 +08:00
|
|
|
}
|