]>
Commit | Line | Data |
---|---|---|
afdfe8f0 | 1 | /**@file\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r | |
fbcd5cea | 4 | Copyright (c) 2011 Hewlett Packard Corporation. All rights reserved.<BR>\r |
6f050ad6 | 5 | Copyright (c) 2011-2013, ARM Limited. All rights reserved.<BR>\r |
44788bae | 6 | \r |
3402aac7 RC |
7 | This program and the accompanying materials\r |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
afdfe8f0 | 14 | \r |
15 | Module Name:\r | |
16 | \r | |
17 | MemoryInit.c\r | |
3402aac7 | 18 | \r |
afdfe8f0 | 19 | Abstract:\r |
20 | \r | |
21 | PEIM to provide fake memory init\r | |
22 | \r | |
23 | **/\r | |
24 | \r | |
25 | \r | |
26 | \r | |
27 | //\r | |
28 | // The package level header files this module uses\r | |
29 | //\r | |
30 | #include <PiPei.h>\r | |
31 | //\r | |
32 | // The protocols, PPI and GUID defintions for this module\r | |
33 | //\r | |
44788bae | 34 | #include <Ppi/ArmMpCoreInfo.h>\r |
afdfe8f0 | 35 | \r |
36 | //\r | |
37 | // The Library classes this module consumes\r | |
38 | //\r | |
39 | #include <Library/DebugLib.h>\r | |
40 | #include <Library/PeimEntryPoint.h>\r | |
44788bae | 41 | #include <Library/PeiServicesLib.h>\r |
afdfe8f0 | 42 | #include <Library/PcdLib.h>\r |
43 | #include <Library/HobLib.h>\r | |
44 | #include <Library/ArmLib.h>\r | |
45 | \r | |
afdfe8f0 | 46 | /*++\r |
47 | \r | |
48 | Routine Description:\r | |
49 | \r | |
afdfe8f0 | 50 | Arguments:\r |
51 | \r | |
52 | FileHandle - Handle of the file being invoked.\r | |
53 | PeiServices - Describes the list of possible PEI Services.\r | |
3402aac7 | 54 | \r |
afdfe8f0 | 55 | Returns:\r |
56 | \r | |
57 | Status - EFI_SUCCESS if the boot mode could be set\r | |
58 | \r | |
59 | --*/\r | |
44788bae | 60 | EFI_STATUS\r |
61 | EFIAPI\r | |
62 | InitializeCpuPeim (\r | |
63 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
64 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
65 | )\r | |
afdfe8f0 | 66 | {\r |
44788bae | 67 | EFI_STATUS Status;\r |
68 | ARM_MP_CORE_INFO_PPI *ArmMpCoreInfoPpi;\r | |
69 | UINTN ArmCoreCount;\r | |
70 | ARM_CORE_INFO *ArmCoreInfoTable;\r | |
71 | \r | |
afdfe8f0 | 72 | // Enable program flow prediction, if supported.\r |
73 | ArmEnableBranchPrediction ();\r | |
74 | \r | |
44788bae | 75 | // Publish the CPU memory and io spaces sizes\r |
149daa61 | 76 | BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r |
77 | \r | |
44788bae | 78 | // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid\r |
79 | Status = PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid, 0, NULL, (VOID**)&ArmMpCoreInfoPpi);\r | |
80 | if (!EFI_ERROR(Status)) {\r | |
81 | // Build the MP Core Info Table\r | |
82 | ArmCoreCount = 0;\r | |
83 | Status = ArmMpCoreInfoPpi->GetMpCoreInfo (&ArmCoreCount, &ArmCoreInfoTable);\r | |
84 | if (!EFI_ERROR(Status) && (ArmCoreCount > 0)) {\r | |
85 | // Build MPCore Info HOB\r | |
86 | BuildGuidDataHob (&gArmMpCoreInfoGuid, ArmCoreInfoTable, sizeof (ARM_CORE_INFO) * ArmCoreCount);\r | |
87 | }\r | |
88 | }\r | |
afdfe8f0 | 89 | \r |
90 | return EFI_SUCCESS;\r | |
91 | }\r |