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:
@@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Guid/Acpi.h>
|
||||
|
||||
#include <Protocol/RealTimeClock.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
@@ -34,13 +36,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/ReportStatusCodeLib.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
EFI_LOCK RtcLock;
|
||||
INT16 SavedTimeZone;
|
||||
UINT8 Daylight;
|
||||
UINT8 CenturyRtcAddress;
|
||||
} PC_RTC_MODULE_GLOBALS;
|
||||
|
||||
extern PC_RTC_MODULE_GLOBALS mModuleGlobal;
|
||||
|
||||
#define PCAT_RTC_ADDRESS_REGISTER 0x70
|
||||
#define PCAT_RTC_DATA_REGISTER 0x71
|
||||
|
||||
@@ -355,4 +359,20 @@ IsLeapYear (
|
||||
IN EFI_TIME *Time
|
||||
);
|
||||
|
||||
/**
|
||||
Notification function of ACPI Table change.
|
||||
|
||||
This is a notification function registered on ACPI Table change event.
|
||||
It saves the Century address stored in ACPI FADT table.
|
||||
|
||||
@param Event Event whose notification function is being invoked.
|
||||
@param Context Pointer to the notification function's context.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
PcRtcAcpiTableChangeCallback (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user