summaryrefslogtreecommitdiff
path: root/target/linux/ramips/files/arch/mips/ralink/rt305x
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-30 19:15:58 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-30 19:15:58 +0000
commit60da4b4a94df250ac7cde9d73bdc97fb1ebc5774 (patch)
treee8875be73b5751cda5f611e011e389b2f55c49fb /target/linux/ramips/files/arch/mips/ralink/rt305x
parentb887a6d197170b719028f31085876d8deaed35b6 (diff)
[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/rt305x')
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt305x/irq.c52
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c1
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c1
3 files changed, 4 insertions, 50 deletions
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/irq.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/irq.c
index 168b2390b9..acd1880f5c 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/irq.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/irq.c
@@ -16,6 +16,7 @@
#include <asm/irq_cpu.h>
#include <asm/mipsregs.h>
+#include <asm/mach-ralink/common.h>
#include <asm/mach-ralink/rt305x.h>
#include <asm/mach-ralink/rt305x_regs.h>
@@ -23,7 +24,7 @@ static void rt305x_intc_irq_dispatch(void)
{
u32 pending;
- pending = rt305x_intc_rr(INTC_REG_STATUS0);
+ pending = ramips_intc_get_status();
if (pending & RT305X_INTC_INT_TIMER0)
do_IRQ(RT305X_INTC_IRQ_TIMER0);
@@ -43,52 +44,6 @@ static void rt305x_intc_irq_dispatch(void)
spurious_interrupt();
}
-static void rt305x_intc_irq_unmask(unsigned int irq)
-{
- irq -= RT305X_INTC_IRQ_BASE;
- rt305x_intc_wr((1 << irq), INTC_REG_ENABLE);
-}
-
-static void rt305x_intc_irq_mask(unsigned int irq)
-{
- irq -= RT305X_INTC_IRQ_BASE;
- rt305x_intc_wr((1 << irq), INTC_REG_DISABLE);
-}
-
-struct irq_chip rt305x_intc_irq_chip = {
- .name = "RT305X INTC",
- .unmask = rt305x_intc_irq_unmask,
- .mask = rt305x_intc_irq_mask,
- .mask_ack = rt305x_intc_irq_mask,
-};
-
-static struct irqaction rt305x_intc_irqaction = {
- .handler = no_action,
- .name = "cascade [RT305X INTC]",
-};
-
-static void __init rt305x_intc_irq_init(void)
-{
- int i;
-
- /* disable all interrupts */
- rt305x_intc_wr(~0, INTC_REG_DISABLE);
-
- /* route all INTC interrupts to MIPS HW0 interrupt */
- rt305x_intc_wr(0, INTC_REG_TYPE);
-
- for (i = RT305X_INTC_IRQ_BASE;
- i < RT305X_INTC_IRQ_BASE + RT305X_INTC_IRQ_COUNT; i++) {
- set_irq_chip_and_handler(i, &rt305x_intc_irq_chip,
- handle_level_irq);
- }
-
- setup_irq(RT305X_CPU_IRQ_INTC, &rt305x_intc_irqaction);
-
- /* enable interrupt masking */
- rt305x_intc_wr(RT305X_INTC_INT_GLOBAL, INTC_REG_ENABLE);
-}
-
asmlinkage void plat_irq_dispatch(void)
{
unsigned long pending;
@@ -114,5 +69,6 @@ asmlinkage void plat_irq_dispatch(void)
void __init arch_init_irq(void)
{
mips_cpu_irq_init();
- rt305x_intc_irq_init();
+ ramips_intc_irq_init(RT305X_INTC_BASE, RT305X_CPU_IRQ_INTC,
+ RT305X_INTC_IRQ_BASE);
}
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
index 9d940a2f54..b2ab3cdf50 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/rt305x.c
@@ -26,7 +26,6 @@ EXPORT_SYMBOL_GPL(rt305x_cpu_freq);
unsigned long rt305x_sys_freq;
EXPORT_SYMBOL_GPL(rt305x_sys_freq);
-void __iomem * rt305x_intc_base;
void __iomem * rt305x_sysc_base;
void __iomem * rt305x_memc_base;
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c
index 4af495b78b..d574ef650e 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/setup.c
@@ -103,7 +103,6 @@ void __init plat_mem_setup(void)
{
set_io_port_base(KSEG1);
- rt305x_intc_base = ioremap_nocache(RT305X_INTC_BASE, PAGE_SIZE);
rt305x_sysc_base = ioremap_nocache(RT305X_SYSC_BASE, PAGE_SIZE);
rt305x_memc_base = ioremap_nocache(RT305X_MEMC_BASE, PAGE_SIZE);