]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressCommon.c
ArmPlatformPkg/EblCmdLib: remove dependency on deprecated ARM BdsLib
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / ArmVExpressDxe / ArmVExpressCommon.c
CommitLineData
dff72027
OM
1/** @file\r
2\r
3 Copyright (c) 2014, ARM Ltd. All rights reserved.\r
4\r
5 This program and the accompanying materials are licensed and made available\r
6 under the terms and conditions of the BSD License which accompanies this\r
7 distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
11 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "ArmVExpressInternal.h"\r
16\r
17/**\r
18 Get information about the VExpress platform the firmware is running on given its Id.\r
19\r
20 @param[in] PlatformId Id of the VExpress platform.\r
21 @param[out] Platform Address where the pointer to the platform information\r
22 (type ARM_VEXPRESS_PLATFORM*) should be stored.\r
23 The returned pointer does not point to an allocated\r
24 memory area.\r
25\r
26 @retval EFI_SUCCESS The platform information was returned.\r
27 @retval EFI_NOT_FOUND The platform was not recognised.\r
28\r
29**/\r
30EFI_STATUS\r
31ArmVExpressGetPlatformFromId (\r
32 IN CONST ARM_VEXPRESS_PLATFORM_ID PlatformId,\r
33 OUT CONST ARM_VEXPRESS_PLATFORM** Platform\r
34 )\r
35{\r
36 UINTN Index;\r
37\r
38 ASSERT (Platform != NULL);\r
39\r
40 for (Index = 0; ArmVExpressPlatforms[Index].Id != ARM_FVP_VEXPRESS_UNKNOWN; Index++) {\r
41 if (ArmVExpressPlatforms[Index].Id == PlatformId) {\r
42 *Platform = &ArmVExpressPlatforms[Index];\r
43 return EFI_SUCCESS;\r
44 }\r
45 }\r
46\r
47 return EFI_NOT_FOUND;\r
48}\r