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
20 // The package level header files this module uses
24 // The protocols, PPI and GUID definitions for this module
26 #include <Ppi/ArmMpCoreInfo.h>
29 // The Library classes this module consumes
31 #include <Library/DebugLib.h>
32 #include <Library/PeimEntryPoint.h>
33 #include <Library/PeiServicesLib.h>
34 #include <Library/PcdLib.h>
35 #include <Library/HobLib.h>
36 #include <Library/ArmLib.h>
44 FileHandle - Handle of the file being invoked.
45 PeiServices - Describes the list of possible PEI Services.
49 Status - EFI_SUCCESS if the boot mode could be set
55 IN EFI_PEI_FILE_HANDLE FileHandle
,
56 IN CONST EFI_PEI_SERVICES
**PeiServices
60 ARM_MP_CORE_INFO_PPI
*ArmMpCoreInfoPpi
;
62 ARM_CORE_INFO
*ArmCoreInfoTable
;
64 // Enable program flow prediction, if supported.
65 ArmEnableBranchPrediction ();
67 // Publish the CPU memory and io spaces sizes
68 BuildCpuHob (ArmGetPhysicalAddressBits (), PcdGet8 (PcdPrePiCpuIoSize
));
70 // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid
71 Status
= PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid
, 0, NULL
, (VOID
**)&ArmMpCoreInfoPpi
);
72 if (!EFI_ERROR (Status
)) {
73 // Build the MP Core Info Table
75 Status
= ArmMpCoreInfoPpi
->GetMpCoreInfo (&ArmCoreCount
, &ArmCoreInfoTable
);
76 if (!EFI_ERROR (Status
) && (ArmCoreCount
> 0)) {
77 // Build MPCore Info HOB
78 BuildGuidDataHob (&gArmMpCoreInfoGuid
, ArmCoreInfoTable
, sizeof (ARM_CORE_INFO
) * ArmCoreCount
);