summaryrefslogtreecommitdiffstats
path: root/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-05-18 13:18:28 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-05-23 09:59:11 +0800
commite38ab18a49ed010c79d14dd21bf4dff5e062dbb1 (patch)
tree0e86f2459197b699966020e480db5d3c6377d78c /PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe
parent9e11e9225a3ecf605e7f360c689f17d91d8115f2 (diff)
downloadedk2-e38ab18a49ed010c79d14dd21bf4dff5e062dbb1.tar.gz
edk2-e38ab18a49ed010c79d14dd21bf4dff5e062dbb1.tar.bz2
edk2-e38ab18a49ed010c79d14dd21bf4dff5e062dbb1.zip
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>
Diffstat (limited to 'PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe')
-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);