diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2014-06-30 11:01:31 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-07-08 18:11:47 -0400 |
commit | 021f653791ad17e03f98aaa7fb933816ae16f161 (patch) | |
tree | 76565bc06247be7e4bc6a3479fe6dcd686799c46 /arch | |
parent | d51d0af43b30dcae1ca13ea67fd717e03b37f153 (diff) |
irqchip: gic-v3: Initial support for GICv3
The Generic Interrupt Controller (version 3) offers services that are
similar to GICv2, with a number of additional features:
- Affinity routing based on the CPU MPIDR (ARE)
- System register for the CPU interfaces (SRE)
- Support for more that 8 CPUs
- Locality-specific Peripheral Interrupts (LPIs)
- Interrupt Translation Services (ITS)
This patch adds preliminary support for GICv3 with ARE and SRE,
non-secure mode only. It relies on higher exception levels to grant ARE
and SRE access.
Support for LPI and ITS will be added at a later time.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Reviewed-by: Zi Shen Lim <zlim@broadcom.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Tirumalesh Chalamarla <tchalamarla@cavium.com>
Reviewed-by: Yun Wu <wuyun.wu@huawei.com>
Reviewed-by: Zhen Lei <thunder.leizhen@huawei.com>
Tested-by: Tirumalesh Chalamarla<tchalamarla@cavium.com>
Tested-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Acked-by: Radha Mohan Chintakuntla <rchintakuntla@cavium.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lkml.kernel.org/r/1404140510-5382-3-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm64/kernel/head.S | 18 | ||||
-rw-r--r-- | arch/arm64/kernel/hyp-stub.S | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7295419165e1..be52492c2291 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -9,6 +9,7 @@ config ARM64 | |||
9 | select ARM_AMBA | 9 | select ARM_AMBA |
10 | select ARM_ARCH_TIMER | 10 | select ARM_ARCH_TIMER |
11 | select ARM_GIC | 11 | select ARM_GIC |
12 | select ARM_GIC_V3 | ||
12 | select BUILDTIME_EXTABLE_SORT | 13 | select BUILDTIME_EXTABLE_SORT |
13 | select CLONE_BACKWARDS | 14 | select CLONE_BACKWARDS |
14 | select COMMON_CLK | 15 | select COMMON_CLK |
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index a96d3a6a63f6..96623502519c 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/linkage.h> | 23 | #include <linux/linkage.h> |
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/irqchip/arm-gic-v3.h> | ||
25 | 26 | ||
26 | #include <asm/assembler.h> | 27 | #include <asm/assembler.h> |
27 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
@@ -296,6 +297,23 @@ CPU_LE( bic x0, x0, #(3 << 24) ) // Clear the EE and E0E bits for EL1 | |||
296 | msr cnthctl_el2, x0 | 297 | msr cnthctl_el2, x0 |
297 | msr cntvoff_el2, xzr // Clear virtual offset | 298 | msr cntvoff_el2, xzr // Clear virtual offset |
298 | 299 | ||
300 | #ifdef CONFIG_ARM_GIC_V3 | ||
301 | /* GICv3 system register access */ | ||
302 | mrs x0, id_aa64pfr0_el1 | ||
303 | ubfx x0, x0, #24, #4 | ||
304 | cmp x0, #1 | ||
305 | b.ne 3f | ||
306 | |||
307 | mrs x0, ICC_SRE_EL2 | ||
308 | orr x0, x0, #ICC_SRE_EL2_SRE // Set ICC_SRE_EL2.SRE==1 | ||
309 | orr x0, x0, #ICC_SRE_EL2_ENABLE // Set ICC_SRE_EL2.Enable==1 | ||
310 | msr ICC_SRE_EL2, x0 | ||
311 | isb // Make sure SRE is now set | ||
312 | msr ICH_HCR_EL2, xzr // Reset ICC_HCR_EL2 to defaults | ||
313 | |||
314 | 3: | ||
315 | #endif | ||
316 | |||
299 | /* Populate ID registers. */ | 317 | /* Populate ID registers. */ |
300 | mrs x0, midr_el1 | 318 | mrs x0, midr_el1 |
301 | mrs x1, mpidr_el1 | 319 | mrs x1, mpidr_el1 |
diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index 0959611d9ff1..a272f335c289 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/linkage.h> | 21 | #include <linux/linkage.h> |
22 | #include <linux/irqchip/arm-gic-v3.h> | ||
22 | 23 | ||
23 | #include <asm/assembler.h> | 24 | #include <asm/assembler.h> |
24 | #include <asm/ptrace.h> | 25 | #include <asm/ptrace.h> |