#include <Ppi/MemoryDiscovered.h>\r
#include <Ppi/TemporaryRamDone.h>\r
#include <Ppi/SecPlatformInformation.h>\r
-#include <Library/PlatformSecLib.h>\r
#include <Library/FspWrapperApiTestLib.h>\r
#include <FspEas.h>\r
\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
+ 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
\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
+ 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
\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
+ CallFspWrapperResetSystem ((UINT32)Status);\r
+ }\r
+\r
return EFI_SUCCESS;\r
}\r
\r
// Copy default FSP-S UPD data from Flash\r
//\r
FspsHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));\r
+ DEBUG ((DEBUG_INFO, "FspsHeaderPtr - 0x%x\n", FspsHeaderPtr));\r
+ if (FspsHeaderPtr == NULL) {\r
+ return EFI_DEVICE_ERROR;\r
+ }\r
+\r
FspsUpdDataPtr = (FSPS_UPD_COMMON *)AllocateZeroPool ((UINTN)FspsHeaderPtr->CfgRegionSize);\r
ASSERT (FspsUpdDataPtr != NULL);\r
SourceData = (UINTN *)((UINTN)FspsHeaderPtr->ImageBase + (UINTN)FspsHeaderPtr->CfgRegionOffset);\r
Status = CallFspSiliconInit ((VOID *)FspsUpdDataPtr);\r
PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, 0x907F);\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
+ CallFspWrapperResetSystem ((UINT32)Status);\r
+ }\r
+\r
if (EFI_ERROR(Status)) {\r
DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspSiliconInitApi(), Status = %r\n", Status));\r
}\r