PcAtChipsetPkg/Rtc: Fix a UEFI Win7 boot hang issue

The patch updates the Century value in CMOS location specified
by FADT.Century to avoid UEFI Win7 hang during booting.
Per the ACPI spec if the FADT.Century is zero, it's not needed
to store the century value in CMOS. But UEFI Win7 treats the
Century storage is optional only when FADT.Century is 0x80.
While Linux strictly follows the ACPI spec and treats Century
storage is optional when FADT.Century is 0.
So if a platform wants to support both UEFI Win7 and Linux,
it needs to report FADT.Century to a traditional value which
doesn't equal to 0 or 0x80 (0x32 mostly). And RTC driver is
enhanced to save the century value to the location specified
by FADT.Century.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19442 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Ruiyu Ni
2015-12-22 13:52:47 +00:00
committed by niruiyu
parent 1b43162d70
commit 41628cbc7c
4 changed files with 158 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Provides Set/Get time operations.
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,11 +14,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "PcRtc.h"
PC_RTC_MODULE_GLOBALS mModuleGlobal;
PC_RTC_MODULE_GLOBALS mModuleGlobal = { 0 };
EFI_HANDLE mHandle = NULL;
/**
Returns the current time and date information, and the time-keeping capabilities
of the hardware platform.
@@ -133,11 +132,32 @@ InitializePcRtc (
)
{
EFI_STATUS Status;
EFI_EVENT Event;
EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_CALLBACK);
Status = PcRtcInit (&mModuleGlobal);
ASSERT_EFI_ERROR (Status);
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
PcRtcAcpiTableChangeCallback,
NULL,
&gEfiAcpi10TableGuid,
&Event
);
ASSERT_EFI_ERROR (Status);
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
PcRtcAcpiTableChangeCallback,
NULL,
&gEfiAcpiTableGuid,
&Event
);
ASSERT_EFI_ERROR (Status);
gRT->GetTime = PcRtcEfiGetTime;
gRT->SetTime = PcRtcEfiSetTime;