From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (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 A2BF381CC1 for ; Tue, 1 Nov 2016 14:54:25 -0700 (PDT) Received: by mail-wm0-x22e.google.com with SMTP id t79so273331wmt.0 for ; Tue, 01 Nov 2016 14:54:27 -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=fxpEaGYjOtXc1tRd9eSa/BOseqKmT38VVAdsf+fVWWs=; b=HXmFPni+Qfdv85cDX1QRhRz+yOlzlGryjnhYyYKey7jFgimJmFzw4RD0BexTh+7P+W +ytCUOXevAFB8+IYmLioWwEAZlzKM5BSeA4lzLzKM4t9GL/t56U37W4rTHaViORPtvpS UJxSK1lUKb+gurda7eN1W6mxR06nKcyG31LzY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fxpEaGYjOtXc1tRd9eSa/BOseqKmT38VVAdsf+fVWWs=; b=DpacS3Bxt71GlcSSS6V+So1GQ8wQ5uItppPgY8xunwAlH8NdHKUyOPR0x9+kMiJxm7 4WSmXIjWoJa7GolL6HXkA9omBf8m3IxwGVw/Ltb5GkGOln4NdaM/pjUapS3W/dJ9ROq+ 3PQB+kWn4Kwux3kfO6RyFnygeA1AyOdR/wprT1vLsj7tdzoqjuDzEprJb18pRgNX5wJx gi9/tnIwVupjU65exshLU08IFgB3P9M5DFFY9ZDTpNp4PXNyYQ7Rv0w5VVuxhxqBDhQO PvpGeIgV/MTXunHYRh8QnQtYDjYvVO2lxoDBcPghKpx1ZnKz91o0Tc78PklEShMUPfUb RD8g== X-Gm-Message-State: ABUngvfWxwHj9STqtR6RP80TGFftXHEOp99DdsR4Lh7BCvHG5i/BS0f68L4dmRuCssknKZ+E X-Received: by 10.194.220.232 with SMTP id pz8mr220979wjc.154.1478037265587; Tue, 01 Nov 2016 14:54:25 -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 70sm32555168wmv.1.2016.11.01.14.54.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 14:54:24 -0700 (PDT) Date: Tue, 1 Nov 2016 21:54:23 +0000 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org Message-ID: <20161101215422.GM1161@bivouac.eciton.net> References: <1477937590-10361-1-git-send-email-ard.biesheuvel@linaro.org> <1477937590-10361-2-git-send-email-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <1477937590-10361-2-git-send-email-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [PATCH 1/5] EmbeddedPkg: introduce platform PCI I/O 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: Tue, 01 Nov 2016 21:54:26 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 31, 2016 at 06:13:06PM +0000, Ard Biesheuvel wrote: > Introduce a protocol that can be exposed by a platform for devices that > can be driven by a PCI driver, (e.g., AHCI, XHCI), but do not live on a > PCI bus. This used to be called 'PCI emulation' but given that we only > emulate the PCI config space and nothing else, it tends to be a bit > confusing so this introduces the term 'platform PCI I/O' instead. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > EmbeddedPkg/EmbeddedPkg.dec | 1 + > EmbeddedPkg/Include/Protocol/PlatformPciIo.h | 74 ++++++++++++++++++++ OK, so perhaps I should have commented on this already on 0/5, but I think this belongs in MdeModulePkg. The closest thing to an "embedded" user of this code is Juno. > 2 files changed, 75 insertions(+) > > diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec > index 2c2cf41103c2..84a6f4d01077 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -69,6 +69,7 @@ [Protocols.common] > gAndroidFastbootPlatformProtocolGuid = { 0x524685a0, 0x89a0, 0x11e3, {0x9d, 0x4d, 0xbf, 0xa9, 0xf6, 0xa4, 0x03, 0x08}} > gUsbDeviceProtocolGuid = { 0x021bd2ca, 0x51d2, 0x11e3, {0x8e, 0x56, 0xb7, 0x54, 0x17, 0xc7, 0x0b, 0x44 }} > gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }} > + gPlatformPciIoProtocolGuid = { 0x0d51905b, 0xb77e, 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d, 0x51, 0x4a }} > > [PcdsFeatureFlag.common] > gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|FALSE|BOOLEAN|0x00000001 > diff --git a/EmbeddedPkg/Include/Protocol/PlatformPciIo.h b/EmbeddedPkg/Include/Protocol/PlatformPciIo.h > new file mode 100644 > index 000000000000..a7bd584049ac > --- /dev/null > +++ b/EmbeddedPkg/Include/Protocol/PlatformPciIo.h > @@ -0,0 +1,74 @@ > +/** @file > + > + Copyright (c) 2016, Linaro, Ltd. All rights reserved.
> + > + 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 __PLATFORM_PCI_IO_H__ > +#define __PLATFORM_PCI_IO_H__ > + > +#define PLATFORM_PCI_IO_PROTOCOL_GUID \ > + { 0x0d51905b, 0xb77e, 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d, 0x51, 0x4a } } > + > +// > +// Protocol interface structure > +// > +typedef struct _PLATFORM_PCI_IO PLATFORM_PCI_IO; > + > +// > +// Data Types > +// > +typedef enum { > + PlatformPciIoDeviceOhci, > + PlatformPciIoDeviceUhci, > + PlatformPciIoDeviceEhci, > + PlatformPciIoDeviceXhci, > + PlatformPciIoDeviceAhci, SdMmc and Ufs? > + PlatformPciIoDeviceMax, > +} PLATFORM_PCI_IO_DEVICE_TYPE; > + > +typedef enum { > + PlatformPciIoDmaCoherent, > + PlatformPciIoDmaNonCoherent, > + PlatformPciIoDmaMax, > +} PLATFORM_PCI_IO_DMA_TYPE; > + > +// > +// Function Prototypes > +// > +typedef > +EFI_STATUS > +(EFIAPI *PLATFORM_PCI_IO_INIT) ( > + IN PLATFORM_PCI_IO *This > + ); > + > +struct _PLATFORM_PCI_IO { > + // > + // The MMIO address of the device > + // > + EFI_PHYSICAL_ADDRESS BaseAddress; > + // > + // The type of device > + // > + PLATFORM_PCI_IO_DEVICE_TYPE DeviceType; > + // > + // Whether this device is DMA coherent > + // > + PLATFORM_PCI_IO_DMA_TYPE DmaType; > + // > + // Initialization function for the device > + // > + PLATFORM_PCI_IO_INIT Initialize; > +}; > + > +extern EFI_GUID gPlatformPciIoProtocolGuid; > + > +#endif > -- > 2.7.4 >