]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/PlatformPei/PlatformPeim.c
BaseTools/Capsule: Do not support -o with --dump-info
[mirror_edk2.git] / ArmPlatformPkg / PlatformPei / PlatformPeim.c
CommitLineData
1d5d0ae9 1/** @file\r
2*\r
3* Copyright (c) 2011, ARM Limited. All rights reserved.\r
1d5d0ae9 4*\r
3402aac7
RC
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this 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,\r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
1d5d0ae9 12*\r
13**/\r
14\r
1d5d0ae9 15#include <PiPei.h>\r
48835130 16\r
1d5d0ae9 17//\r
18// The protocols, PPI and GUID defintions for this module\r
19//\r
20#include <Ppi/MasterBootMode.h>\r
21#include <Ppi/BootInRecoveryMode.h>\r
8fc38a3f 22#include <Ppi/GuidedSectionExtraction.h>\r
1d5d0ae9 23//\r
24// The Library classes this module consumes\r
25//\r
8fc38a3f 26#include <Library/ArmPlatformLib.h>\r
27#include <Library/BaseMemoryLib.h>\r
28#include <Library/DebugLib.h>\r
29#include <Library/HobLib.h>\r
1d5d0ae9 30#include <Library/PeimEntryPoint.h>\r
8fc38a3f 31#include <Library/PeiServicesLib.h>\r
1d5d0ae9 32#include <Library/PcdLib.h>\r
8fc38a3f 33\r
48835130 34EFI_STATUS\r
35EFIAPI\r
36InitializePlatformPeim (\r
37 IN EFI_PEI_FILE_HANDLE FileHandle,\r
38 IN CONST EFI_PEI_SERVICES **PeiServices\r
39 );\r
3402aac7 40\r
3723a71a 41EFI_STATUS\r
42EFIAPI\r
43PlatformPeim (\r
44 VOID\r
45 );\r
1d5d0ae9 46\r
47//\r
48// Module globals\r
49//\r
64748d26 50CONST EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode = {\r
1d5d0ae9 51 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
52 &gEfiPeiMasterBootModePpiGuid,\r
53 NULL\r
54};\r
55\r
64748d26 56CONST EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode = {\r
1d5d0ae9 57 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
58 &gEfiPeiBootInRecoveryModePpiGuid,\r
59 NULL\r
60};\r
61\r
1d5d0ae9 62/*++\r
63\r
64Routine Description:\r
65\r
3402aac7 66\r
1d5d0ae9 67\r
68Arguments:\r
69\r
70 FileHandle - Handle of the file being invoked.\r
71 PeiServices - Describes the list of possible PEI Services.\r
3402aac7 72\r
1d5d0ae9 73Returns:\r
74\r
75 Status - EFI_SUCCESS if the boot mode could be set\r
76\r
77--*/\r
48835130 78EFI_STATUS\r
79EFIAPI\r
80InitializePlatformPeim (\r
81 IN EFI_PEI_FILE_HANDLE FileHandle,\r
82 IN CONST EFI_PEI_SERVICES **PeiServices\r
83 )\r
1d5d0ae9 84{\r
85 EFI_STATUS Status;\r
3909c4a1 86 EFI_BOOT_MODE BootMode;\r
1d5d0ae9 87\r
3d5cf372 88 DEBUG ((EFI_D_LOAD | EFI_D_INFO, "Platform PEIM Loaded\n"));\r
1d5d0ae9 89\r
3909c4a1
AB
90 Status = PeiServicesSetBootMode (ArmPlatformGetBootMode ());\r
91 ASSERT_EFI_ERROR (Status);\r
92\r
48835130 93 PlatformPeim ();\r
3402aac7 94\r
3909c4a1 95 Status = PeiServicesGetBootMode (&BootMode);\r
1d5d0ae9 96 ASSERT_EFI_ERROR (Status);\r
97\r
3909c4a1 98 Status = PeiServicesInstallPpi (&mPpiListBootMode);\r
1d5d0ae9 99 ASSERT_EFI_ERROR (Status);\r
100\r
101 if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
3909c4a1 102 Status = PeiServicesInstallPpi (&mPpiListRecoveryBootMode);\r
1d5d0ae9 103 ASSERT_EFI_ERROR (Status);\r
104 }\r
105\r
106 return Status;\r
107}\r