summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-05-18 13:18:28 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-27 16:29:41 +0800
commit11e9a7ed0d35b3eedff38b504d50e0350b2ed92a (patch)
tree67c6ff24bc7692b6a0cb87de8c23af82321ec09d
parent6c4499ab1495e86814a0521852f2264ba5ed6a26 (diff)
downloadedk2-platforms-11e9a7ed0d35b3eedff38b504d50e0350b2ed92a.tar.xz
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> (cherry picked from commit e38ab18a49ed010c79d14dd21bf4dff5e062dbb1)
-rw-r--r--PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h12
-rw-r--r--PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c4
2 files changed, 13 insertions, 3 deletions
diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h
index 7fc19f9043..ba6092de45 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h
@@ -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
@@ -360,6 +360,16 @@ IsLeapYear (
);
/**
+ 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.
This is a notification function registered on ACPI Table change event.
diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
index 1cfb0cb198..a61a35e9ee 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
@@ -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);