Revision: 17715
          http://sourceforge.net/p/edk2/code/17715
Author:   gdong1
Date:     2015-06-25 16:02:16 +0000 (Thu, 25 Jun 2015)
Log Message:
-----------
CorebootPayloadPkg: Fix "reset -s" issue.

Fix reboot issue after issuing shell command "reset -s" from UEFI payload.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <[email protected]>
Reviewed-by: Maurice Ma <[email protected]>

Modified Paths:
--------------
    trunk/edk2/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c

Modified: trunk/edk2/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
===================================================================
--- trunk/edk2/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c       
2015-06-25 16:00:29 UTC (rev 17714)
+++ trunk/edk2/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c       
2015-06-25 16:02:16 UTC (rev 17715)
@@ -112,11 +112,38 @@
   VOID
   )
 {
-  AcpiPmControl (7);
+  EFI_HOB_GUID_TYPE  *GuidHob;
+  ACPI_BOARD_INFO    *pAcpiBoardInfo;
+  UINTN              PmCtrlReg;
+
+  //
+  // Find the acpi board information guid hob
+  //
+  GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid);
+  ASSERT (GuidHob != NULL);
+  pAcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob); 
+  
+  //
+  // GPE0_EN should be disabled to avoid any GPI waking up the system from S5
+  //
+  IoWrite16 ((UINTN)pAcpiBoardInfo->PmGpeEnBase,  0);
+
+  //
+  // Clear Power Button Status
+  //
+  IoWrite16((UINTN) pAcpiBoardInfo->PmEvtBase, BIT8);
+  
+  //
+  // Transform system into S5 sleep state
+  //
+  PmCtrlReg = (UINTN)pAcpiBoardInfo->PmCtrlRegBase; 
+  IoAndThenOr16 (PmCtrlReg, (UINT16) ~0x3c00, (UINT16) (7 << 10));
+  IoOr16 (PmCtrlReg, BIT13);
+  CpuDeadLoop ();
+
   ASSERT (FALSE);
 }
 
-
 /**
   Calling this function causes the system to enter a power state for capsule
   update.


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to