From patchwork Mon Sep 11 15:23:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Lloyd X-Patchwork-Id: 112202 Delivered-To: patch@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5947665pji; Mon, 11 Sep 2017 08:23:52 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6Mh+rxbxHxwUlkhic28wukil01Iw1fDfIzPgKinNSc0UXHLN2WwLVjWtRzR6KNdF5FqChj X-Received: by 10.84.217.221 with SMTP id d29mr13884869plj.309.1505143432662; Mon, 11 Sep 2017 08:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505143432; cv=none; d=google.com; s=arc-20160816; b=e41gMM82ba6w/hs5woEMY+YGMt/UBZ5eCVRBNFKIjX6guthZw8sqfI1rNlhr6DZGzv 2Fnfq4PrnGgvFlN+0suVNbJTj07HKwJAj8qgnvyW5Kz0fM73WXTxeRc/r6KO9pYF5Kqy +QbFkmXYiDJIk1k+KJVyVQJqDuh8TFOBKN2TV49wO0kgqlQFfSKuQkrNLYYRC6PtivBK e09yv0mgiETDptU641te/hwkgx90GIafjrrZk38XrxdopY+Qub3JLrRWI2xxcxQ0NRWI Z1NIt4/QQFhvsLr3STjJKMLBJPY7q2YSSLKhMYD6irO0oMyBiV5Wp+oO8F1Is31oKWYq 4PKg== 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=u6CeYk0JSAyw5Q9QFDjuxHumnhyHaAzpjwBFjTM8PwI=; b=BkPpqcHJy2YiQg5P9B9JMKyaP5Hpdpms1id0uFldUbgf48tJ7woRU57fLSq0ZR1rqV sb0BZi9YXtZ/xpBJVdH3NaMD2jVXa6UtTjSQ9C2DksNL6NknuCmCuts1tukyVMcXa77y QgskMOz1IGremM60dKbaIUkaybvaYoRvmcwofOuSTQDp9lwO7b1fhmqhBIUcajE6zMo7 gijcrnVZmZeB+5wiNUbjpf8al28ZLqrVjfG/XfN6Cay4BkO0iHwbTL+8QZEtxC8slOU/ pDxBugu31jXnEUtukAq2CThXy6g9cF5kfO4LDiFLq3LIIshMHYkQssO8ICthRCiq6NaQ +YfQ== 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 y72si7117210plh.184.2017.09.11.08.23.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 08:23:52 -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 718C321CEB0FE; Mon, 11 Sep 2017 08:20:51 -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 6621921CEB0E4 for ; Mon, 11 Sep 2017 08:20:48 -0700 (PDT) Received: from E111747.Emea.Arm.com (e111747.emea.arm.com [10.1.26.71]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id v8BFNeaK010774; Mon, 11 Sep 2017 16:23:41 +0100 From: evan.lloyd@arm.com To: edk2-devel@lists.01.org Date: Mon, 11 Sep 2017 16:23:34 +0100 Message-Id: <20170911152335.72672-5-evan.lloyd@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170911152335.72672-1-evan.lloyd@arm.com> References: <20170911152335.72672-1-evan.lloyd@arm.com> Subject: [edk2] [PATCH 4/5] 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.0 Signed-off-by: Ard Biesheuvel Signed-off-by: Girish Pathak Signed-off-by: Evan Lloyd Tested-by: Girish Pathak --- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 6 ++--- ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 28 ++++++++++++-------- 2 files changed, 20 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 Reviewed-by: Leif Lindholm 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 6d102e25047253048ac555d6fb5de7223d78f381..69844db2e11f51907e6c8bff5c67d27ceb498150 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -1,6 +1,6 @@ /** @file * -* 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 @@ -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 ( @@ -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 + ); + } } } }