From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x233.google.com (mail-wr0-x233.google.com [IPv6:2a00:1450:400c:c0c::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6D75682115 for ; Mon, 13 Feb 2017 04:30:46 -0800 (PST) Received: by mail-wr0-x233.google.com with SMTP id 89so149455605wrr.2 for ; Mon, 13 Feb 2017 04:30:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zn4Tay4uJ9/Z6mBSbYlbheKNR4tFM4rsuKrRiYRUPE0=; b=fB/1ElesTtjZhx2q5SAgw6JQCJOT7AdZoZzD4a52cpbK8k+6+Rhru/jDxiOY4AEMTn xKAI8a9XjQHL+0VAMDP2yD57FpMy659Lrq8lWFi4HbZ8hRAL5pIuW9VeE1qQ4lBFqoVR LdwAPyhf/9dfuO9L4f2XFcnUbDIgXc05ySwUg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zn4Tay4uJ9/Z6mBSbYlbheKNR4tFM4rsuKrRiYRUPE0=; b=I2vUByIl06HwxnGL+NYERNT7xYyjEjk94xzFYR0KXwXkdL82df+gn252W66ycPR/0F 4HcFiGHcEmB44bH+imqcl2I6omj5RZs5xwfPS6S30S8CqCtCy92E51VrXNfsyd5YoAps E9yxU/QOJqX4njvt7VMHz/BTmRh+9EBRZpdEJufZdA0MmejixFG9SKph4D7R+23BxV3f GPt5ng/tdfSFnXknfMEIsZf2mJNmGEjU4pJ8Zg4lDEwehGPiNsLApawwp51VXszFhssD HaAgpn30Tk0gfkr80zoRApJzuOAf+IrzD95mjK1Taiy0VRLNUwWT2U+3SMpSBExhDjRV y4uA== X-Gm-Message-State: AMke39lDTjKv+M6yO3tRFrBf/dCBbHnBXWlcoBTmISimHX19yboWfC+PckznNSCzg3GvYZeo X-Received: by 10.223.153.135 with SMTP id y7mr19386724wrb.55.1486989044486; Mon, 13 Feb 2017 04:30:44 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id m84sm5189936wmf.10.2017.02.13.04.30.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 04:30:43 -0800 (PST) Date: Mon, 13 Feb 2017 12:30:42 +0000 From: Leif Lindholm To: evan.lloyd@arm.com Cc: edk2-devel@ml01.01.org, Ard Biesheuvel , Ryan Harkin Message-ID: <20170213123042.GX16034@bivouac.eciton.net> References: <20170209192623.262044-1-evan.lloyd@arm.com> <20170209192623.262044-4-evan.lloyd@arm.com> MIME-Version: 1.0 In-Reply-To: <20170209192623.262044-4-evan.lloyd@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 3/4] ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 12:30:46 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 09, 2017 at 07:26:22PM +0000, evan.lloyd@arm.com wrote: > From: Ard Biesheuvel > > Utilise the new HardwareInterrupt2 protocol to adjust the > Edje/Level characteristics of the Watchdog interrupt. Edge. > > 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 | 4 +-- > ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 27 ++++++++++++-------- > 2 files changed, 19 insertions(+), 12 deletions(-) > > diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf > index fece14cc18315cd15510680c438288687b60c018..51d5c0042d84333b9fe66547c99a8d8ed987f175 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 > diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c > index 54a1625a32137556b58fa93ddf7fbe4d0f22c786..9ba9bf79c961b52dc9b448039a9186e069fc29f7 100644 > --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c > +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c > @@ -25,7 +25,8 @@ > #include > > #include > -#include > + > +#include If Protocol/HardwareInterrupt.h is dropped, can we move this before Protocol/WatchdogTimer.h? > > #include "GenericWatchdog.h" > > @@ -41,7 +42,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 +321,7 @@ GenericWatchdogEntry ( > if (!EFI_ERROR (Status)) { > // Install interrupt handler > Status = gBS->LocateProtocol ( > - &gHardwareInterruptProtocolGuid, > + &gHardwareInterrupt2ProtocolGuid, > NULL, > (VOID **)&mInterruptProtocol > ); > @@ -331,13 +332,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, I believe this is an incorrect level of indentation. > + 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 > + ); > + } > } > } > } > -- > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") >