summaryrefslogtreecommitdiffstats
path: root/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c')
-rw-r--r--PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
index ff1b019ce2..5505f6da2e 100644
--- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
+++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c
@@ -561,6 +561,7 @@ PcRtcSetTime (
{
EFI_STATUS Status;
EFI_TIME RtcTime;
+ RTC_REGISTER_A RegisterA;
RTC_REGISTER_B RegisterB;
UINT32 TimerVar;
@@ -638,6 +639,11 @@ PcRtcSetTime (
RegisterB.Bits.Set = 1;
RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
+ RegisterA.Data = RtcRead (RTC_ADDRESS_REGISTER_A);
+ //
+ // Set Divider in Reset status, RTC stops
+ //
+ RtcWrite (RTC_ADDRESS_REGISTER_A, RegisterA.Data | RTC_DIV_RESET);
//
// Store the century value to RTC before converting to BCD format.
//
@@ -661,6 +667,10 @@ PcRtcSetTime (
RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data);
//
+ // Restore Divider status
+ //
+ RtcWrite (RTC_ADDRESS_REGISTER_A, RegisterA.Data);
+ //
// Release RTC Lock.
//
if (!EfiAtRuntime ()) {