]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c
ArmPkg/ArmGic: Use the GIC Redistributor instead of GIC Distributor for GICv3
[mirror_edk2.git] / ArmPkg / Drivers / ArmGic / ArmGicNonSecLib.c
index 06367f9d77af075800407022cedc8d11734beab8..e2538f1798f89be56428de3d10f0899f4e6cf6ef 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -22,9 +22,16 @@ ArmGicEnableDistributor (
   IN  INTN          GicDistributorBase\r
   )\r
 {\r
+  ARM_GIC_ARCH_REVISION Revision;\r
+\r
   /*\r
    * Enable GIC distributor in Non-Secure world.\r
    * Note: The ICDDCR register is banked when Security extensions are implemented\r
    */\r
-  MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);\r
+  Revision = ArmGicGetSupportedArchRevision ();\r
+  if (Revision == ARM_GIC_ARCH_REVISION_2) {\r
+    MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);\r
+  } else {\r
+    MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);\r
+  }\r
 }\r