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
This commit is contained in:
Guo Dong 2015-06-25 16:02:16 +00:00 committed by gdong1
parent cb3e201f02
commit 244677494b
1 changed files with 29 additions and 2 deletions

View File

@ -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.