diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-09-20 08:28:39 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-09-26 05:40:35 -0400 |
commit | 58a926008cd6f3788b73af0335b695dee7859e8d (patch) | |
tree | 1bf0ffc06b466d62193f4a151dac8976f74d1e34 /arch/arm/plat-mxc | |
parent | b6de943bdffdc94482dd1a29015ca75e893bb5f2 (diff) |
ARM i.MX tzic: add handle_irq function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/include/mach/common.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/tzic.c | 24 |
2 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h index 6a6182df1870..893ec911e666 100644 --- a/arch/arm/plat-mxc/include/mach/common.h +++ b/arch/arm/plat-mxc/include/mach/common.h | |||
@@ -74,6 +74,7 @@ extern int mx53_revision(void); | |||
74 | extern int mx53_display_revision(void); | 74 | extern int mx53_display_revision(void); |
75 | 75 | ||
76 | void avic_handle_irq(struct pt_regs *); | 76 | void avic_handle_irq(struct pt_regs *); |
77 | void tzic_handle_irq(struct pt_regs *); | ||
77 | 78 | ||
78 | #define imx1_handle_irq avic_handle_irq | 79 | #define imx1_handle_irq avic_handle_irq |
79 | #define imx21_handle_irq avic_handle_irq | 80 | #define imx21_handle_irq avic_handle_irq |
@@ -81,5 +82,8 @@ void avic_handle_irq(struct pt_regs *); | |||
81 | #define imx27_handle_irq avic_handle_irq | 82 | #define imx27_handle_irq avic_handle_irq |
82 | #define imx31_handle_irq avic_handle_irq | 83 | #define imx31_handle_irq avic_handle_irq |
83 | #define imx35_handle_irq avic_handle_irq | 84 | #define imx35_handle_irq avic_handle_irq |
85 | #define imx50_handle_irq tzic_handle_irq | ||
86 | #define imx51_handle_irq tzic_handle_irq | ||
87 | #define imx53_handle_irq tzic_handle_irq | ||
84 | 88 | ||
85 | #endif | 89 | #endif |
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c index f257fccdc394..b7a272d16d37 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 */ |
@@ -96,6 +96,28 @@ static __init void tzic_init_gc(unsigned int irq_start) | |||
96 | irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0); | 96 | irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0); |
97 | } | 97 | } |
98 | 98 | ||
99 | asmlinkage void __exception_irq_entry tzic_handle_irq(struct pt_regs *regs) | ||
100 | { | ||
101 | u32 stat; | ||
102 | int i, irqofs, handled; | ||
103 | |||
104 | do { | ||
105 | handled = 0; | ||
106 | |||
107 | for (i = 0; i < 4; i++) { | ||
108 | stat = __raw_readl(tzic_base + TZIC_HIPND(i)) & | ||
109 | __raw_readl(tzic_base + TZIC_INTSEC0(i)); | ||
110 | |||
111 | while (stat) { | ||
112 | handled = 1; | ||
113 | irqofs = fls(stat) - 1; | ||
114 | handle_IRQ(irqofs + i * 32, regs); | ||
115 | stat &= ~(1 << irqofs); | ||
116 | } | ||
117 | } | ||
118 | } while (handled); | ||
119 | } | ||
120 | |||
99 | /* | 121 | /* |
100 | * This function initializes the TZIC hardware and disables all the | 122 | * This function initializes the TZIC hardware and disables all the |
101 | * interrupts. It registers the interrupt enable and disable functions | 123 | * interrupts. It registers the interrupt enable and disable functions |