diff options
author | Magnus Damm <magnus.damm@gmail.com> | 2010-11-15 19:00:40 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-12-07 04:20:25 -0500 |
commit | 0005b349d5dc71471e1d47bd3efbf93f685620e1 (patch) | |
tree | 17a1433f07ab4d8c13b21dd73933a5eae2a7ff9b /arch | |
parent | c4d8c80f59f0611d747399a774ebef71f517a30c (diff) |
ARM: 6478/1: Use shared GIC entry macros on Tegra
Use the GIC demux code in asm/hardware/entry-macro-gic.S
on the Tegra subarchitecture.
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/entry-macro.S | 64 |
1 files changed, 1 insertions, 63 deletions
diff --git a/arch/arm/mach-tegra/include/mach/entry-macro.S b/arch/arm/mach-tegra/include/mach/entry-macro.S index 2ba9e5c9d2f6..dc0924915183 100644 --- a/arch/arm/mach-tegra/include/mach/entry-macro.S +++ b/arch/arm/mach-tegra/include/mach/entry-macro.S | |||
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #if defined(CONFIG_ARM_GIC) | 18 | #if defined(CONFIG_ARM_GIC) |
19 | 19 | ||
20 | #include <asm/hardware/gic.h> | 20 | #include <asm/hardware/entry-macro-gic.S> |
21 | 21 | ||
22 | /* Uses the GIC interrupt controller built into the cpu */ | 22 | /* Uses the GIC interrupt controller built into the cpu */ |
23 | #define ICTRL_BASE (IO_CPU_VIRT + 0x100) | 23 | #define ICTRL_BASE (IO_CPU_VIRT + 0x100) |
@@ -32,68 +32,6 @@ | |||
32 | 32 | ||
33 | .macro arch_ret_to_user, tmp1, tmp2 | 33 | .macro arch_ret_to_user, tmp1, tmp2 |
34 | .endm | 34 | .endm |
35 | |||
36 | /* | ||
37 | * The interrupt numbering scheme is defined in the | ||
38 | * interrupt controller spec. To wit: | ||
39 | * | ||
40 | * Interrupts 0-15 are IPI | ||
41 | * 16-28 are reserved | ||
42 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
43 | * 32-1020 are global | ||
44 | * 1021-1022 are reserved | ||
45 | * 1023 is "spurious" (no interrupt) | ||
46 | * | ||
47 | * For now, we ignore all local interrupts so only return an interrupt | ||
48 | * if it's between 30 and 1020. The test_for_ipi routine below will | ||
49 | * pick up on IPIs. | ||
50 | * | ||
51 | * A simple read from the controller will tell us the number of the | ||
52 | * highest priority enabled interrupt. We then just need to check | ||
53 | * whether it is in the valid range for an IRQ (30-1020 inclusive). | ||
54 | */ | ||
55 | |||
56 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
57 | |||
58 | /* bits 12-10 = src CPU, 9-0 = int # */ | ||
59 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
60 | |||
61 | ldr \tmp, =1021 | ||
62 | |||
63 | bic \irqnr, \irqstat, #0x1c00 | ||
64 | |||
65 | cmp \irqnr, #29 | ||
66 | cmpcc \irqnr, \irqnr | ||
67 | cmpne \irqnr, \tmp | ||
68 | cmpcs \irqnr, \irqnr | ||
69 | |||
70 | .endm | ||
71 | |||
72 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
73 | * register) is preserved from the macro above. | ||
74 | * If there is an IPI, we immediately signal end of interrupt on the | ||
75 | * controller, since this requires the original irqstat value which | ||
76 | * we won't easily be able to recreate later. | ||
77 | */ | ||
78 | |||
79 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
80 | bic \irqnr, \irqstat, #0x1c00 | ||
81 | cmp \irqnr, #16 | ||
82 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
83 | cmpcs \irqnr, \irqnr | ||
84 | .endm | ||
85 | |||
86 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
87 | |||
88 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
89 | bic \irqnr, \irqstat, #0x1c00 | ||
90 | mov \tmp, #0 | ||
91 | cmp \irqnr, #29 | ||
92 | moveq \tmp, #1 | ||
93 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
94 | cmp \tmp, #0 | ||
95 | .endm | ||
96 | |||
97 | #else | 35 | #else |
98 | /* legacy interrupt controller for AP16 */ | 36 | /* legacy interrupt controller for AP16 */ |
99 | .macro disable_fiq | 37 | .macro disable_fiq |