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 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 PEIM to provide fake memory init
28 // The package level header files this module uses
32 // The protocols, PPI and GUID defintions for this module
34 #include <Ppi/ArmMpCoreInfo.h>
37 // The Library classes this module consumes
39 #include <Library/DebugLib.h>
40 #include <Library/PeimEntryPoint.h>
41 #include <Library/PeiServicesLib.h>
42 #include <Library/PcdLib.h>
43 #include <Library/HobLib.h>
44 #include <Library/ArmLib.h>
52 FileHandle - Handle of the file being invoked.
53 PeiServices - Describes the list of possible PEI Services.
57 Status - EFI_SUCCESS if the boot mode could be set
63 IN EFI_PEI_FILE_HANDLE FileHandle
,
64 IN CONST EFI_PEI_SERVICES
**PeiServices
68 ARM_MP_CORE_INFO_PPI
*ArmMpCoreInfoPpi
;
70 ARM_CORE_INFO
*ArmCoreInfoTable
;
72 // Enable program flow prediction, if supported.
73 ArmEnableBranchPrediction ();
75 // Publish the CPU memory and io spaces sizes
76 BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize
), PcdGet8 (PcdPrePiCpuIoSize
));
78 // Only MP Core platform need to produce gArmMpCoreInfoPpiGuid
79 Status
= PeiServicesLocatePpi (&gArmMpCoreInfoPpiGuid
, 0, NULL
, (VOID
**)&ArmMpCoreInfoPpi
);
80 if (!EFI_ERROR(Status
)) {
81 // Build the MP Core Info Table
83 Status
= ArmMpCoreInfoPpi
->GetMpCoreInfo (&ArmCoreCount
, &ArmCoreInfoTable
);
84 if (!EFI_ERROR(Status
) && (ArmCoreCount
> 0)) {
85 // Build MPCore Info HOB
86 BuildGuidDataHob (&gArmMpCoreInfoGuid
, ArmCoreInfoTable
, sizeof (ARM_CORE_INFO
) * ArmCoreCount
);