]> git.proxmox.com Git - mirror_edk2.git/commitdiff
PcAtChipsetPkg/PcRtc: get century RTC address in entry point
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 18 May 2016 05:18:28 +0000 (13:18 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 23 May 2016 01:59:11 +0000 (09:59 +0800)
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>
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c

index 7fc19f90434efb71e6f72822c602d663cdb1c2cb..ba6092de45ea3bf25a5166a535cace5133ff1517 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Header file for real time clock driver.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -359,6 +359,16 @@ IsLeapYear (
   IN EFI_TIME   *Time\r
   );\r
 \r
+/**\r
+  Get the century RTC address from the ACPI FADT table.\r
+\r
+  @return  The century RTC address or 0 if not found.\r
+**/\r
+UINT8\r
+GetCenturyRtcAddress (\r
+  VOID\r
+  );\r
+\r
 /**\r
   Notification function of ACPI Table change.\r
 \r
index 1cfb0cb1988940f2c37466c1687303745810bd1b..a61a35e9eeb5973b6ee634936d059ca5e1174c54 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides Set/Get time operations.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -135,7 +135,7 @@ InitializePcRtc (
   EFI_EVENT   Event;\r
 \r
   EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_CALLBACK);\r
-  mModuleGlobal.CenturyRtcAddress = 0;\r
+  mModuleGlobal.CenturyRtcAddress = GetCenturyRtcAddress ();\r
 \r
   Status = PcRtcInit (&mModuleGlobal);\r
   ASSERT_EFI_ERROR (Status);\r