aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-clps711x
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-11-17 08:57:14 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 12:57:42 -0500
commit99f04c8f69753e4032059eeb0c21197948e459f7 (patch)
tree876d54413124fb63dcab9d95446a8686953d2414 /arch/arm/mach-clps711x
parent0d8be81c0e15ad8ebdd35bbbeb35b03f85a4b558 (diff)
ARM: clps711x: Implement usage "MULTI_IRQ_HANDLER" kernel option for a platform
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-clps711x')
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c1
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c1
-rw-r--r--arch/arm/mach-clps711x/clep7312.c3
-rw-r--r--arch/arm/mach-clps711x/common.c45
-rw-r--r--arch/arm/mach-clps711x/common.h3
-rw-r--r--arch/arm/mach-clps711x/edb7211.c1
-rw-r--r--arch/arm/mach-clps711x/fortunet.c1
-rw-r--r--arch/arm/mach-clps711x/include/mach/entry-macro.S51
-rw-r--r--arch/arm/mach-clps711x/p720t.c1
9 files changed, 49 insertions, 58 deletions
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index b90a31659de4..3de19554d800 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -75,6 +75,7 @@ MACHINE_START(AUTCPU12, "autronix autcpu12")
75 .init_irq = clps711x_init_irq, 75 .init_irq = clps711x_init_irq,
76 .timer = &clps711x_timer, 76 .timer = &clps711x_timer,
77 .init_machine = autcpu12_init, 77 .init_machine = autcpu12_init,
78 .handle_irq = clps711x_handle_irq,
78 .restart = clps711x_restart, 79 .restart = clps711x_restart,
79MACHINE_END 80MACHINE_END
80 81
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index 133794c4b654..60900ddf97c9 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -142,5 +142,6 @@ MACHINE_START(CDB89712, "Cirrus-CDB89712")
142 .init_irq = clps711x_init_irq, 142 .init_irq = clps711x_init_irq,
143 .timer = &clps711x_timer, 143 .timer = &clps711x_timer,
144 .init_machine = cdb89712_init, 144 .init_machine = cdb89712_init,
145 .handle_irq = clps711x_handle_irq,
145 .restart = clps711x_restart, 146 .restart = clps711x_restart,
146MACHINE_END 147MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index be776c5092dd..0b32a487183b 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -33,7 +33,6 @@ fixup_clep7312(struct tag *tags, char **cmdline, struct meminfo *mi)
33 mi->bank[0].size = 0x01000000; 33 mi->bank[0].size = 0x01000000;
34} 34}
35 35
36
37MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") 36MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
38 /* Maintainer: Nobody */ 37 /* Maintainer: Nobody */
39 .atag_offset = 0x0100, 38 .atag_offset = 0x0100,
@@ -42,6 +41,6 @@ MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
42 .map_io = clps711x_map_io, 41 .map_io = clps711x_map_io,
43 .init_irq = clps711x_init_irq, 42 .init_irq = clps711x_init_irq,
44 .timer = &clps711x_timer, 43 .timer = &clps711x_timer,
44 .handle_irq = clps711x_handle_irq,
45 .restart = clps711x_restart, 45 .restart = clps711x_restart,
46MACHINE_END 46MACHINE_END
47
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
index 286d6e6d5f5a..08420244c058 100644
--- a/arch/arm/mach-clps711x/common.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -29,6 +29,7 @@
29#include <linux/clockchips.h> 29#include <linux/clockchips.h>
30#include <linux/clk-provider.h> 30#include <linux/clk-provider.h>
31 31
32#include <asm/exception.h>
32#include <asm/mach/map.h> 33#include <asm/mach/map.h>
33#include <asm/mach/time.h> 34#include <asm/mach/time.h>
34#include <asm/system_misc.h> 35#include <asm/system_misc.h>
@@ -134,13 +135,11 @@ static struct irq_chip int2_chip = {
134 .irq_unmask = int2_unmask, 135 .irq_unmask = int2_unmask,
135}; 136};
136 137
137struct clps711x_irqdesc { 138static struct {
138 int nr; 139 int nr;
139 struct irq_chip *chip; 140 struct irq_chip *chip;
140 irq_flow_handler_t handle; 141 irq_flow_handler_t handle;
141}; 142} clps711x_irqdescs[] __initdata = {
142
143static struct clps711x_irqdesc clps711x_irqdescs[] __initdata = {
144 { IRQ_CSINT, &int1_chip, handle_fasteoi_irq, }, 143 { IRQ_CSINT, &int1_chip, handle_fasteoi_irq, },
145 { IRQ_EINT1, &int1_chip, handle_level_irq, }, 144 { IRQ_EINT1, &int1_chip, handle_level_irq, },
146 { IRQ_EINT2, &int1_chip, handle_level_irq, }, 145 { IRQ_EINT2, &int1_chip, handle_level_irq, },
@@ -191,6 +190,44 @@ void __init clps711x_init_irq(void)
191 } 190 }
192} 191}
193 192
193inline u32 fls16(u32 x)
194{
195 u32 r = 15;
196
197 if (!(x & 0xff00)) {
198 x <<= 8;
199 r -= 8;
200 }
201 if (!(x & 0xf000)) {
202 x <<= 4;
203 r -= 4;
204 }
205 if (!(x & 0xc000)) {
206 x <<= 2;
207 r -= 2;
208 }
209 if (!(x & 0x8000))
210 r--;
211
212 return r;
213}
214
215asmlinkage void __exception_irq_entry clps711x_handle_irq(struct pt_regs *regs)
216{
217 u32 irqstat;
218 void __iomem *base = CLPS711X_VIRT_BASE;
219
220 irqstat = readl_relaxed(base + INTSR1) & readl_relaxed(base + INTMR1);
221 if (irqstat) {
222 handle_IRQ(fls16(irqstat), regs);
223 return;
224 }
225
226 irqstat = readl_relaxed(base + INTSR2) & readl_relaxed(base + INTMR2);
227 if (likely(irqstat))
228 handle_IRQ(fls16(irqstat) + 16, regs);
229}
230
194static void clps711x_clockevent_set_mode(enum clock_event_mode mode, 231static void clps711x_clockevent_set_mode(enum clock_event_mode mode,
195 struct clock_event_device *evt) 232 struct clock_event_device *evt)
196{ 233{
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h
index 28b1701b7993..3c7f12cb81c1 100644
--- a/arch/arm/mach-clps711x/common.h
+++ b/arch/arm/mach-clps711x/common.h
@@ -12,5 +12,6 @@ struct sys_timer;
12 12
13extern void clps711x_map_io(void); 13extern void clps711x_map_io(void);
14extern void clps711x_init_irq(void); 14extern void clps711x_init_irq(void);
15extern struct sys_timer clps711x_timer; 15extern void clps711x_handle_irq(struct pt_regs *regs);
16extern void clps711x_restart(char mode, const char *cmd); 16extern void clps711x_restart(char mode, const char *cmd);
17extern struct sys_timer clps711x_timer;
diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c
index 7b161dd40e8d..cc32a65d6982 100644
--- a/arch/arm/mach-clps711x/edb7211.c
+++ b/arch/arm/mach-clps711x/edb7211.c
@@ -98,5 +98,6 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
98 .init_irq = clps711x_init_irq, 98 .init_irq = clps711x_init_irq,
99 .timer = &clps711x_timer, 99 .timer = &clps711x_timer,
100 .init_machine = edb7211_init, 100 .init_machine = edb7211_init,
101 .handle_irq = clps711x_handle_irq,
101 .restart = clps711x_restart, 102 .restart = clps711x_restart,
102MACHINE_END 103MACHINE_END
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index a5c08162bff9..7d0125580366 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -79,5 +79,6 @@ MACHINE_START(FORTUNET, "ARM-FortuNet")
79 .map_io = clps711x_map_io, 79 .map_io = clps711x_map_io,
80 .init_irq = clps711x_init_irq, 80 .init_irq = clps711x_init_irq,
81 .timer = &clps711x_timer, 81 .timer = &clps711x_timer,
82 .handle_irq = clps711x_handle_irq,
82 .restart = clps711x_restart, 83 .restart = clps711x_restart,
83MACHINE_END 84MACHINE_END
diff --git a/arch/arm/mach-clps711x/include/mach/entry-macro.S b/arch/arm/mach-clps711x/include/mach/entry-macro.S
deleted file mode 100644
index 56e5c2c23504..000000000000
--- a/arch/arm/mach-clps711x/include/mach/entry-macro.S
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * arch/arm/mach-clps711x/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for CLPS711X-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <mach/hardware.h>
11
12 .macro get_irqnr_preamble, base, tmp
13 .endm
14
15#if (INTSR2 - INTSR1) != (INTMR2 - INTMR1)
16#error INTSR stride != INTMR stride
17#endif
18
19 .macro get_irqnr_and_base, irqnr, stat, base, mask
20 mov \base, #CLPS711X_VIRT_BASE
21 ldr \stat, [\base, #INTSR1]
22 ldr \mask, [\base, #INTMR1]
23 mov \irqnr, #4
24 mov \mask, \mask, lsl #16
25 and \stat, \stat, \mask, lsr #16
26 movs \stat, \stat, lsr #4
27 bne 1001f
28
29 add \base, \base, #INTSR2 - INTSR1
30 ldr \stat, [\base, #INTSR1]
31 ldr \mask, [\base, #INTMR1]
32 mov \irqnr, #16
33 mov \mask, \mask, lsl #16
34 and \stat, \stat, \mask, lsr #16
35
361001: tst \stat, #255
37 addeq \irqnr, \irqnr, #8
38 moveq \stat, \stat, lsr #8
39 tst \stat, #15
40 addeq \irqnr, \irqnr, #4
41 moveq \stat, \stat, lsr #4
42 tst \stat, #3
43 addeq \irqnr, \irqnr, #2
44 moveq \stat, \stat, lsr #2
45 tst \stat, #1
46 addeq \irqnr, \irqnr, #1
47 moveq \stat, \stat, lsr #1
48 tst \stat, #1 @ bit 0 should be set
49 .endm
50
51
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index fbe75527d60b..a58a0585e3e7 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -142,5 +142,6 @@ MACHINE_START(P720T, "ARM-Prospector720T")
142 .timer = &clps711x_timer, 142 .timer = &clps711x_timer,
143 .init_machine = p720t_init, 143 .init_machine = p720t_init,
144 .init_late = p720t_init_late, 144 .init_late = p720t_init_late,
145 .handle_irq = clps711x_handle_irq,
145 .restart = clps711x_restart, 146 .restart = clps711x_restart,
146MACHINE_END 147MACHINE_END