3 Copyright (c) 2014-2015, ARM Ltd. All rights reserved.
5 This program and the accompanying materials are licensed and made available
6 under the terms and conditions of the BSD License which accompanies this
7 distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
11 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "ArmVExpressInternal.h"
18 // Description of the two AARCH64 model platforms :
19 // just the platform id for the time being.
20 // Platform ids are defined in ArmVExpressInternal.h for
21 // all "ArmVExpress-like" platforms (AARCH64 or ARM architecture,
22 // model or hardware platforms).
24 CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms
[] = {
25 { ARM_FVP_VEXPRESS_AEMv8x4
},
26 { ARM_FVP_BASE_AEMv8x4_AEMv8x4
},
27 { ARM_FVP_FOUNDATION
},
28 { ARM_FVP_VEXPRESS_UNKNOWN
}
32 Get information about the VExpress platform the firmware is running on.
34 @param[out] Platform Address where the pointer to the platform information
35 (type ARM_VEXPRESS_PLATFORM*) should be stored.
36 The returned pointer does not point to an allocated
39 @retval EFI_SUCCESS The platform information was returned.
40 @retval EFI_NOT_FOUND The platform was not recognised.
44 ArmVExpressGetPlatform (
45 OUT CONST ARM_VEXPRESS_PLATFORM
** Platform
51 ASSERT (Platform
!= NULL
);
53 Status
= EFI_NOT_FOUND
;
55 SysId
= MmioRead32 (ARM_VE_SYS_ID_REG
);
56 if (SysId
!= ARM_RTSM_SYS_ID
) {
57 // Take out the FVP GIC variant to reduce the permutations. The GIC driver
58 // detects the version and does the right thing.
59 SysId
&= ~ARM_FVP_SYS_ID_VARIANT_MASK
;
60 if (SysId
== (ARM_FVP_BASE_SYS_ID
& ~ARM_FVP_SYS_ID_VARIANT_MASK
)) {
61 Status
= ArmVExpressGetPlatformFromId (ARM_FVP_BASE_AEMv8x4_AEMv8x4
, Platform
);
62 } else if (SysId
== (ARM_FVP_FOUNDATION_SYS_ID
& ~ARM_FVP_SYS_ID_VARIANT_MASK
)) {
63 Status
= ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION
, Platform
);
66 Status
= ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_AEMv8x4
, Platform
);
69 if (EFI_ERROR (Status
)) {
70 DEBUG ((EFI_D_ERROR
, "Unsupported AArch64 RTSM (SysId:0x%X).\n", SysId
));
71 ASSERT_EFI_ERROR (Status
);