From e38ab18a49ed010c79d14dd21bf4dff5e062dbb1 Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Wed, 18 May 2016 13:18:28 +0800 Subject: 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 Cc: Anbazhagan Baraneedharan Reviewed-by: Laszlo Ersek Cc: Star Zeng --- PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h | 12 +++++++++++- PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe') diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.h index 7fc19f9..ba6092d 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.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
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 1cfb0cb..a61a35e 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.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
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); -- cgit v1.1