diff options
author | Ronald Cron <Ronald.Cron@arm.com> | 2014-12-12 19:10:58 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2014-12-12 19:10:58 +0000 |
commit | 23666400234149a9c64b5881805db49cb8342ee7 (patch) | |
tree | a8215a5de4f67194bc68f98586248ac6eff79361 /ArmPkg/Drivers | |
parent | 0b4d97a0ea92289181d565000b9fcc81054d78ee (diff) | |
download | edk2-platforms-23666400234149a9c64b5881805db49cb8342ee7.tar.xz |
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 <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
Diffstat (limited to 'ArmPkg/Drivers')
-rw-r--r-- | ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 ();
|