aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-mxc/tzic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc/tzic.c')
-rw-r--r--arch/arm/plat-mxc/tzic.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c
index f257fccdc394..e993a184189a 100644
--- a/arch/arm/plat-mxc/tzic.c
+++ b/arch/arm/plat-mxc/tzic.c
@@ -42,7 +42,7 @@
42#define TZIC_SRCCLAR0 0x0280 /* Source Clear Register 0 */ 42#define TZIC_SRCCLAR0 0x0280 /* Source Clear Register 0 */
43#define TZIC_PRIORITY0 0x0400 /* Priority Register 0 */ 43#define TZIC_PRIORITY0 0x0400 /* Priority Register 0 */
44#define TZIC_PND0 0x0D00 /* Pending Register 0 */ 44#define TZIC_PND0 0x0D00 /* Pending Register 0 */
45#define TZIC_HIPND0 0x0D80 /* High Priority Pending Register */ 45#define TZIC_HIPND(i) (0x0D80+ ((i) << 2)) /* High Priority Pending Register */
46#define TZIC_WAKEUP0(i) (0x0E00 + ((i) << 2)) /* Wakeup Config Register */ 46#define TZIC_WAKEUP0(i) (0x0E00 + ((i) << 2)) /* Wakeup Config Register */
47#define TZIC_SWINT 0x0F00 /* Software Interrupt Rigger Register */ 47#define TZIC_SWINT 0x0F00 /* Software Interrupt Rigger Register */
48#define TZIC_ID0 0x0FD0 /* Indentification Register 0 */ 48#define TZIC_ID0 0x0FD0 /* Indentification Register 0 */
@@ -74,6 +74,12 @@ static int tzic_set_irq_fiq(unsigned int irq, unsigned int type)
74 74
75static unsigned int *wakeup_intr[4]; 75static unsigned int *wakeup_intr[4];
76 76
77static struct mxc_extra_irq tzic_extra_irq = {
78#ifdef CONFIG_FIQ
79 .set_irq_fiq = tzic_set_irq_fiq,
80#endif
81};
82
77static __init void tzic_init_gc(unsigned int irq_start) 83static __init void tzic_init_gc(unsigned int irq_start)
78{ 84{
79 struct irq_chip_generic *gc; 85 struct irq_chip_generic *gc;
@@ -82,7 +88,7 @@ static __init void tzic_init_gc(unsigned int irq_start)
82 88
83 gc = irq_alloc_generic_chip("tzic", 1, irq_start, tzic_base, 89 gc = irq_alloc_generic_chip("tzic", 1, irq_start, tzic_base,
84 handle_level_irq); 90 handle_level_irq);
85 gc->private = tzic_set_irq_fiq; 91 gc->private = &tzic_extra_irq;
86 gc->wake_enabled = IRQ_MSK(32); 92 gc->wake_enabled = IRQ_MSK(32);
87 wakeup_intr[idx] = &gc->wake_active; 93 wakeup_intr[idx] = &gc->wake_active;
88 94
@@ -96,6 +102,28 @@ static __init void tzic_init_gc(unsigned int irq_start)
96 irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0); 102 irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0);
97} 103}
98 104
105asmlinkage void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs)
106{
107 u32 stat;
108 int i, irqofs, handled;
109
110 do {
111 handled = 0;
112
113 for (i = 0; i < 4; i++) {
114 stat = __raw_readl(tzic_base + TZIC_HIPND(i)) &
115 __raw_readl(tzic_base + TZIC_INTSEC0(i));
116
117 while (stat) {
118 handled = 1;
119 irqofs = fls(stat) - 1;
120 handle_IRQ(irqofs + i * 32, regs);
121 stat &= ~(1 << irqofs);
122 }
123 }
124 } while (handled);
125}
126
99/* 127/*
100 * This function initializes the TZIC hardware and disables all the 128 * This function initializes the TZIC hardware and disables all the
101 * interrupts. It registers the interrupt enable and disable functions 129 * interrupts. It registers the interrupt enable and disable functions