summaryrefslogtreecommitdiffstats
path: root/CorebootPayloadPkg
diff options
context:
space:
mode:
authorGuo Dong <guo.dong@intel.com>2015-06-25 16:02:16 +0000
committergdong1 <gdong1@Edk2>2015-06-25 16:02:16 +0000
commit244677494b934cd2d6da956622cc599d67c89343 (patch)
treee4440ef066dfebac46523f529745ca4cf68212a3 /CorebootPayloadPkg
parentcb3e201f023e5b8002967f1813d7b15052bcdb81 (diff)
downloadedk2-244677494b934cd2d6da956622cc599d67c89343.tar.gz
edk2-244677494b934cd2d6da956622cc599d67c89343.tar.bz2
edk2-244677494b934cd2d6da956622cc599d67c89343.zip
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 <guo.dong@intel.com> Reviewed-by: Maurice Ma <maurice.ma@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17715 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'CorebootPayloadPkg')
-rw-r--r--CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c b/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
index 77b81dbed0..55f5609629 100644
--- a/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ b/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c
@@ -112,11 +112,38 @@ ResetShutdown (
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.