PcAtChipsetPkg/PcRtc: get century RTC address in entry point

When ACPI table is installed before PcRtc driver runs,
the ACPI table installation callback isn't called which causes the
century value isn't written to the CMOS.
The patch calls GetCenturyRtcAddress() in entry point to fix
the bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Anbazhagan Baraneedharan <anbazhagan@hp.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Ruiyu Ni 2016-05-18 13:18:28 +08:00
parent 9e11e9225a
commit e38ab18a49
2 changed files with 13 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/** @file
Header file for real time clock driver.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2016, 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
@ -359,6 +359,16 @@ IsLeapYear (
IN EFI_TIME *Time
);
/**
Get the century RTC address from the ACPI FADT table.
@return The century RTC address or 0 if not found.
**/
UINT8
GetCenturyRtcAddress (
VOID
);
/**
Notification function of ACPI Table change.

View File

@ -1,7 +1,7 @@
/** @file
Provides Set/Get time operations.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2016, 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
@ -135,7 +135,7 @@ InitializePcRtc (
EFI_EVENT Event;
EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_CALLBACK);
mModuleGlobal.CenturyRtcAddress = 0;
mModuleGlobal.CenturyRtcAddress = GetCenturyRtcAddress ();
Status = PcRtcInit (&mModuleGlobal);
ASSERT_EFI_ERROR (Status);