55 if (
PcdGet64 (PcdFspmUpdDataAddress64) != 0) {
74 UINT64 TimeStampCounterStart;
80 DEBUG ((DEBUG_INFO,
"PeiFspMemoryInit enter\n"));
83 FspmUpdDataPtr =
NULL;
86 DEBUG ((DEBUG_INFO,
"FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
87 if (FspmHeaderPtr ==
NULL) {
88 return EFI_DEVICE_ERROR;
96 ASSERT (FspmUpdDataPtr !=
NULL);
104 ASSERT (FspmUpdDataPtr !=
NULL);
107 DEBUG ((DEBUG_INFO,
"UpdateFspmUpdData enter\n"));
112 DEBUG ((DEBUG_INFO,
" BootLoaderTolumSize - 0x%x\n", ((
FSPM_UPD_COMMON_FSP24 *)FspmUpdDataPtr)->FspmArchUpd.BootLoaderTolumSize));
115 DEBUG ((DEBUG_INFO,
" NvsBufferPtr - 0x%x\n", ((
FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.NvsBufferPtr));
116 DEBUG ((DEBUG_INFO,
" StackBase - 0x%x\n", ((
FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.StackBase));
117 DEBUG ((DEBUG_INFO,
" StackSize - 0x%x\n", ((
FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.StackSize));
118 DEBUG ((DEBUG_INFO,
" BootLoaderTolumSize - 0x%x\n", ((
FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootLoaderTolumSize));
119 DEBUG ((DEBUG_INFO,
" BootMode - 0x%x\n", ((
FSPM_UPD_COMMON *)FspmUpdDataPtr)->FspmArchUpd.BootMode));
122 DEBUG ((DEBUG_INFO,
" HobListPtr - 0x%x\n", &FspHobListPtr));
130 if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {
131 DEBUG ((DEBUG_INFO,
"FspMemoryInitApi requested reset %r\n", Status));
135 if ((Status != FSP_STATUS_VARIABLE_REQUEST) && EFI_ERROR (Status)) {
136 DEBUG ((DEBUG_ERROR,
"ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status));
140 DEBUG ((DEBUG_INFO,
"FspMemoryInit status: %r\n", Status));
141 if (Status == FSP_STATUS_VARIABLE_REQUEST) {
156 PERF_START_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, TimeStampCounterStart, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);
157 PERF_END_EX (&gFspApiPerformanceGuid,
"EventRec",
NULL, 0, FSP_STATUS_CODE_MEMORY_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);
161 if (EFI_ERROR (Status)) {
162 DEBUG ((DEBUG_ERROR,
"ERROR - TestFspMemoryInitApiOutput () fail, Status = %r\n", Status));
165 DEBUG ((DEBUG_INFO,
" FspHobListPtr (returned) - 0x%x\n", FspHobListPtr));
166 ASSERT (FspHobListPtr !=
NULL);
178 ASSERT (HobData !=
NULL);
179 CopyMem (HobData, &FspHobListPtr,
sizeof (FspHobListPtr));
199 MeasurementExcludedFvPpi =
AllocatePool (
sizeof (*MeasurementExcludedFvPpi));
200 ASSERT (MeasurementExcludedFvPpi !=
NULL);
201 if (MeasurementExcludedFvPpi ==
NULL) {
202 return EFI_OUT_OF_RESOURCES;
205 MeasurementExcludedFvPpi->Count = 1;
206 MeasurementExcludedFvPpi->Fv[0].FvBase =
PcdGet32 (PcdFspmBaseAddress);
209 MeasurementExcludedPpiList =
AllocatePool (
sizeof (*MeasurementExcludedPpiList));
210 ASSERT (MeasurementExcludedPpiList !=
NULL);
211 if (MeasurementExcludedPpiList ==
NULL) {
212 return EFI_OUT_OF_RESOURCES;
215 MeasurementExcludedPpiList->
Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
216 MeasurementExcludedPpiList->
Guid = &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;
217 MeasurementExcludedPpiList->
Ppi = MeasurementExcludedFvPpi;
221 if (
PcdGet8 (PcdFspModeSelection) == 1) {
259 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
282 UINT32 FspMeasureMask;
288 DEBUG ((DEBUG_INFO,
"TcgPpiNotify FSPM\n"));
290 FspMeasureMask =
PcdGet32 (PcdFspMeasurementConfig);
294 while (Hob.Raw !=
NULL) {
295 MigratedFvInfo = GET_GUID_HOB_DATA (Hob);
296 if ((MigratedFvInfo->FvOrgBase ==
PcdGet32 (PcdFsptBaseAddress)) && (MigratedFvInfo->FvDataBase != 0)) {
300 FsptBaseAddress = MigratedFvInfo->FvDataBase;
303 if ((MigratedFvInfo->FvOrgBase ==
PcdGet32 (PcdFspmBaseAddress)) && (MigratedFvInfo->FvDataBase != 0)) {
304 FspmBaseAddress = MigratedFvInfo->FvDataBase;
307 Hob.Raw = GET_NEXT_HOB (Hob);
311 if ((FspMeasureMask & FSP_MEASURE_FSPT) != 0) {
320 if ((FspMeasureMask & FSP_MEASURE_FSPM) != 0) {
349 DEBUG ((DEBUG_INFO,
"FspmWrapperPeimEntryPoint\n"));
UINT64 EFIAPI GetTimeInNanoSecond(IN UINT64 Ticks)
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidHob(IN CONST EFI_GUID *Guid, IN UINTN DataLength)
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
UINT64 EFIAPI AsmReadTsc(VOID)
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI PeiServicesInstallFvInfoPpi(IN CONST EFI_GUID *FvFormat OPTIONAL, IN CONST VOID *FvInfo, IN UINT32 FvInfoSize, IN CONST EFI_GUID *ParentFvName OPTIONAL, IN CONST EFI_GUID *ParentFileName OPTIONAL)
EFI_STATUS EFIAPI PeiServicesNotifyPpi(IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList)
EFI_STATUS EFIAPI PeiServicesInstallPpi(IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList)
EFI_STATUS EFIAPI MeasureFspFirmwareBlob(IN UINT32 PcrIndex, IN CHAR8 *Description OPTIONAL, IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase, IN UINT64 FirmwareBlobLength)
EFI_STATUS EFIAPI CallFspMemoryInit(IN VOID *FspmUpdDataPtr, OUT VOID **HobListPtr)
FSP_INFO_HEADER *EFIAPI FspFindFspHeader(IN EFI_PHYSICAL_ADDRESS FlashFvFspBase)
EFI_STATUS EFIAPI TestFspMemoryInitApiOutput(IN VOID *FspmUpdDataPtr, IN VOID **HobListPtr)
EFI_STATUS EFIAPI PostFspmHobProcess(IN VOID *FspHobList)
EFI_STATUS EFIAPI FspWrapperVariableRequestHandler(IN OUT VOID **FspHobListPtr, IN UINT8 ComponentIndex)
EFI_STATUS EFIAPI FspWrapperMultiPhaseHandler(IN OUT VOID **FspHobListPtr, IN UINT8 ComponentIndex)
EFI_STATUS EFIAPI FspmWrapperPeimEntryPoint(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS EFIAPI TcgPpiNotify(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, IN VOID *Ppi)
EFI_STATUS PeiFspMemoryInit(VOID)
EFI_STATUS EFIAPI FspmWrapperInit(VOID)
UINTN GetFspmUpdDataAddress(VOID)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define PcdGet64(TokenName)
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)
VOID * EFI_PEI_FILE_HANDLE
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
UINT64 EFI_PHYSICAL_ADDRESS