From patchwork Thu Sep 21 16:23:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Lloyd X-Patchwork-Id: 113832 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2219601qgf; Thu, 21 Sep 2017 09:23:57 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDNfWra2+DFceaa6ShrnCR0gP1wdd9PYY5szyrCnL58gqLRA+SNtlBMsaZKL/v43wNaWCWc X-Received: by 10.98.214.131 with SMTP id a3mr6218181pfl.115.1506011037633; Thu, 21 Sep 2017 09:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506011037; cv=none; d=google.com; s=arc-20160816; b=djcVOmAGBdSP2ILigAdICuhYShsFV9AyIMOpxBk7kyWHkXhYIsYScuo4cMJeLPSUtW rqmxHDZuTdrZI/J+V/Z/FSUPKqbenRj9CHFAnf3OFI0h5qW0tAPQyGqzEqU8ibx6zmQ+ vL/fbUO5oO5vmUHzmlxKdKFfA3a6uuRhKZ7UhMenIaEVbRaht4+IrtMs95FlLE16pYCV a27Ke8URTptSV7h6wci/bevm/m+kzIdx0t2gWjBMU6KfzGH5ON9uYAPv5mfUp+nou4ti 75/g6GlB0lAYs42zooOrKvBAeS8Q4C5tSt7qQSaYHwiJQxOONQ6d0/T75w3yeftO2rBK tIFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=YOz1kH4hw7dJ9wNQXznaOnuS143dh+iDv0ExSq9o3xc=; b=rP3LWCacHWpeVQl0yRWxpFdRsIKhuzjvrvs5KUxhyGncBDeK3Ms3AJ/h6D4xdv4iTo 2+CYldR7IcN0h7yQxDEb38TRULXHnFB7EZkZgNzXw23Snv+yzF8eJE54EFPHZ3q2PK2x mltw4Lt6IkXR0xZvlrIQirROWKAfi5JFNB7Tb7hNrPgX3576NAH/4ySfSFk2bl0UaLkA WFPu0k5qoenvwB9thokI/6ckMhypkZ9H9frzNQTJ74jyMmNAsPvwSbuGsmXXKG+vsb/A UigmInX7RUS9G2EbmdswC6pwH9Xnjd0QVjDLRfSLHMmBYst8sQTTIp5q6KWZloo4kU8r RDRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id g13si1210765pfm.247.2017.09.21.09.23.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 09:23:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8C19121D492F6; Thu, 21 Sep 2017 09:20:48 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 72FEB21D046C7 for ; Thu, 21 Sep 2017 09:20:46 -0700 (PDT) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.32.12]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v8LGNovY021123; Thu, 21 Sep 2017 17:23:51 +0100 From: evan.lloyd@arm.com To: edk2-devel@lists.01.org Date: Thu, 21 Sep 2017 17:23:44 +0100 Message-Id: <20170921162345.11724-5-evan.lloyd@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170921162345.11724-1-evan.lloyd@arm.com> References: <20170921162345.11724-1-evan.lloyd@arm.com> Subject: [edk2] [PATCH 4/4] ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" From: Ard Biesheuvel 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 Signed-off-by: Girish Pathak Signed-off-by: Evan Lloyd Tested-by: Girish Pathak Reviewed-by: Leif Lindholm --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 6 ++-- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 29 ++++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) -- Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf index fece14cc18315cd15510680c438288687b60c018..ba0403d7fdc3589803c643c27a44918e73afa97e 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 @@ [Pcd.common] [Protocols] gEfiWatchdogTimerArchProtocolGuid - gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid [Depex] - gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index c5372056f3ea080c350ff67ce8f78f0a77663343..252ba5bf321e379ef440830cab468af7c55905b3 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -24,8 +24,8 @@ #include #include +#include #include -#include #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 + ); + } } } }