From patchwork Thu Sep 1 16:21:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 75233 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp388127qga; Thu, 1 Sep 2016 09:23:01 -0700 (PDT) X-Received: by 10.55.22.22 with SMTP id g22mr739602qkh.267.1472746981547; Thu, 01 Sep 2016 09:23:01 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h64si4678636qkf.178.2016.09.01.09.22.57; Thu, 01 Sep 2016 09:23:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 836A46172C; Thu, 1 Sep 2016 16:22:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 3EB90608BE; Thu, 1 Sep 2016 16:22:24 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0F12660866; Thu, 1 Sep 2016 16:22:19 +0000 (UTC) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by lists.linaro.org (Postfix) with ESMTPS id EC499606F3 for ; Thu, 1 Sep 2016 16:22:16 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id c133so86795644wmd.1 for ; Thu, 01 Sep 2016 09:22:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bOU/SQsrO1AyQielq+hmzdDAa9uxBKvyBadcFCRd9ls=; b=I5EnBjztc7zYWds0lTaW6OY4WP2LuB0FTBKFroXv+wqsjivDfECxekqXIlBRFO5W6t JGDgevT52FngNBFIOVfNlYo4VgPLgJrzKnKEu/9AR4TTbUPA9/Er7EkQGEGjhE6EZbl8 DkJFPVyPScvh6fFoGat43mB9goTwi7StTJa98Dagn6oztCLyDcPm9Zj+ZhNjtI28ev6B frRU4VocC8LmsQJTcVDfLJopqV5zBEJy4riK7/ABr+SIRLoyNRT0xqCvjkVSdXKuJDo+ /JkBtZ8QXmX4tg7FmbWQ7kyn33kAN3rpv6QBct8UxyRPa1NJ85m8lHjjT1hTWwzeooWv dNGA== X-Gm-Message-State: AE9vXwM4l+lUkYg2YvR/oDFbZP5o49hmEIDxBZ4ZWmIKm5Zc2YY8tb+Kv93FSyOESohsT6x3Ejk= X-Received: by 10.194.240.39 with SMTP id vx7mr15348929wjc.38.1472746935894; Thu, 01 Sep 2016 09:22:15 -0700 (PDT) Received: from localhost.localdomain ([197.253.250.146]) by smtp.gmail.com with ESMTPSA id yt4sm6030018wjc.48.2016.09.01.09.22.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 09:22:15 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org, ryan.harkin@linaro.org, evan.lloyd@arm.com, leif.lindholm@linaro.org, Charles.Garcia-Tobin@arm.com Date: Thu, 1 Sep 2016 17:21:57 +0100 Message-Id: <1472746917-21546-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472746917-21546-1-git-send-email-ard.biesheuvel@linaro.org> References: <1472746917-21546-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [Linaro-uefi] [PATCH 3/3] ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set interrupt type X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 ++++++++++++-------- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index 54a1625a3213..1b4679c7eb40 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -25,7 +25,7 @@ #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 ( @@ -320,7 +320,7 @@ GenericWatchdogEntry ( if (!EFI_ERROR (Status)) { // Install interrupt handler Status = gBS->LocateProtocol ( - &gHardwareInterruptProtocolGuid, + &gHardwareInterrupt2ProtocolGuid, NULL, (VOID **)&mInterruptProtocol ); @@ -331,13 +331,19 @@ 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 fece14cc1831..51d5c0042d84 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf @@ -47,7 +47,7 @@ [Pcd.common] [Protocols] gEfiWatchdogTimerArchProtocolGuid - gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid [Depex] - gHardwareInterruptProtocolGuid + gHardwareInterrupt2ProtocolGuid