aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-w90x900/irq.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-12-31 20:34:16 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-03 12:53:31 -0500
commit7eb19553369c46cc1fa64caf120cbcab1b597f7c (patch)
treeef1a3beae706b9497c845d0a2557ceb4d2754998 /arch/arm/mach-w90x900/irq.c
parent6092848a2a23b660150a38bc06f59d75838d70c8 (diff)
parent8c384cdee3e04d6194a2c2b192b624754f990835 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-cpumask into merge-rr-cpumask
Conflicts: arch/x86/kernel/io_apic.c kernel/rcuclassic.c kernel/sched.c kernel/time/tick-sched.c Signed-off-by: Mike Travis <travis@sgi.com> [ mingo@elte.hu: backmerged typo fix for io_apic.c ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/arm/mach-w90x900/irq.c')
-rw-r--r--arch/arm/mach-w90x900/irq.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
new file mode 100644
index 000000000000..0b4fc194729c
--- /dev/null
+++ b/arch/arm/mach-w90x900/irq.c
@@ -0,0 +1,76 @@
1/*
2 * linux/arch/arm/mach-w90x900/irq.c
3 *
4 * based on linux/arch/arm/plat-s3c24xx/irq.c by Ben Dooks
5 *
6 * Copyright (c) 2008 Nuvoton technology corporation
7 * All rights reserved.
8 *
9 * Wan ZongShun <mcuos.com@gmail.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#include <linux/init.h>
19#include <linux/module.h>
20#include <linux/interrupt.h>
21#include <linux/ioport.h>
22#include <linux/ptrace.h>
23#include <linux/sysdev.h>
24#include <linux/io.h>
25
26#include <asm/irq.h>
27#include <asm/mach/irq.h>
28
29#include <mach/hardware.h>
30#include <mach/regs-irq.h>
31
32static void w90x900_irq_mask(unsigned int irq)
33{
34 __raw_writel(1 << irq, REG_AIC_MDCR);
35}
36
37/*
38 * By the w90p910 spec,any irq,only write 1
39 * to REG_AIC_EOSCR for ACK
40 */
41
42static void w90x900_irq_ack(unsigned int irq)
43{
44 __raw_writel(0x01, REG_AIC_EOSCR);
45}
46
47static void w90x900_irq_unmask(unsigned int irq)
48{
49 unsigned long mask;
50
51 if (irq == IRQ_T_INT_GROUP) {
52 mask = __raw_readl(REG_AIC_GEN);
53 __raw_writel(TIME_GROUP_IRQ | mask, REG_AIC_GEN);
54 __raw_writel(1 << IRQ_T_INT_GROUP, REG_AIC_MECR);
55 }
56 __raw_writel(1 << irq, REG_AIC_MECR);
57}
58
59static struct irq_chip w90x900_irq_chip = {
60 .ack = w90x900_irq_ack,
61 .mask = w90x900_irq_mask,
62 .unmask = w90x900_irq_unmask,
63};
64
65void __init w90x900_init_irq(void)
66{
67 int irqno;
68
69 __raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
70
71 for (irqno = IRQ_WDT; irqno <= IRQ_ADC; irqno++) {
72 set_irq_chip(irqno, &w90x900_irq_chip);
73 set_irq_handler(irqno, handle_level_irq);
74 set_irq_flags(irqno, IRQF_VALID);
75 }
76}