From 23666400234149a9c64b5881805db49cb8342ee7 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Fri, 12 Dec 2014 19:10:58 +0000 Subject: ArmPkg/GenericWatchdogDxe: Set up the watchdog timeout relatively to the system counter 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 Reviewed-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16513 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ArmPkg/Drivers/GenericWatchdogDxe') diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index ba09227806..b1d9c027d8 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -181,7 +181,7 @@ WatchdogSetTimerPeriod ( IN UINT64 TimerPeriod // In 100ns units ) { - UINTN TimerVal; + UINTN SystemCount; EFI_STATUS Status; // if TimerPerdiod is 0, this is a request to stop the watchdog. @@ -210,8 +210,8 @@ WatchdogSetTimerPeriod ( return Status; } WatchdogEnable (); - TimerVal = ArmGenericTimerGetTimerVal (); - Status = WatchdogWriteCompareRegister (TimerVal + mNumTimerTicks); + SystemCount = ArmGenericTimerGetSystemCount (); + Status = WatchdogWriteCompareRegister (SystemCount + mNumTimerTicks); } else { Status = WatchdogWriteOffsetRegister ((UINT32)mNumTimerTicks); WatchdogEnable (); -- cgit v1.2.3