]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/GenericWatchdogDxe: Set up the watchdog timeout relatively to the system counter
authorRonald Cron <Ronald.Cron@arm.com>
Fri, 12 Dec 2014 19:10:58 +0000 (19:10 +0000)
committeroliviermartin <oliviermartin@Edk2>
Fri, 12 Dec 2014 19:10:58 +0000 (19:10 +0000)
Use the system counter to compute the watchdog compare
value as the watchdog compare value is compared to the
system counter to check if the watchdog timeout expired or not.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16513 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c

index ba09227806ad50016faec647ea8bcd0059b9fe8a..b1d9c027d80ec01b89537a07bf9fe0244dd8b21c 100644 (file)
@@ -181,7 +181,7 @@ WatchdogSetTimerPeriod (
   IN UINT64                                   TimerPeriod   // In 100ns units\r
   )\r
 {\r
-  UINTN       TimerVal;\r
+  UINTN       SystemCount;\r
   EFI_STATUS  Status;\r
 \r
   // if TimerPerdiod is 0, this is a request to stop the watchdog.\r
@@ -210,8 +210,8 @@ WatchdogSetTimerPeriod (
       return Status;\r
     }\r
     WatchdogEnable ();\r
-    TimerVal = ArmGenericTimerGetTimerVal ();\r
-    Status = WatchdogWriteCompareRegister (TimerVal + mNumTimerTicks);\r
+    SystemCount = ArmGenericTimerGetSystemCount ();\r
+    Status      = WatchdogWriteCompareRegister (SystemCount + mNumTimerTicks);\r
   } else {\r
     Status = WatchdogWriteOffsetRegister ((UINT32)mNumTimerTicks);\r
     WatchdogEnable ();\r