diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2011-07-20 11:24:14 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2011-10-23 08:32:29 -0400 |
commit | 292b293ceef2eda1f96f0c90b96e954d7bdabd1c (patch) | |
tree | 931da77e74e1aee404ffb61f8ffe2f6acb73f80c /arch/arm/mach-msm | |
parent | 88b6fc8c57055590d8e9538f6faa85483db8c366 (diff) |
ARM: gic: consolidate PPI handling
PPI handling is a bit of an odd beast. It uses its own low level
handling code and is hardwired to the local timers (hence lacking
a registration interface).
Instead, switch the low handling to the normal SPI handling code.
PPIs are handled by the handle_percpu_devid_irq flow.
This also allows the removal of some duplicated code.
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: David Brown <davidb@codeaurora.org>
Tested-by: David Brown <davidb@codeaurora.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm/mach-msm')
-rw-r--r-- | arch/arm/mach-msm/board-msm8x60.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/entry-macro-qgic.S | 73 |
2 files changed, 1 insertions, 83 deletions
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c index 1163b6fd05d2..d70a2f643613 100644 --- a/arch/arm/mach-msm/board-msm8x60.c +++ b/arch/arm/mach-msm/board-msm8x60.c | |||
@@ -36,8 +36,6 @@ static void __init msm8x60_map_io(void) | |||
36 | 36 | ||
37 | static void __init msm8x60_init_irq(void) | 37 | static void __init msm8x60_init_irq(void) |
38 | { | 38 | { |
39 | unsigned int i; | ||
40 | |||
41 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, | 39 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
42 | (void *)MSM_QGIC_CPU_BASE); | 40 | (void *)MSM_QGIC_CPU_BASE); |
43 | 41 | ||
@@ -49,15 +47,6 @@ static void __init msm8x60_init_irq(void) | |||
49 | */ | 47 | */ |
50 | if (!machine_is_msm8x60_sim()) | 48 | if (!machine_is_msm8x60_sim()) |
51 | writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); | 49 | writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
52 | |||
53 | /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet | ||
54 | * as they are configured as level, which does not play nice with | ||
55 | * handle_percpu_irq. | ||
56 | */ | ||
57 | for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { | ||
58 | if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) | ||
59 | irq_set_handler(i, handle_percpu_irq); | ||
60 | } | ||
61 | } | 50 | } |
62 | 51 | ||
63 | static void __init msm8x60_init(void) | 52 | static void __init msm8x60_init(void) |
diff --git a/arch/arm/mach-msm/include/mach/entry-macro-qgic.S b/arch/arm/mach-msm/include/mach/entry-macro-qgic.S index 12467157afb9..717076f3ca73 100644 --- a/arch/arm/mach-msm/include/mach/entry-macro-qgic.S +++ b/arch/arm/mach-msm/include/mach/entry-macro-qgic.S | |||
@@ -8,81 +8,10 @@ | |||
8 | * warranty of any kind, whether express or implied. | 8 | * warranty of any kind, whether express or implied. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <mach/hardware.h> | 11 | #include <asm/hardware/entry-macro-gic.S> |
12 | #include <asm/hardware/gic.h> | ||
13 | 12 | ||
14 | .macro disable_fiq | 13 | .macro disable_fiq |
15 | .endm | 14 | .endm |
16 | 15 | ||
17 | .macro get_irqnr_preamble, base, tmp | ||
18 | ldr \base, =gic_cpu_base_addr | ||
19 | ldr \base, [\base] | ||
20 | .endm | ||
21 | |||
22 | .macro arch_ret_to_user, tmp1, tmp2 | 16 | .macro arch_ret_to_user, tmp1, tmp2 |
23 | .endm | 17 | .endm |
24 | |||
25 | /* | ||
26 | * The interrupt numbering scheme is defined in the | ||
27 | * interrupt controller spec. To wit: | ||
28 | * | ||
29 | * Migrated the code from ARM MP port to be more consistent | ||
30 | * with interrupt processing , the following still holds true | ||
31 | * however, all interrupts are treated the same regardless of | ||
32 | * if they are local IPI or PPI | ||
33 | * | ||
34 | * Interrupts 0-15 are IPI | ||
35 | * 16-31 are PPI | ||
36 | * (16-18 are the timers) | ||
37 | * 32-1020 are global | ||
38 | * 1021-1022 are reserved | ||
39 | * 1023 is "spurious" (no interrupt) | ||
40 | * | ||
41 | * A simple read from the controller will tell us the number of the | ||
42 | * highest priority enabled interrupt. We then just need to check | ||
43 | * whether it is in the valid range for an IRQ (0-1020 inclusive). | ||
44 | * | ||
45 | * Base ARM code assumes that the local (private) peripheral interrupts | ||
46 | * are not valid, we treat them differently, in that the privates are | ||
47 | * handled like normal shared interrupts with the exception that only | ||
48 | * one processor can register the interrupt and the handler must be | ||
49 | * the same for all processors. | ||
50 | */ | ||
51 | |||
52 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
53 | |||
54 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 =srcCPU, | ||
55 | 9-0 =int # */ | ||
56 | |||
57 | bic \irqnr, \irqstat, #0x1c00 @mask src | ||
58 | cmp \irqnr, #15 | ||
59 | ldr \tmp, =1021 | ||
60 | cmpcc \irqnr, \irqnr | ||
61 | cmpne \irqnr, \tmp | ||
62 | cmpcs \irqnr, \irqnr | ||
63 | |||
64 | .endm | ||
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 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
73 | bic \irqnr, \irqstat, #0x1c00 | ||
74 | cmp \irqnr, #16 | ||
75 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
76 | cmpcs \irqnr, \irqnr | ||
77 | .endm | ||
78 | |||
79 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
80 | |||
81 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
82 | bic \irqnr, \irqstat, #0x1c00 | ||
83 | mov \tmp, #0 | ||
84 | cmp \irqnr, #16 | ||
85 | moveq \tmp, #1 | ||
86 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
87 | cmp \tmp, #0 | ||
88 | .endm | ||