From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>,
"Gao, Liming" <liming.gao@intel.com>,
"afish@apple.com" <afish@apple.com>,
"Kinney, Michael D" <michael.d.kinney@intel.com>,
"mw@semihalf.com" <mw@semihalf.com>,
"Tian, Feng" <feng.tian@intel.com>
Subject: Re: [PATCH v4 1/5] MdeModulePkg: introduce non-discoverable device protocol
Date: Mon, 28 Nov 2016 01:57:13 +0000 [thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D58E8CFE0@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1480088538-21834-2-git-send-email-ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Thanks/Ray
> -----Original Message-----
> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
> Sent: Friday, November 25, 2016 11:42 PM
> To: edk2-devel@lists.01.org; leif.lindholm@linaro.org; Gao, Liming
> <liming.gao@intel.com>; afish@apple.com; Ni, Ruiyu <ruiyu.ni@intel.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>; mw@semihalf.com; Tian,
> Feng <feng.tian@intel.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Subject: [PATCH v4 1/5] MdeModulePkg: introduce non-discoverable device
> protocol
>
> Introduce a protocol that can be exposed by a platform for devices that are
> not discoverable, usually because they are wired straight to the memory bus
> rather than to an enumerable bus like PCI or USB.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> MdeModulePkg/Include/Guid/NonDiscoverableDevice.h | 58
> +++++++++++++++
> MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h | 77
> ++++++++++++++++++++
> MdeModulePkg/MdeModulePkg.dec | 14 ++++
> 3 files changed, 149 insertions(+)
>
> diff --git a/MdeModulePkg/Include/Guid/NonDiscoverableDevice.h
> b/MdeModulePkg/Include/Guid/NonDiscoverableDevice.h
> new file mode 100644
> index 000000000000..d182e4b9d2fe
> --- /dev/null
> +++ b/MdeModulePkg/Include/Guid/NonDiscoverableDevice.h
> @@ -0,0 +1,58 @@
> +/** @file
> + GUIDs to identify devices that are not on a discoverable bus but can
> +be
> + controlled by a standard class driver
> +
> + Copyright (c) 2016, Linaro, Ltd. All rights reserved.<BR>
> +
> + 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 __NON_DISCOVERABLE_DEVICE_GUID_H__
> +#define __NON_DISCOVERABLE_DEVICE_GUID_H__
> +
> +#define EDKII_NON_DISCOVERABLE_AHCI_DEVICE_GUID \
> + { 0xC7D35798, 0xE4D2, 0x4A93, {0xB1, 0x45, 0x54, 0x88, 0x9F, 0x02,
> +0x58, 0x4B } }
> +
> +#define EDKII_NON_DISCOVERABLE_AMBA_DEVICE_GUID \
> + { 0x94440339, 0xCC93, 0x4506, {0xB4, 0xC6, 0xEE, 0x8D, 0x0F, 0x4C,
> +0xA1, 0x91 } }
> +
> +#define EDKII_NON_DISCOVERABLE_EHCI_DEVICE_GUID \
> + { 0xEAEE5615, 0x0CFD, 0x45FC, {0x87, 0x69, 0xA0, 0xD8, 0x56, 0x95,
> +0xAF, 0x85 } }
> +
> +#define EDKII_NON_DISCOVERABLE_NVME_DEVICE_GUID \
> + { 0xC5F25542, 0x2A79, 0x4A26, {0x81, 0xBB, 0x4E, 0xA6, 0x32, 0x33,
> +0xB3, 0x09 } }
> +
> +#define EDKII_NON_DISCOVERABLE_OHCI_DEVICE_GUID \
> + { 0xB20005B0, 0xBB2D, 0x496F, {0x86, 0x9C, 0x23, 0x0B, 0x44, 0x79,
> +0xE7, 0xD1 } }
> +
> +#define EDKII_NON_DISCOVERABLE_SDHCI_DEVICE_GUID \
> + { 0x1DD1D619, 0xF9B8, 0x463E, {0x86, 0x81, 0xD1, 0xDC, 0x7C, 0x07,
> +0xB7, 0x2C } }
> +
> +#define EDKII_NON_DISCOVERABLE_UFS_DEVICE_GUID \
> + { 0x2EA77912, 0x80A8, 0x4947, {0xBE, 0x69, 0xCD, 0xD0, 0x0A, 0xFB,
> +0xE5, 0x56 } }
> +
> +#define EDKII_NON_DISCOVERABLE_UHCI_DEVICE_GUID \
> + { 0xA8CDA0A2, 0x4F37, 0x4A1B, {0x8E, 0x10, 0x8E, 0xF3, 0xCC, 0x3B,
> +0xF3, 0xA8 } }
> +
> +#define EDKII_NON_DISCOVERABLE_XHCI_DEVICE_GUID \
> + { 0xB1BE0BC5, 0x6C28, 0x442D, {0xAA, 0x37, 0x15, 0x1B, 0x42, 0x57,
> +0xBD, 0x78 } }
> +
> +
> +extern EFI_GUID gEdkiiNonDiscoverableAhciDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableAmbaDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableEhciDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableNvmeDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableOhciDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableSdhciDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableUfsDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableUhciDeviceGuid;
> +extern EFI_GUID gEdkiiNonDiscoverableXhciDeviceGuid;
> +
> +#endif
> diff --git a/MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h
> b/MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h
> new file mode 100644
> index 000000000000..976ae8387376
> --- /dev/null
> +++ b/MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h
> @@ -0,0 +1,77 @@
> +/** @file
> + Protocol to describe devices that are not on a discoverable bus
> +
> + Copyright (c) 2016, Linaro, Ltd. All rights reserved.<BR>
> +
> + 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 __NON_DISCOVERABLE_DEVICE_H__
> +#define __NON_DISCOVERABLE_DEVICE_H__
> +
> +#include <IndustryStandard/Acpi.h>
> +
> +#define EDKII_NON_DISCOVERABLE_DEVICE_PROTOCOL_GUID \
> + { 0x0d51905b, 0xb77e, 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d,
> +0x51, 0x4a } }
> +
> +//
> +// Protocol interface structure
> +//
> +typedef struct _NON_DISCOVERABLE_DEVICE
> NON_DISCOVERABLE_DEVICE;
> +
> +//
> +// Data Types
> +//
> +typedef enum {
> + NonDiscoverableDeviceDmaTypeCoherent,
> + NonDiscoverableDeviceDmaTypeNonCoherent,
> + NonDiscoverableDeviceDmaTypeMax,
> +} NON_DISCOVERABLE_DEVICE_DMA_TYPE;
> +
> +//
> +// Function Prototypes
> +//
> +
> +/**
> + Perform device specific initialization before the device is started
> +
> + @param This The non-discoverable device protocol pointer
> +
> + @retval EFI_SUCCESS Initialization successful, the device may be used
> + @retval Other Initialization failed, device should not be started
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *NON_DISCOVERABLE_DEVICE_INIT) (
> + IN NON_DISCOVERABLE_DEVICE *This
> + );
> +
> +struct _NON_DISCOVERABLE_DEVICE {
> + //
> + // The type of device
> + //
> + CONST EFI_GUID *Type;
> + //
> + // Whether this device is DMA coherent
> + //
> + NON_DISCOVERABLE_DEVICE_DMA_TYPE DmaType;
> + //
> + // Initialization function for the device
> + //
> + NON_DISCOVERABLE_DEVICE_INIT Initialize;
> + //
> + // The MMIO and I/O regions owned by the device
> + //
> + EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Resources;
> +};
> +
> +extern EFI_GUID gEdkiiNonDiscoverableDeviceProtocolGuid;
> +
> +#endif
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec index 22898e3f7487..588f5e97dbc2
> 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -362,6 +362,17 @@ [Guids]
> ## Include/Guid/PiSmmMemoryAttributesTable.h
> gEdkiiPiSmmMemoryAttributesTableGuid = { 0x6b9fd3f7, 0x16df, 0x45e8,
> {0xbd, 0x39, 0xb9, 0x4a, 0x66, 0x54, 0x1a, 0x5d}}
>
> + ## Include/Guid/NonDiscoverableDevice.h
> + gEdkiiNonDiscoverableAhciDeviceGuid = { 0xC7D35798, 0xE4D2, 0x4A93,
> + {0xB1, 0x45, 0x54, 0x88, 0x9F, 0x02, 0x58, 0x4B } }
> + gEdkiiNonDiscoverableAmbaDeviceGuid = { 0x94440339, 0xCC93, 0x4506,
> + {0xB4, 0xC6, 0xEE, 0x8D, 0x0F, 0x4C, 0xA1, 0x91 } }
> + gEdkiiNonDiscoverableEhciDeviceGuid = { 0xEAEE5615, 0x0CFD, 0x45FC,
> + {0x87, 0x69, 0xA0, 0xD8, 0x56, 0x95, 0xAF, 0x85 } }
> + gEdkiiNonDiscoverableNvmeDeviceGuid = { 0xC5F25542, 0x2A79, 0x4A26,
> + {0x81, 0xBB, 0x4E, 0xA6, 0x32, 0x33, 0xB3, 0x09 } }
> + gEdkiiNonDiscoverableOhciDeviceGuid = { 0xB20005B0, 0xBB2D, 0x496F,
> + {0x86, 0x9C, 0x23, 0x0B, 0x44, 0x79, 0xE7, 0xD1 } }
> + gEdkiiNonDiscoverableSdhciDeviceGuid = { 0x1DD1D619, 0xF9B8, 0x463E,
> + {0x86, 0x81, 0xD1, 0xDC, 0x7C, 0x07, 0xB7, 0x2C } }
> + gEdkiiNonDiscoverableUfsDeviceGuid = { 0x2EA77912, 0x80A8, 0x4947,
> + {0xBE, 0x69, 0xCD, 0xD0, 0x0A, 0xFB, 0xE5, 0x56 } }
> + gEdkiiNonDiscoverableUhciDeviceGuid = { 0xA8CDA0A2, 0x4F37, 0x4A1B,
> + {0x8E, 0x10, 0x8E, 0xF3, 0xCC, 0x3B, 0xF3, 0xA8 } }
> + gEdkiiNonDiscoverableXhciDeviceGuid = { 0xB1BE0BC5, 0x6C28, 0x442D,
> + {0xAA, 0x37, 0x15, 0x1B, 0x42, 0x57, 0xBD, 0x78 } }
> +
> [Ppis]
> ## Include/Ppi/AtaController.h
> gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a,
> 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
> @@ -512,6 +523,9 @@ [Protocols]
> # Include/Protocol/Ps2Policy.h
> gEfiPs2PolicyProtocolGuid = { 0x4DF19259, 0xDC71, 0x4D46, { 0xBE, 0xF1,
> 0x35, 0x7B, 0xB5, 0x78, 0xC4, 0x18 } }
>
> + ## Include/Protocol/NonDiscoverableDevice.h
> + gEdkiiNonDiscoverableDeviceProtocolGuid = { 0x0d51905b, 0xb77e,
> + 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d, 0x51, 0x4a } }
> +
> #
> # [Error.gEfiMdeModulePkgTokenSpaceGuid]
> # 0x80000001 | Invalid value provided.
> --
> 2.7.4
next prev parent reply other threads:[~2016-11-28 1:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 15:42 [PATCH v4 0/5] MdeModulePkg: add support for non-discoverable devices Ard Biesheuvel
2016-11-25 15:42 ` [PATCH v4 1/5] MdeModulePkg: introduce non-discoverable device protocol Ard Biesheuvel
2016-11-28 1:57 ` Ni, Ruiyu [this message]
2016-11-25 15:42 ` [PATCH v4 2/5] MdeModulePkg: introduce helper library to register non-discoverable devices Ard Biesheuvel
2016-11-28 1:58 ` Ni, Ruiyu
2016-11-25 15:42 ` [PATCH v4 3/5] MdeModulePkg: implement generic PCI I/O driver for " Ard Biesheuvel
2016-11-28 1:56 ` Ni, Ruiyu
2016-11-30 14:06 ` Leif Lindholm
2016-12-02 10:09 ` Leif Lindholm
2016-12-02 12:54 ` Ni, Ruiyu
2016-12-02 14:40 ` Leif Lindholm
2016-12-02 15:07 ` Ard Biesheuvel
2016-12-02 15:56 ` Leif Lindholm
2016-12-02 18:42 ` Ard Biesheuvel
2016-12-05 9:35 ` Leif Lindholm
2016-11-25 15:42 ` [PATCH v4 4/5] MdeModulePkg/NonDiscoverablePciDeviceDxe: add support for non-coherent DMA Ard Biesheuvel
2016-11-28 2:25 ` Ni, Ruiyu
2016-11-25 15:42 ` [PATCH v4 5/5] Omap35xxPkg/PciEmulation: port to new non-discoverable device infrastructure Ard Biesheuvel
2016-11-27 10:18 ` [PATCH v4 0/5] MdeModulePkg: add support for non-discoverable devices Marcin Wojtas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=734D49CCEBEEF84792F5B80ED585239D58E8CFE0@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox