diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-02-16 10:27:02 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2015-02-16 10:27:02 +0000 |
commit | f6d46e296060507bc8d02fadb8ebd591fc9aefca (patch) | |
tree | 25063df60ca8b6ec0d726d350fcd2baa7584e63b /ArmPkg/Drivers/ArmGic/ArmGicLib.c | |
parent | 41fb5d4634c17c042e0a3b2be0e8db85d2a083ad (diff) | |
download | edk2-f6d46e296060507bc8d02fadb8ebd591fc9aefca.tar.gz edk2-f6d46e296060507bc8d02fadb8ebd591fc9aefca.tar.bz2 edk2-f6d46e296060507bc8d02fadb8ebd591fc9aefca.zip |
ArmPkg/ArmGic: enable ARE bit before driving GICv3 in native mode
The GICv3 driver must use native mode to drive a GICv3 due to
the fact that v2 compatibility is optional in the v3 spec.
However, if v2 compatibility is implemented, it is the default
and needs to be disabled first by setting the Affinity Routing
Enable (ARE) bit.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
[added PCD that allows forcing the GICv3 driver to drive the GIC in v2 mode]
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Tested-by: Ard Biesheuvel <ard@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16875 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Drivers/ArmGic/ArmGicLib.c')
-rw-r--r-- | ArmPkg/Drivers/ArmGic/ArmGicLib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index 7c53e39793..48708e3812 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -186,7 +186,7 @@ ArmGicEnableInterrupt ( RegShift = Source % 32;
Revision = ArmGicGetSupportedArchRevision ();
- if (Revision == ARM_GIC_ARCH_REVISION_2) {
+ if ((Revision == ARM_GIC_ARCH_REVISION_2) || FeaturePcdGet (PcdArmGicV3WithV2Legacy)) {
// Write set-enable register
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset), 1 << RegShift);
} else {
@@ -219,7 +219,7 @@ ArmGicDisableInterrupt ( RegShift = Source % 32;
Revision = ArmGicGetSupportedArchRevision ();
- if (Revision == ARM_GIC_ARCH_REVISION_2) {
+ if ((Revision == ARM_GIC_ARCH_REVISION_2) || FeaturePcdGet (PcdArmGicV3WithV2Legacy)) {
// Write clear-enable register
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDICER + (4 * RegOffset), 1 << RegShift);
} else {
@@ -252,7 +252,7 @@ ArmGicIsInterruptEnabled ( RegShift = Source % 32;
Revision = ArmGicGetSupportedArchRevision ();
- if (Revision == ARM_GIC_ARCH_REVISION_2) {
+ if ((Revision == ARM_GIC_ARCH_REVISION_2) || FeaturePcdGet (PcdArmGicV3WithV2Legacy)) {
Interrupts = ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDISER + (4 * RegOffset)) & (1 << RegShift)) != 0);
} else {
GicCpuRedistributorBase = GicGetCpuRedistributorBase (GicRedistributorBase, Revision);
|