diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-08-30 19:15:58 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-08-30 19:15:58 +0000 |
commit | 2ce5ad745df2d33c15ca20f267292e3cd761dc22 (patch) | |
tree | e8875be73b5751cda5f611e011e389b2f55c49fb /target/linux/ramips/files/arch/mips/ralink/rt288x | |
parent | 425a717aaa3688613ff5d3f5e7c67ec928dae5b0 (diff) | |
download | upstream-2ce5ad745df2d33c15ca20f267292e3cd761dc22.tar.gz upstream-2ce5ad745df2d33c15ca20f267292e3cd761dc22.tar.bz2 upstream-2ce5ad745df2d33c15ca20f267292e3cd761dc22.zip |
[ramips] share common INTC code
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17440 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/arch/mips/ralink/rt288x')
3 files changed, 4 insertions, 50 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/irq.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/irq.c index 47a5374009..5465a4560d 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/irq.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/irq.c @@ -17,6 +17,7 @@ #include <asm/irq_cpu.h> #include <asm/mipsregs.h> +#include <asm/mach-ralink/common.h> #include <asm/mach-ralink/rt288x.h> #include <asm/mach-ralink/rt288x_regs.h> @@ -24,7 +25,7 @@ static void rt288x_intc_irq_dispatch(void) { u32 pending; - pending = rt288x_intc_rr(INTC_REG_STATUS0); + pending = ramips_intc_get_status(); if (pending & RT2880_INTC_INT_TIMER0) do_IRQ(RT2880_INTC_IRQ_TIMER0); @@ -47,52 +48,6 @@ static void rt288x_intc_irq_dispatch(void) spurious_interrupt(); } -static void rt288x_intc_irq_unmask(unsigned int irq) -{ - irq -= RT288X_INTC_IRQ_BASE; - rt288x_intc_wr((1 << irq), INTC_REG_ENABLE); -} - -static void rt288x_intc_irq_mask(unsigned int irq) -{ - irq -= RT288X_INTC_IRQ_BASE; - rt288x_intc_wr((1 << irq), INTC_REG_DISABLE); -} - -struct irq_chip rt288x_intc_irq_chip = { - .name = "RT288X INTC", - .unmask = rt288x_intc_irq_unmask, - .mask = rt288x_intc_irq_mask, - .mask_ack = rt288x_intc_irq_mask, -}; - -static struct irqaction rt288x_intc_irqaction = { - .handler = no_action, - .name = "cascade [RT288X INTC]", -}; - -static void __init rt288x_intc_irq_init(void) -{ - int i; - - /* disable all interrupts */ - rt288x_intc_wr(~0, INTC_REG_DISABLE); - - /* route all INTC interrupts to MIPS HW0 interrupt */ - rt288x_intc_wr(0, INTC_REG_TYPE); - - for (i = RT288X_INTC_IRQ_BASE; - i < RT288X_INTC_IRQ_BASE + RT288X_INTC_IRQ_COUNT; i++) { - irq_desc[i].status = IRQ_DISABLED; - set_irq_chip_and_handler(i, &rt288x_intc_irq_chip, - handle_level_irq); - } - - setup_irq(RT288X_CPU_IRQ_INTC, &rt288x_intc_irqaction); - - rt288x_intc_wr(RT2880_INTC_INT_GLOBAL, INTC_REG_ENABLE); -} - asmlinkage void plat_irq_dispatch(void) { unsigned long pending; @@ -121,5 +76,6 @@ asmlinkage void plat_irq_dispatch(void) void __init arch_init_irq(void) { mips_cpu_irq_init(); - rt288x_intc_irq_init(); + ramips_intc_irq_init(RT2880_INTC_BASE, RT288X_CPU_IRQ_INTC, + RT288X_INTC_IRQ_BASE); } diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c index cd429a1c05..0c47df8141 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/rt288x.c @@ -26,7 +26,6 @@ EXPORT_SYMBOL_GPL(rt288x_cpu_freq); unsigned long rt288x_sys_freq; EXPORT_SYMBOL_GPL(rt288x_sys_freq); -void __iomem * rt288x_intc_base; void __iomem * rt288x_sysc_base; void __iomem * rt288x_memc_base; diff --git a/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c b/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c index 186db29d11..d19105f546 100644 --- a/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c +++ b/target/linux/ramips/files/arch/mips/ralink/rt288x/setup.c @@ -108,7 +108,6 @@ void __init plat_mem_setup(void) { set_io_port_base(KSEG1); - rt288x_intc_base = ioremap_nocache(RT2880_INTC_BASE, RT2880_INTC_SIZE); rt288x_sysc_base = ioremap_nocache(RT2880_SYSC_BASE, RT2880_SYSC_SIZE); rt288x_memc_base = ioremap_nocache(RT2880_MEMC_BASE, RT2880_MEMC_SIZE); |