From 9612b7c0a5f42c61fe0f7c4dee57571d04b0ac33 Mon Sep 17 00:00:00 2001 From: Jiewen Yao Date: Fri, 17 Jun 2016 10:38:09 +0800 Subject: IntelFsp2WrapperPkg: Add support to handle ResetRequired return Status from FSP. As per FSP 2.0 spec, FSP shall not trigger system reset and instead it shall return from the FSP API to the BL/Wrapper with the required reset type. The changes are to handle the ResetRequired return code from FSP APIs and provide lib interface for platform to trigger the actual reset. Cc: Giri P Mudusuru Cc: Amy Chan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Satya Yarlagadda Signed-off-by: Jiewen Yao Reviewed-by: Giri P Mudusuru (cherry picked from commit f862a3b6f9dc026ea0e108fd548c65c75346bada) --- IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'IntelFsp2WrapperPkg/FspmWrapperPeim') diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c index 2eb36252f3..6144ad7f41 100644 --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c @@ -88,6 +88,15 @@ PeiFspMemoryInit ( PERF_START_EX(&gFspApiPerformanceGuid, "EventRec", NULL, TimeStampCounterStart, 0xD000); PERF_END_EX(&gFspApiPerformanceGuid, "EventRec", NULL, 0, 0xD07F); DEBUG ((DEBUG_INFO, "Total time spent executing FspMemoryInitApi: %d millisecond\n", DivU64x32 (GetTimeInNanoSecond (AsmReadTsc () - TimeStampCounterStart), 1000000))); + + // + // Reset the system if FSP API returned FSP_STATUS_RESET_REQUIRED status + // + if ((Status >= FSP_STATUS_RESET_REQUIRED_COLD) && (Status <= FSP_STATUS_RESET_REQUIRED_8)) { + DEBUG((DEBUG_INFO, "FspMemoryInitApi requested reset 0x%x\n", Status)); + CallFspWrapperResetSystem ((UINT32)Status); + } + if (EFI_ERROR(Status)) { DEBUG ((DEBUG_ERROR, "ERROR - Failed to execute FspMemoryInitApi(), Status = %r\n", Status)); } -- cgit v1.2.3