/*1* irq.c: GT64120 Interrupt Controller2*3* Copyright (C) 2006, Wind River System Inc.4* Author: Rongkai.Zhan, <[email protected]>5*6* This program is free software; you can redistribute it and/or modify it7* under the terms of the GNU General Public License as published by the8* Free Software Foundation; either version 2 of the License, or (at your9* option) any later version.10*/11#include <linux/hardirq.h>12#include <linux/init.h>13#include <linux/irq.h>1415#include <asm/gt64120.h>16#include <asm/irq_cpu.h>17#include <asm/mipsregs.h>1819asmlinkage void plat_irq_dispatch(void)20{21unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;2223if (pending & STATUSF_IP7)24do_IRQ(WRPPMC_MIPS_TIMER_IRQ); /* CPU Compare/Count internal timer */25else if (pending & STATUSF_IP6)26do_IRQ(WRPPMC_UART16550_IRQ); /* UART 16550 port */27else if (pending & STATUSF_IP3)28do_IRQ(WRPPMC_PCI_INTA_IRQ); /* PCI INT_A */29else30spurious_interrupt();31}3233/**34* Initialize GT64120 Interrupt Controller35*/36void gt64120_init_pic(void)37{38/* clear CPU Interrupt Cause Registers */39GT_WRITE(GT_INTRCAUSE_OFS, (0x1F << 21));40GT_WRITE(GT_HINTRCAUSE_OFS, 0x00);4142/* Disable all interrupts from GT64120 bridge chip */43GT_WRITE(GT_INTRMASK_OFS, 0x00);44GT_WRITE(GT_HINTRMASK_OFS, 0x00);45GT_WRITE(GT_PCI0_ICMASK_OFS, 0x00);46GT_WRITE(GT_PCI0_HICMASK_OFS, 0x00);47}4849void __init arch_init_irq(void)50{51/* IRQ 0 - 7 are for MIPS common irq_cpu controller */52mips_cpu_irq_init();5354gt64120_init_pic();55}565758