]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 1 Sep 2016 16:21:57 +0000 (17:21 +0100)
committerLeif Lindholm <leif.lindholm@linaro.org>
Thu, 5 Oct 2017 20:23:39 +0000 (21:23 +0100)
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>
ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf

index c5372056f3ea080c350ff67ce8f78f0a77663343..252ba5bf321e379ef440830cab468af7c55905b3 100644 (file)
@@ -24,8 +24,8 @@
 #include <Library/UefiLib.h>\r
 #include <Library/ArmGenericTimerCounterLib.h>\r
 \r
+#include <Protocol/HardwareInterrupt2.h>\r
 #include <Protocol/WatchdogTimer.h>\r
-#include <Protocol/HardwareInterrupt.h>\r
 \r
 #include "GenericWatchdog.h"\r
 \r
@@ -41,7 +41,7 @@ UINTN mTimerFrequencyHz = 0;
    It is therefore stored here. 0 means the timer is not running. */\r
 UINT64 mNumTimerTicks = 0;\r
 \r
-EFI_HARDWARE_INTERRUPT_PROTOCOL *mInterruptProtocol;\r
+EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;\r
 \r
 EFI_STATUS\r
 WatchdogWriteOffsetRegister (\r
@@ -311,7 +311,7 @@ GenericWatchdogEntry (
   if (!EFI_ERROR (Status)) {\r
     // Install interrupt handler\r
     Status = gBS->LocateProtocol (\r
-                    &gHardwareInterruptProtocolGuid,\r
+                    &gHardwareInterrupt2ProtocolGuid,\r
                     NULL,\r
                     (VOID **)&mInterruptProtocol\r
                     );\r
@@ -322,14 +322,21 @@ GenericWatchdogEntry (
                  WatchdogInterruptHandler\r
                  );\r
       if (!EFI_ERROR (Status)) {\r
-        // Install the Timer Architectural Protocol onto a new handle\r
-        Handle = NULL;\r
-        Status = gBS->InstallMultipleProtocolInterfaces (\r
-                        &Handle,\r
-                        &gEfiWatchdogTimerArchProtocolGuid,\r
-                        &gWatchdogTimer,\r
-                        NULL\r
-                        );\r
+        Status = mInterruptProtocol->SetTriggerType (\r
+                   mInterruptProtocol,\r
+                   FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),\r
+                   EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING\r
+                   );\r
+        if (!EFI_ERROR (Status)) {\r
+          // Install the Timer Architectural Protocol onto a new handle\r
+          Handle = NULL;\r
+          Status = gBS->InstallMultipleProtocolInterfaces (\r
+                          &Handle,\r
+                          &gEfiWatchdogTimerArchProtocolGuid,\r
+                          &gWatchdogTimer,\r
+                          NULL\r
+                          );\r
+        }\r
       }\r
     }\r
   }\r
index fece14cc18315cd15510680c438288687b60c018..ba0403d7fdc3589803c643c27a44918e73afa97e 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2013-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2013-2017, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -47,7 +47,7 @@
 \r
 [Protocols]\r
   gEfiWatchdogTimerArchProtocolGuid\r
-  gHardwareInterruptProtocolGuid\r
+  gHardwareInterrupt2ProtocolGuid\r
 \r
 [Depex]\r
-  gHardwareInterruptProtocolGuid\r
+  gHardwareInterrupt2ProtocolGuid\r