2006-05-06 17:04:20 +08:00
|
|
|
/*
|
|
|
|
* irq.c: GT64120 Interrupt Controller
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006, Wind River System Inc.
|
|
|
|
* Author: Rongkai.Zhan, <rongkai.zhan@windriver.com>
|
|
|
|
*
|
2013-01-22 19:59:30 +08:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
2006-05-06 17:04:20 +08:00
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
2007-10-09 23:28:26 +08:00
|
|
|
#include <linux/hardirq.h>
|
2006-05-06 17:04:20 +08:00
|
|
|
#include <linux/init.h>
|
2007-10-09 23:28:26 +08:00
|
|
|
#include <linux/irq.h>
|
|
|
|
|
2006-05-06 17:04:20 +08:00
|
|
|
#include <asm/gt64120.h>
|
2007-10-09 23:28:26 +08:00
|
|
|
#include <asm/irq_cpu.h>
|
|
|
|
#include <asm/mipsregs.h>
|
2006-05-06 17:04:20 +08:00
|
|
|
|
2006-10-08 02:44:33 +08:00
|
|
|
asmlinkage void plat_irq_dispatch(void)
|
2006-06-20 18:15:02 +08:00
|
|
|
{
|
2007-03-19 08:13:37 +08:00
|
|
|
unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
|
2006-06-20 18:15:02 +08:00
|
|
|
|
|
|
|
if (pending & STATUSF_IP7)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(WRPPMC_MIPS_TIMER_IRQ); /* CPU Compare/Count internal timer */
|
2006-06-20 18:15:02 +08:00
|
|
|
else if (pending & STATUSF_IP6)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(WRPPMC_UART16550_IRQ); /* UART 16550 port */
|
2006-06-20 18:15:02 +08:00
|
|
|
else if (pending & STATUSF_IP3)
|
2006-10-08 02:44:33 +08:00
|
|
|
do_IRQ(WRPPMC_PCI_INTA_IRQ); /* PCI INT_A */
|
2006-06-20 18:15:02 +08:00
|
|
|
else
|
2006-10-08 02:44:33 +08:00
|
|
|
spurious_interrupt();
|
2006-06-20 18:15:02 +08:00
|
|
|
}
|
2006-05-06 17:04:20 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize GT64120 Interrupt Controller
|
|
|
|
*/
|
|
|
|
void gt64120_init_pic(void)
|
|
|
|
{
|
|
|
|
/* clear CPU Interrupt Cause Registers */
|
|
|
|
GT_WRITE(GT_INTRCAUSE_OFS, (0x1F << 21));
|
|
|
|
GT_WRITE(GT_HINTRCAUSE_OFS, 0x00);
|
|
|
|
|
|
|
|
/* Disable all interrupts from GT64120 bridge chip */
|
|
|
|
GT_WRITE(GT_INTRMASK_OFS, 0x00);
|
|
|
|
GT_WRITE(GT_HINTRMASK_OFS, 0x00);
|
|
|
|
GT_WRITE(GT_PCI0_ICMASK_OFS, 0x00);
|
|
|
|
GT_WRITE(GT_PCI0_HICMASK_OFS, 0x00);
|
|
|
|
}
|
|
|
|
|
|
|
|
void __init arch_init_irq(void)
|
|
|
|
{
|
|
|
|
/* IRQ 0 - 7 are for MIPS common irq_cpu controller */
|
2007-01-08 01:14:29 +08:00
|
|
|
mips_cpu_irq_init();
|
2006-05-06 17:04:20 +08:00
|
|
|
|
|
|
|
gt64120_init_pic();
|
|
|
|
}
|