3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 Copyright (c) 2011 Hewlett Packard Corporation. All rights reserved.<BR>
5 Copyright (c) 2011-2013, ARM Limited. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
15 PEIM to provide fake memory init
22 // The package level header files this module uses
26 // The protocols, PPI and GUID defintions for this module
28 #include <Ppi/ArmMpCoreInfo.h>
31 // The Library classes this module consumes
33 #include <Library/DebugLib.h>
34 #include <Library/PeimEntryPoint.h>
35 #include <Library/PeiServicesLib.h>
36 #include <Library/PcdLib.h>
37 #include <Library/HobLib.h>
38 #include <Library/ArmLib.h>
46 FileHandle - Handle of the file being invoked.
47 PeiServices - Describes the list of possible PEI Services.
51 Status - EFI_SUCCESS if the boot mode could be set
57 IN EFI_PEI_FILE_HANDLE FileHandle
,
58 IN CONST EFI_PEI_SERVICES
**PeiServices
62 ARM_MP_CORE_INFO_PPI
*ArmMpCoreInfoPpi
;
64 ARM_CORE_INFO
*ArmCoreInfoTable
;
66 // Enable program flow prediction, if supported.
67 ArmEnableBranchPrediction ();
69 // Publish the CPU memory and io spaces sizes
70 BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize
));
72 // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid
73 Status
= PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid
, 0, NULL
, (VOID
**)&ArmMpCoreInfoPpi
);
74 if (!EFI_ERROR(Status
)) {
75 // Build the MP Core Info Table
77 Status
= ArmMpCoreInfoPpi
->GetMpCoreInfo (&ArmCoreCount
, &ArmCoreInfoTable
);
78 if (!EFI_ERROR(Status
) && (ArmCoreCount
> 0)) {
79 // Build MPCore Info HOB
80 BuildGuidDataHob (&gArmMpCoreInfoGuid
, ArmCoreInfoTable
, sizeof (ARM_CORE_INFO
) * ArmCoreCount
);