From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::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 D55978211E for ; Mon, 13 Feb 2017 04:26:55 -0800 (PST) Received: by mail-wm0-x22a.google.com with SMTP id v186so156654303wmd.0 for ; Mon, 13 Feb 2017 04:26:55 -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=XgZ3HI4BNns6A8v35AIIAc23f5X1nHWgAvM4fKRDeUY=; b=ZAShqo4lADsdoKOHqpEVGfuVwR8sG149HJJN0XwVXBoKp89uXDzdRp+e1FVKpynuCL OTw87tCEMsS5LK1ZrwJ1E7juxUJ70V0GTvFZQRKkgOj8qiBRC3L1QfV5wB+fsq8GKyIu jMZaEy1eiMi8SJhKGZGrEbGpHeYtnpzgiAAcM= 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=XgZ3HI4BNns6A8v35AIIAc23f5X1nHWgAvM4fKRDeUY=; b=ACJQqjNfc+7dQ6BsjholC72k4O3fvRd91p4VR3kGUvkVycfIJO7MHY4NjzkhJgaPxk l6io/NIxsd0hsNIqmoOGRS1aCCbUUuwsnznWFoD1vq5fp3I9JrtJngAbU2KKzwuENBrO 6Ht0BE1ZiaBSzbyZCFbeYphiss6c7slxWAFsyoxqEprWOBjE7Drt1SybujU1wQxQ51Vq LAooOz9H9ZNE0oCHrfKn2QOmlvhmGd/c2tGaMkGfS78Ny0TZg1H1kUUfXqWRanLRMaSC JdYQE9qGtakvuK7r8AcCwpkJ2dJokUuIjgMIVYVDv3Zn+4Lfm+ZVr/8PNoaiExEVCGgW S3YA== X-Gm-Message-State: AMke39ltO4YEUdjTQCYf8NNXhUOYPGPrqyIqb9jJS7FKmQKSFSi1bmwy1lxJ6VduUVbwzBVT X-Received: by 10.28.145.210 with SMTP id t201mr35982413wmd.42.1486988814393; Mon, 13 Feb 2017 04:26:54 -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 n10sm13659480wrb.9.2017.02.13.04.26.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 04:26:53 -0800 (PST) Date: Mon, 13 Feb 2017 12:26:51 +0000 From: Leif Lindholm To: evan.lloyd@arm.com Cc: edk2-devel@ml01.01.org, Ard Biesheuvel , Ryan Harkin Message-ID: <20170213122651.GW16034@bivouac.eciton.net> References: <20170209192623.262044-1-evan.lloyd@arm.com> <20170209192623.262044-2-evan.lloyd@arm.com> MIME-Version: 1.0 In-Reply-To: <20170209192623.262044-2-evan.lloyd@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 1/4] EmbeddedPkg: introduce HardwareInterrupt2 protocol 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:26:56 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 09, 2017 at 07:26:20PM +0000, evan.lloyd@arm.com wrote: > From: Ard Biesheuvel > > The existing HardwareInterrupt protocol lacks the method to configure > the level/edge and polarity properties of an interrupt. So introduce a > new protocol HardwareInterrupt2, and add some new members that allow the > manipulation of those properties. > > 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 > --- > EmbeddedPkg/EmbeddedPkg.dec | 1 + > EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++ > 2 files changed, 182 insertions(+) > > diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec > index 2c2cf41103c282103c2a83ad9a105d0f6ac2e9a3..2464f715e68c8e0eb1214c0170fb040830b88f06 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -58,6 +58,7 @@ [Guids.common] > > [Protocols.common] > gHardwareInterruptProtocolGuid = { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } > + gHardwareInterrupt2ProtocolGuid = { 0x32898322, 0x2da1, 0x474a, { 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } } > gEfiDebugSupportPeriodicCallbackProtocolGuid = { 0x9546e07c, 0x2cbb, 0x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } } > gEfiEblAddCommandProtocolGuid = { 0xaeda2428, 0x9a22, 0x4637, { 0x9b, 0x21, 0x54, 0x5e, 0x28, 0xfb, 0xb8, 0x29 } } > gEmbeddedDeviceGuid = { 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0xe9, 0xb, 0x71, 0x8f, 0x27, 0xde } } > diff --git a/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h > new file mode 100644 > index 0000000000000000000000000000000000000000..61acdaac4341951b8c1916858490a815cf94dc99 > --- /dev/null > +++ b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h > @@ -0,0 +1,181 @@ > +/** @file > + > + Copyright (c) 2016, Linaro Ltd. All rights reserved.
-2017 by now, I guess. > + > + This program and the accompanying materials > + are licensed and made available under the terms and conditions of the BSD License > + which accompanies this distribution. The full text of the license may be found at > + http://opensource.org/licenses/bsd-license.php > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > + > +**/ > + > +#ifndef __HARDWARE_INTERRUPT2_H__ > +#define __HARDWARE_INTERRUPT2_H__ > + > +#include > + > +// 22838932-1a2d-4a47-aaba-f3f7cf569470 > + > +#define EFI_HARDWARE_INTERRUPT2_PROTOCOL_GUID \ > + { 0x32898322, 0x2da1, 0x474a, { 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } } > + > +typedef enum { > + EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_LOW, > + EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_HIGH, > + EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_FALLING, > + EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING, > +} EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE; > + > +typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL EFI_HARDWARE_INTERRUPT2_PROTOCOL; > + > +/** > + Register Handler for the specified interrupt source. > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + @param Handler Callback for interrupt. NULL to unregister > + > + @retval EFI_SUCCESS Source was updated to support Handler. > + @retval EFI_DEVICE_ERROR Hardware could not be programmed. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_REGISTER) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, > + IN HARDWARE_INTERRUPT_SOURCE Source, Arguments horizontally misaligned? > + IN HARDWARE_INTERRUPT_HANDLER Handler > + ); > + > + > +/** > + Enable interrupt source Source. > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + > + @retval EFI_SUCCESS Source interrupt enabled. > + @retval EFI_DEVICE_ERROR Hardware could not be programmed. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_ENABLE) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, > + IN HARDWARE_INTERRUPT_SOURCE Source Arguments horizontally misaligned? > + ); > + > + > + > +/** > + Disable interrupt source Source. > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + > + @retval EFI_SUCCESS Source interrupt disabled. > + @retval EFI_DEVICE_ERROR Hardware could not be programmed. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_DISABLE) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, > + IN HARDWARE_INTERRUPT_SOURCE Source Arguments horizontally misaligned? > + ); > + > + > +/** > + Return current state of interrupt source Source. > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + @param InterruptState TRUE: source enabled, FALSE: source disabled. > + > + @retval EFI_SUCCESS InterruptState is valid > + @retval EFI_DEVICE_ERROR InterruptState is not valid > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_INTERRUPT_STATE) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, > + IN HARDWARE_INTERRUPT_SOURCE Source, Arguments horizontally misaligned? > + IN BOOLEAN *InterruptState > + ); > + > +/** > + Signal to the hardware that the End Of Intrrupt state > + has been reached. > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + > + @retval EFI_SUCCESS Source interrupt EOI'ed. > + @retval EFI_DEVICE_ERROR Hardware could not be programmed. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_END_OF_INTERRUPT) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, Did someone clone HARDWARE_INTERRUPT_PROTOCOL templates, inserted a 2 and forgot to delete a space? :) (I'll stop commenting, but please address throughout.) / Leif > + IN HARDWARE_INTERRUPT_SOURCE Source > + ); > + > +/** > + Return the configured trigger type for an interrupt source > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + @param TriggerType The configured trigger type > + > + @retval EFI_SUCCESS Operation successful > + @retval EFI_DEVICE_ERROR Information could not be returned > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, > + IN HARDWARE_INTERRUPT_SOURCE Source, > + OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE *TriggerType > + ); > + > + > +/** > + Configure the trigger type for an interrupt source > + > + @param This Instance pointer for this protocol > + @param Source Hardware source of the interrupt > + @param TriggerType The trigger type to configure > + > + @retval EFI_SUCCESS Operation successful > + @retval EFI_DEVICE_ERROR Hardware could not be programmed. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE) ( > + IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This, > + IN HARDWARE_INTERRUPT_SOURCE Source, > + IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType > + ); > + > +struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL { > + HARDWARE_INTERRUPT2_REGISTER RegisterInterruptSource; > + HARDWARE_INTERRUPT2_ENABLE EnableInterruptSource; > + HARDWARE_INTERRUPT2_DISABLE DisableInterruptSource; > + HARDWARE_INTERRUPT2_INTERRUPT_STATE GetInterruptSourceState; > + HARDWARE_INTERRUPT2_END_OF_INTERRUPT EndOfInterrupt; > + > + // v2 members > + HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE GetTriggerType; > + HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE SetTriggerType; > +}; > + > +extern EFI_GUID gHardwareInterrupt2ProtocolGuid; > + > +#endif > -- > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759") >