diff options
author | Olivier Martin <olivier.martin@arm.com> | 2015-02-25 19:15:39 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2015-02-25 19:15:39 +0000 |
commit | d0c1d371fba83b380326bc97a9e267070a4e725e (patch) | |
tree | 6d0f488f57acf68f89504c44e3a369f8e76b858c /ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe | |
parent | dff720276a3ee19af0cb658340ac8514ffce8359 (diff) | |
download | edk2-platforms-d0c1d371fba83b380326bc97a9e267070a4e725e.tar.xz |
ArmPlatformPkg/ArmVExpressPkg: Added support to differentiate ARMv8 FVP variants
There are three FVP variants for the Base and Foundation models:
- model with GICv2 legacy memory map (same location as the Versatile Express model)
- model with GICv2 and Base model memory map
- model with GICv3 and Base model memory map
The new code detects the variants to load the appropriate device tree.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16932 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe')
3 files changed, 59 insertions, 13 deletions
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c index 2c7c5fa5cc..41d94eda1d 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c @@ -13,9 +13,10 @@ **/
#include "ArmVExpressInternal.h"
+#include <Library/ArmGicLib.h>
//
-// Description of the two AARCH64 model platforms :
+// Description of the AARCH64 model platforms :
// just the platform id for the time being.
// Platform ids are defined in ArmVExpressInternal.h for
// all "ArmVExpress-like" platforms (AARCH64 or ARM architecture,
@@ -23,8 +24,12 @@ //
CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {
{ ARM_FVP_VEXPRESS_AEMv8x4 },
- { ARM_FVP_BASE_AEMv8x4_AEMv8x4 },
- { ARM_FVP_FOUNDATION },
+ { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2 },
+ { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY },
+ { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3 },
+ { ARM_FVP_FOUNDATION_GICV2 },
+ { ARM_FVP_FOUNDATION_GICV2_LEGACY },
+ { ARM_FVP_FOUNDATION_GICV3 },
{ ARM_FVP_VEXPRESS_UNKNOWN }
};
@@ -47,6 +52,9 @@ ArmVExpressGetPlatform ( {
EFI_STATUS Status;
UINT32 SysId;
+ UINT32 FvpSysId;
+ UINT32 VariantSysId;
+ ARM_GIC_ARCH_REVISION GicRevision;
ASSERT (Platform != NULL);
@@ -54,15 +62,46 @@ ArmVExpressGetPlatform ( SysId = MmioRead32 (ARM_VE_SYS_ID_REG);
if (SysId != ARM_RTSM_SYS_ID) {
- // Take out the FVP GIC variant to reduce the permutations. The GIC driver
- // detects the version and does the right thing.
- SysId &= ~ARM_FVP_SYS_ID_VARIANT_MASK;
- if (SysId == (ARM_FVP_BASE_SYS_ID & ~ARM_FVP_SYS_ID_VARIANT_MASK)) {
- Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4, Platform);
- } else if (SysId == (ARM_FVP_FOUNDATION_SYS_ID & ~ARM_FVP_SYS_ID_VARIANT_MASK)) {
- Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION, Platform);
+ // Remove the GIC variant to identify if we are running on the FVP Base or
+ // Foundation models
+ FvpSysId = SysId & (ARM_FVP_SYS_ID_HBI_MASK |
+ ARM_FVP_SYS_ID_PLAT_MASK );
+ // Extract the variant from the SysId
+ VariantSysId = SysId & ARM_FVP_SYS_ID_VARIANT_MASK;
+
+ if (FvpSysId == ARM_FVP_BASE_BOARD_SYS_ID) {
+ if (VariantSysId == ARM_FVP_GIC_VE_MMAP) {
+ // FVP Base Model with legacy GIC memory map
+ Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, Platform);
+ } else {
+ GicRevision = ArmGicGetSupportedArchRevision ();
+
+ if (GicRevision == ARM_GIC_ARCH_REVISION_2) {
+ // FVP Base Model with GICv2 support
+ Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, Platform);
+ } else {
+ // FVP Base Model with GICv3 support
+ Status = ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, Platform);
+ }
+ }
+ } else if (FvpSysId == ARM_FVP_FOUNDATION_BOARD_SYS_ID) {
+ if (VariantSysId == ARM_FVP_GIC_VE_MMAP) {
+ // FVP Foundation Model with legacy GIC memory map
+ Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION_GICV2_LEGACY, Platform);
+ } else {
+ GicRevision = ArmGicGetSupportedArchRevision ();
+
+ if (GicRevision == ARM_GIC_ARCH_REVISION_2) {
+ // FVP Foundation Model with GICv2
+ Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION_GICV2, Platform);
+ } else {
+ // FVP Foundation Model with GICv3
+ Status = ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION_GICV3, Platform);
+ }
+ }
}
} else {
+ // FVP Versatile Express AEMv8
Status = ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_AEMv8x4, Platform);
}
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf index 8a096baae2..a69601ba12 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf @@ -1,6 +1,6 @@ #/** @file
#
-# Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>
+# Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -45,3 +45,6 @@ UefiDriverEntryPoint
UefiBootServicesTableLib
VirtioMmioDeviceLib
+
+[LibraryClasses.AARCH64]
+ ArmGicLib
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h index 2e9335047a..075ced8e89 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h @@ -36,8 +36,12 @@ typedef enum { ARM_FVP_VEXPRESS_A15x1_A7x1,
ARM_FVP_VEXPRESS_A15x4_A7x4,
ARM_FVP_VEXPRESS_AEMv8x4,
- ARM_FVP_BASE_AEMv8x4_AEMv8x4,
- ARM_FVP_FOUNDATION,
+ ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2,
+ ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY,
+ ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3,
+ ARM_FVP_FOUNDATION_GICV2,
+ ARM_FVP_FOUNDATION_GICV2_LEGACY,
+ ARM_FVP_FOUNDATION_GICV3,
ARM_HW_A9x4,
ARM_HW_A15x2_A7x3,
ARM_HW_A15,
|