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"
16 #include <Library/ArmGicLib.h>
19 // Description of the AARCH64 model platforms :
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
, FixedPcdGetPtr (PcdFdtFvpVExpressAEMv8x4
), L
"rtsm_ve-aemv8a.dtb" },
26 { ARM_FVP_BASE
, FixedPcdGetPtr (PcdFdtFvpBaseAEMv8x4
), L
"fvp-base.dtb" },
27 { ARM_FVP_FOUNDATION
, FixedPcdGetPtr (PcdFdtFvpFoundation
), L
"fvp-foundation.dtb" },
28 { ARM_FVP_VEXPRESS_UNKNOWN
, &gZeroGuid
}
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
52 ASSERT (Platform
!= NULL
);
54 Status
= EFI_NOT_FOUND
;
56 SysId
= MmioRead32 (ARM_VE_SYS_ID_REG
);
57 if (SysId
!= ARM_RTSM_SYS_ID
) {
59 // Keep only the HBI board number and the platform type fields of the
60 // system id register to identify if we are running on the FVP base or
63 FvpSysId
= SysId
& (ARM_FVP_SYS_ID_HBI_MASK
|
64 ARM_FVP_SYS_ID_PLAT_MASK
);
66 if (FvpSysId
== ARM_FVP_BASE_BOARD_SYS_ID
) {
67 Status
= ArmVExpressGetPlatformFromId (ARM_FVP_BASE
, Platform
);
68 } else if (FvpSysId
== ARM_FVP_FOUNDATION_BOARD_SYS_ID
) {
69 Status
= ArmVExpressGetPlatformFromId (ARM_FVP_FOUNDATION
, Platform
);
73 // FVP Versatile Express AEMv8
75 Status
= ArmVExpressGetPlatformFromId (ARM_FVP_VEXPRESS_AEMv8x4
, Platform
);
78 if (EFI_ERROR (Status
)) {
79 DEBUG ((EFI_D_ERROR
, "Unsupported AArch64 RTSM (SysId:0x%X).\n", SysId
));
80 ASSERT_EFI_ERROR (Status
);