diff options
author | Magnus Damm <damm@opensource.se> | 2010-12-22 07:17:09 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-06 20:40:01 -0500 |
commit | 3dff8804fc087d55c593dda0ff78f475088ec57d (patch) | |
tree | 793630a80f6ebe8518529cedd210749f808d93d8 /arch/arm/mach-shmobile | |
parent | eb6908a279dfbe2e1c1714c185e0f523a9749607 (diff) |
ARM: mach-shmobile: Use shared GIC entry macros
Use the GIC demux code in asm/hardware/entry-macro-gic.S
on the R-Mobile / SH-Mobile processors.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/entry-macro-gic.S | 62 |
1 files changed, 1 insertions, 61 deletions
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S b/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S index 50b1f16d54a2..48872dd15269 100644 --- a/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S +++ b/arch/arm/mach-shmobile/include/mach/entry-macro-gic.S | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | #include <asm/hardware/gic.h> | 18 | #include <asm/hardware/gic.h> |
19 | #include <asm/hardware/entry-macro-gic.S> | ||
19 | 20 | ||
20 | .macro disable_fiq | 21 | .macro disable_fiq |
21 | .endm | 22 | .endm |
@@ -26,64 +27,3 @@ | |||
26 | 27 | ||
27 | .macro arch_ret_to_user, tmp1, tmp2 | 28 | .macro arch_ret_to_user, tmp1, tmp2 |
28 | .endm | 29 | .endm |
29 | |||
30 | /* | ||
31 | * The interrupt numbering scheme is defined in the | ||
32 | * interrupt controller spec. To wit: | ||
33 | * | ||
34 | * Interrupts 0-15 are IPI | ||
35 | * 16-28 are reserved | ||
36 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
37 | * 32-1020 are global | ||
38 | * 1021-1022 are reserved | ||
39 | * 1023 is "spurious" (no interrupt) | ||
40 | * | ||
41 | * For now, we ignore all local interrupts so only return an | ||
42 | * interrupt if it's between 30 and 1020. The test_for_ipi | ||
43 | * routine below will pick up on IPIs. | ||
44 | * | ||
45 | * A simple read from the controller will tell us the number of | ||
46 | * the highest priority enabled interrupt. We then just need to | ||
47 | * check whether it is in the valid range for an IRQ (30-1020 | ||
48 | * inclusive). | ||
49 | */ | ||
50 | |||
51 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
52 | |||
53 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
54 | /* bits 12-10 = src CPU, 9-0 = int # */ | ||
55 | |||
56 | ldr \tmp, =1021 | ||
57 | bic \irqnr, \irqstat, #0x1c00 | ||
58 | cmp \irqnr, #29 | ||
59 | cmpcc \irqnr, \irqnr | ||
60 | cmpne \irqnr, \tmp | ||
61 | cmpcs \irqnr, \irqnr | ||
62 | |||
63 | .endm | ||
64 | |||
65 | /* | ||
66 | * We assume that irqstat (the raw value of the IRQ acknowledge | ||
67 | * register) is preserved from the macro above. | ||
68 | * If there is an IPI, we immediately signal end of interrupt on the | ||
69 | * controller, since this requires the original irqstat value which | ||
70 | * we won't easily be able to recreate later. | ||
71 | */ | ||
72 | |||
73 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
74 | bic \irqnr, \irqstat, #0x1c00 | ||
75 | cmp \irqnr, #16 | ||
76 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
77 | cmpcs \irqnr, \irqnr | ||
78 | .endm | ||
79 | |||
80 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
81 | |||
82 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
83 | bic \irqnr, \irqstat, #0x1c00 | ||
84 | mov \tmp, #0 | ||
85 | cmp \irqnr, #29 | ||
86 | moveq \tmp, #1 | ||
87 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
88 | cmp \tmp, #0 | ||
89 | .endm | ||