diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-09-01 17:21:57 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2017-10-05 21:23:39 +0100 |
commit | baee8efb361496b4be300b467340b2593ca30c9c (patch) | |
tree | 4562283c44bb4700b25c2966fb67f2d63deee5e6 /ArmPkg | |
parent | 8659306a2e8f7dfceebce2be358b564f7aff6cbb (diff) | |
download | edk2-baee8efb361496b4be300b467340b2593ca30c9c.tar.gz edk2-baee8efb361496b4be300b467340b2593ca30c9c.tar.bz2 edk2-baee8efb361496b4be300b467340b2593ca30c9c.zip |
ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type
Utilise the new HardwareInterrupt2 protocol to adjust the
Edge/Level characteristics of the Watchdog interrupt.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Girish Pathak <girish.pathak@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Tested-by: Girish Pathak <girish.pathak@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPkg')
-rw-r--r-- | ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 29 | ||||
-rw-r--r-- | ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 6 |
2 files changed, 21 insertions, 14 deletions
diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index c5372056f3..252ba5bf32 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -24,8 +24,8 @@ #include <Library/UefiLib.h>
#include <Library/ArmGenericTimerCounterLib.h>
+#include <Protocol/HardwareInterrupt2.h>
#include <Protocol/WatchdogTimer.h>
-#include <Protocol/HardwareInterrupt.h>
#include "GenericWatchdog.h"
@@ -41,7 +41,7 @@ UINTN mTimerFrequencyHz = 0; It is therefore stored here. 0 means the timer is not running. */
UINT64 mNumTimerTicks = 0;
-EFI_HARDWARE_INTERRUPT_PROTOCOL *mInterruptProtocol;
+EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;
EFI_STATUS
WatchdogWriteOffsetRegister (
@@ -311,7 +311,7 @@ GenericWatchdogEntry ( if (!EFI_ERROR (Status)) {
// Install interrupt handler
Status = gBS->LocateProtocol (
- &gHardwareInterruptProtocolGuid,
+ &gHardwareInterrupt2ProtocolGuid,
NULL,
(VOID **)&mInterruptProtocol
);
@@ -322,14 +322,21 @@ GenericWatchdogEntry ( WatchdogInterruptHandler
);
if (!EFI_ERROR (Status)) {
- // Install the Timer Architectural Protocol onto a new handle
- Handle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Handle,
- &gEfiWatchdogTimerArchProtocolGuid,
- &gWatchdogTimer,
- NULL
- );
+ Status = mInterruptProtocol->SetTriggerType (
+ mInterruptProtocol,
+ FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),
+ EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING
+ );
+ if (!EFI_ERROR (Status)) {
+ // Install the Timer Architectural Protocol onto a new handle
+ Handle = NULL;
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &Handle,
+ &gEfiWatchdogTimerArchProtocolGuid,
+ &gWatchdogTimer,
+ NULL
+ );
+ }
}
}
}
diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf index fece14cc18..ba0403d7fd 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf @@ -1,5 +1,5 @@ #
-# Copyright (c) 2013-2014, ARM Limited. All rights reserved.
+# Copyright (c) 2013-2017, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -47,7 +47,7 @@ [Protocols]
gEfiWatchdogTimerArchProtocolGuid
- gHardwareInterruptProtocolGuid
+ gHardwareInterrupt2ProtocolGuid
[Depex]
- gHardwareInterruptProtocolGuid
+ gHardwareInterrupt2ProtocolGuid
|