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