#include <FspEas.h>\r
#include <FspStatusCode.h>\r
\r
-extern EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc;\r
-extern EFI_GUID gFspHobGuid;\r
+extern EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc;\r
+extern EFI_GUID gFspHobGuid;\r
\r
/**\r
This function handles S3 resume task at the end of PEI.\r
**/\r
EFI_STATUS\r
EFIAPI\r
-S3EndOfPeiNotify(\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+S3EndOfPeiNotify (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
);\r
\r
-EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {\r
+EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {\r
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
&gEfiEndOfPeiSignalPpiGuid,\r
S3EndOfPeiNotify\r
**/\r
EFI_STATUS\r
EFIAPI\r
-S3EndOfPeiNotify(\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+S3EndOfPeiNotify (\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
)\r
{\r
- NOTIFY_PHASE_PARAMS NotifyPhaseParams;\r
- EFI_STATUS Status;\r
+ NOTIFY_PHASE_PARAMS NotifyPhaseParams;\r
+ EFI_STATUS Status;\r
\r
- DEBUG((DEBUG_INFO, "S3EndOfPeiNotify enter\n"));\r
+ DEBUG ((DEBUG_INFO, "S3EndOfPeiNotify enter\n"));\r
\r
NotifyPhaseParams.Phase = EnumInitPhaseAfterPciEnumeration;\r
- Status = CallFspNotifyPhase (&NotifyPhaseParams);\r
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration status: 0x%x\n", Status));\r
+ Status = CallFspNotifyPhase (&NotifyPhaseParams);\r
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration status: 0x%x\n", Status));\r
\r
//\r
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status\r
//\r
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {\r
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));\r
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase AfterPciEnumeration requested reset 0x%x\n", Status));\r
CallFspWrapperResetSystem ((UINT32)Status);\r
}\r
\r
NotifyPhaseParams.Phase = EnumInitPhaseReadyToBoot;\r
- Status = CallFspNotifyPhase (&NotifyPhaseParams);\r
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot status: 0x%x\n", Status));\r
+ Status = CallFspNotifyPhase (&NotifyPhaseParams);\r
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot status: 0x%x\n", Status));\r
\r
//\r
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status\r
//\r
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {\r
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));\r
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase ReadyToBoot requested reset 0x%x\n", Status));\r
CallFspWrapperResetSystem ((UINT32)Status);\r
}\r
\r
NotifyPhaseParams.Phase = EnumInitPhaseEndOfFirmware;\r
- Status = CallFspNotifyPhase (&NotifyPhaseParams);\r
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware status: 0x%x\n", Status));\r
+ Status = CallFspNotifyPhase (&NotifyPhaseParams);\r
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware status: 0x%x\n", Status));\r
\r
//\r
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status\r
//\r
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {\r
- DEBUG((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));\r
+ DEBUG ((DEBUG_INFO, "FSP S3NotifyPhase EndOfFirmware requested reset 0x%x\n", Status));\r
CallFspWrapperResetSystem ((UINT32)Status);\r
}\r
\r
EFI_STATUS\r
EFIAPI\r
FspSiliconInitDoneGetFspHobList (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN FSP_SILICON_INIT_DONE_PPI *This,\r
- OUT VOID **FspHobList\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN FSP_SILICON_INIT_DONE_PPI *This,\r
+ OUT VOID **FspHobList\r
);\r
\r
-FSP_SILICON_INIT_DONE_PPI mFspSiliconInitDonePpi = {\r
+FSP_SILICON_INIT_DONE_PPI mFspSiliconInitDonePpi = {\r
FspSiliconInitDoneGetFspHobList\r
};\r
\r
-EFI_PEI_PPI_DESCRIPTOR mPeiFspSiliconInitDonePpi = {\r
+EFI_PEI_PPI_DESCRIPTOR mPeiFspSiliconInitDonePpi = {\r
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
&gFspSiliconInitDonePpiGuid,\r
&mFspSiliconInitDonePpi\r
EFI_STATUS\r
EFIAPI\r
FspSiliconInitDoneGetFspHobList (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN FSP_SILICON_INIT_DONE_PPI *This,\r
- OUT VOID **FspHobList\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN FSP_SILICON_INIT_DONE_PPI *This,\r
+ OUT VOID **FspHobList\r
)\r
{\r
- EFI_HOB_GUID_TYPE *GuidHob;\r
+ EFI_HOB_GUID_TYPE *GuidHob;\r
\r
GuidHob = GetFirstGuidHob (&gFspHobGuid);\r
if (GuidHob != NULL) {\r
- *FspHobList = *(VOID **)GET_GUID_HOB_DATA(GuidHob);\r
+ *FspHobList = *(VOID **)GET_GUID_HOB_DATA (GuidHob);\r
return EFI_SUCCESS;\r
} else {\r
return EFI_NOT_FOUND;\r
EFI_STATUS\r
EFIAPI\r
FspsWrapperEndOfPeiNotify (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
)\r
{\r
EFI_STATUS Status;\r
// Install FspSiliconInitDonePpi so that any other driver can consume this info.\r
//\r
Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);\r
- ASSERT_EFI_ERROR(Status);\r
+ ASSERT_EFI_ERROR (Status);\r
\r
return Status;\r
}\r
\r
-EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {\r
+EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {\r
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
&gEfiEndOfPeiSignalPpiGuid,\r
FspsWrapperEndOfPeiNotify\r
EFI_STATUS\r
EFIAPI\r
PeiMemoryDiscoveredNotify (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
);\r
\r
-EFI_PEI_NOTIFY_DESCRIPTOR mPeiMemoryDiscoveredNotifyDesc = {\r
+EFI_PEI_NOTIFY_DESCRIPTOR mPeiMemoryDiscoveredNotifyDesc = {\r
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
&gEfiPeiMemoryDiscoveredPpiGuid,\r
PeiMemoryDiscoveredNotify\r
EFI_STATUS\r
EFIAPI\r
PeiMemoryDiscoveredNotify (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
)\r
{\r
- FSP_INFO_HEADER *FspsHeaderPtr;\r
- UINT64 TimeStampCounterStart;\r
- EFI_STATUS Status;\r
- VOID *FspHobListPtr;\r
- EFI_HOB_GUID_TYPE *GuidHob;\r
- FSPS_UPD_COMMON *FspsUpdDataPtr;\r
- UINTN *SourceData;\r
+ FSP_INFO_HEADER *FspsHeaderPtr;\r
+ UINT64 TimeStampCounterStart;\r
+ EFI_STATUS Status;\r
+ VOID *FspHobListPtr;\r
+ EFI_HOB_GUID_TYPE *GuidHob;\r
+ FSPS_UPD_COMMON *FspsUpdDataPtr;\r
+ UINTN *SourceData;\r
\r
DEBUG ((DEBUG_INFO, "PeiMemoryDiscoveredNotify enter\n"));\r
FspsUpdDataPtr = NULL;\r
return EFI_DEVICE_ERROR;\r
}\r
\r
- if (PcdGet32 (PcdFspsUpdDataAddress) == 0 && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) {\r
+ if ((PcdGet32 (PcdFspsUpdDataAddress) == 0) && (FspsHeaderPtr->CfgRegionSize != 0) && (FspsHeaderPtr->CfgRegionOffset != 0)) {\r
//\r
// Copy default FSP-S UPD data from Flash\r
//\r
UpdateFspsUpdData ((VOID *)FspsUpdDataPtr);\r
\r
TimeStampCounterStart = AsmReadTsc ();\r
- PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);\r
+ PERF_START_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_ENTRY);\r
Status = CallFspSiliconInit ((VOID *)FspsUpdDataPtr);\r
- PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);\r
+ PERF_END_EX (&gFspApiPerformanceGuid, "EventRec", NULL, 0, FSP_STATUS_CODE_SILICON_INIT | FSP_STATUS_CODE_COMMON_CODE | FSP_STATUS_CODE_API_EXIT);\r
DEBUG ((DEBUG_INFO, "Total time spent executing FspSiliconInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000)));\r
\r
//\r
// Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status\r
//\r
if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) {\r
- DEBUG((DEBUG_INFO, "FspSiliconInitApi requested reset 0x%x\n", Status));\r
+ DEBUG ((DEBUG_INFO, "FspSiliconInitApi requested reset 0x%x\n", Status));\r
CallFspWrapperResetSystem ((UINT32)Status);\r
}\r
\r
- if (EFI_ERROR(Status)) {\r
+ if (EFI_ERROR (Status)) {\r
DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspSiliconInitApi(), Status = %r\n", Status));\r
}\r
- DEBUG((DEBUG_INFO, "FspSiliconInit status: 0x%x\n", Status));\r
+\r
+ DEBUG ((DEBUG_INFO, "FspSiliconInit status: 0x%x\n", Status));\r
ASSERT_EFI_ERROR (Status);\r
\r
Status = TestFspSiliconInitApiOutput ((VOID *)NULL);\r
// Install FspSiliconInitDonePpi so that any other driver can consume this info.\r
//\r
Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);\r
- ASSERT_EFI_ERROR(Status);\r
+ ASSERT_EFI_ERROR (Status);\r
\r
return Status;\r
}\r
VOID\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_BOOT_MODE BootMode;\r
+ EFI_STATUS Status;\r
+ EFI_BOOT_MODE BootMode;\r
\r
//\r
// Register MemoryDiscovered Notify to run FspSiliconInit\r
VOID\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;\r
- EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;\r
-\r
- MeasurementExcludedFvPpi = AllocatePool (sizeof(*MeasurementExcludedFvPpi));\r
- ASSERT(MeasurementExcludedFvPpi != NULL);\r
- MeasurementExcludedFvPpi->Count = 1;\r
- MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspsBaseAddress);\r
- MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength;\r
-\r
- MeasurementExcludedPpiList = AllocatePool (sizeof(*MeasurementExcludedPpiList));\r
- ASSERT(MeasurementExcludedPpiList != NULL);\r
+ EFI_STATUS Status;\r
+ EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI *MeasurementExcludedFvPpi;\r
+ EFI_PEI_PPI_DESCRIPTOR *MeasurementExcludedPpiList;\r
+\r
+ MeasurementExcludedFvPpi = AllocatePool (sizeof (*MeasurementExcludedFvPpi));\r
+ ASSERT (MeasurementExcludedFvPpi != NULL);\r
+ MeasurementExcludedFvPpi->Count = 1;\r
+ MeasurementExcludedFvPpi->Fv[0].FvBase = PcdGet32 (PcdFspsBaseAddress);\r
+ MeasurementExcludedFvPpi->Fv[0].FvLength = ((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength;\r
+\r
+ MeasurementExcludedPpiList = AllocatePool (sizeof (*MeasurementExcludedPpiList));\r
+ ASSERT (MeasurementExcludedPpiList != NULL);\r
MeasurementExcludedPpiList->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;\r
MeasurementExcludedPpiList->Guid = &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid;\r
MeasurementExcludedPpiList->Ppi = MeasurementExcludedFvPpi;\r
//\r
PeiServicesInstallFvInfoPpi (\r
NULL,\r
- (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),\r
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength,\r
+ (VOID *)(UINTN)PcdGet32 (PcdFspsBaseAddress),\r
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength,\r
NULL,\r
NULL\r
);\r
EFI_STATUS\r
EFIAPI\r
TcgPpiNotify (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
);\r
\r
-EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {\r
+EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc = {\r
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
&gEdkiiTcgPpiGuid,\r
TcgPpiNotify\r
EFI_STATUS\r
EFIAPI\r
TcgPpiNotify (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
- IN VOID *Ppi\r
+ IN EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,\r
+ IN VOID *Ppi\r
)\r
{\r
- UINT32 FspMeasureMask;\r
+ UINT32 FspMeasureMask;\r
\r
DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPS\n"));\r
\r
FspMeasureMask = PcdGet32 (PcdFspMeasurementConfig);\r
\r
if ((FspMeasureMask & FSP_MEASURE_FSPS) != 0) {\r
- MeasureFspFirmwareBlob (0, "FSPS", PcdGet32(PcdFspsBaseAddress),\r
- (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength);\r
+ MeasureFspFirmwareBlob (\r
+ 0,\r
+ "FSPS",\r
+ PcdGet32 (PcdFspsBaseAddress),\r
+ (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)PcdGet32 (PcdFspsBaseAddress))->FvLength\r
+ );\r
}\r
\r
return EFI_SUCCESS;\r