From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (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 7303921E3EA8B for ; Thu, 14 Sep 2017 10:03:32 -0700 (PDT) Received: by mail-wr0-x22a.google.com with SMTP id l22so867639wrc.10 for ; Thu, 14 Sep 2017 10:06:31 -0700 (PDT) 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=wAbC1sGSejDqfkfe+ppgnChRFdcvzVYsisMXGcNEE1k=; b=GXjd1ohr74sR2X99cN+W0UlWaA29kdFpYYacpTHUzg6zh5iraugkoD2CvqzhMJIxdj s8u5oKYa6FstgG3BAZYxjmHTj3lHUKT84KOcELSQfNtXUbLNNb4HeLl7Pcn4C4CpQwTp 4BbiQ5pdiEAJscJ62Q+byZxlmWdjXCKhFNnEs= 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=wAbC1sGSejDqfkfe+ppgnChRFdcvzVYsisMXGcNEE1k=; b=dIbq5IrW2SkMchNvDQtFPYbc9DEqlUvOeGmdQV3gnM3t6FKk4VTM7dxdR22BrDxK80 4DDB1xq9uPCPaGUV7ybo7k23zoM24WA90i0Vpw+jZgOjEIRa0tdb+0MmEz+8quJ7v8sv CICnUZZCiWdFVIa7B4s+Fi0IZFXyfLhcSidSzphdD5MSaRJb5Xl4LyPKcSdtw+u//9jc TRROWwagyObC38Ii2QETGM2pc6+QLdOSXHeejfQ14FOFUPF0WzLEwQDREhP3K/VaRcNE Fs+dJrP7ifrbuG1QJxh+7olJBMRkHfpUYHOMGD2jgnGD0RKthfU04X8DRa1d0GJAcVDf pRWQ== X-Gm-Message-State: AHPjjUiqrbDg99tmtpDGIMj81xdXpYcvAnnmMFEjl60KhQ2wMmrciOS/ T6oQqBXEsnEL+bw5 X-Google-Smtp-Source: AOwi7QC+aJbDMfWMRbfjtOnnAMFbecwF5lGO2RLShI34NIbjW6Ebs0+EHDKQqM6RmkO3Q+nEqFn0PA== X-Received: by 10.223.135.66 with SMTP id 2mr18385879wrz.208.1505408790317; Thu, 14 Sep 2017 10:06:30 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id n57sm10163368wrn.29.2017.09.14.10.06.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Sep 2017 10:06:28 -0700 (PDT) Date: Thu, 14 Sep 2017 18:06:27 +0100 From: Leif Lindholm To: evan.lloyd@arm.com Cc: edk2-devel@lists.01.org, Ard Biesheuvel , Matteo Carlini , nd@arm.com, Marcin Wojtas , Arvind Chauhan , Daniil Egranov , Thomas Panakamattam Abraham Message-ID: <20170914170627.nnu6awijp5ewnkay@bivouac.eciton.net> References: <20170911152335.72672-1-evan.lloyd@arm.com> <20170911152335.72672-5-evan.lloyd@arm.com> MIME-Version: 1.0 In-Reply-To: <20170911152335.72672-5-evan.lloyd@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [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: , X-List-Received-Date: Thu, 14 Sep 2017 17:03:32 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 11, 2017 at 04:23:34PM +0100, evan.lloyd@arm.com wrote: > 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 Looks plausible, but I would loke to see it tested by someone not directly involved in development. Armada70x0 also uses this, so adding Marcin on cc. Beyond that, I'm told in Ryan's absence Arvind, Daniil and Thomas are "platform owners" for Juno, so if one of you could have a spin, that'd be great. Pending another Tested-by: Reviewed-by: Leif Lindholm / Leif > --- > ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 6 ++--- > ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 28 ++++++++++++-------- > 2 files changed, 20 insertions(+), 14 deletions(-) > > 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 > + ); > + } > } > } > } > -- > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") >