]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Add definitions for EDKII PEI NVME host controller PPI
authorHao Wu <hao.a.wu@intel.com>
Wed, 2 May 2018 06:12:12 +0000 (14:12 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 25 Jun 2018 01:13:12 +0000 (09:13 +0800)
Introduces the below PPI:

struct EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI {
  EDKII_NVM_EXPRESS_HC_GET_MMIO_BAR       GetNvmeHcMmioBar;
  EDKII_NVM_EXPRESS_HC_GET_DEVICE_PATH    GetNvmeHcDevicePath;
};

The GetNvmeHcMmioBar service will provide the caller with the MMIO BAR
address of each NVMe HC within the system;

The GetNvmeHcDevicePath service will provide the caller with the device
path information of each NVMe HC.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdeModulePkg/Include/Ppi/NvmExpressHostController.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/Ppi/NvmExpressHostController.h b/MdeModulePkg/Include/Ppi/NvmExpressHostController.h
new file mode 100644 (file)
index 0000000..3e22f50
--- /dev/null
@@ -0,0 +1,92 @@
+/** @file\r
+\r
+  Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI_H_\r
+#define _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI_H_\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+///\r
+/// Global ID for the EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI.\r
+///\r
+#define EDKII_NVME_EXPRESS_HOST_CONTROLLER_PPI_GUID \\r
+  { \\r
+    0xcae3aa63, 0x676f, 0x4da3, { 0xbd, 0x50, 0x6c, 0xc5, 0xed, 0xde, 0x9a, 0xad } \\r
+  }\r
+\r
+//\r
+// Forward declaration for the EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI.\r
+//\r
+typedef struct _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI  EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI;\r
+\r
+/**\r
+  Get the MMIO base address of NVM Express host controller.\r
+\r
+  @param[in]  This                 The PPI instance pointer.\r
+  @param[in]  ControllerId         The ID of the NVM Express host controller.\r
+  @param[out] MmioBar              The MMIO base address of the controller.\r
+\r
+  @retval EFI_SUCCESS              The operation succeeds.\r
+  @retval EFI_INVALID_PARAMETER    The parameters are invalid.\r
+  @retval EFI_NOT_FOUND            The specified NVM Express host controller not\r
+                                   found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_NVM_EXPRESS_HC_GET_MMIO_BAR) (\r
+  IN  EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI    *This,\r
+  IN  UINT8                                    ControllerId,\r
+  OUT UINTN                                    *MmioBar\r
+  );\r
+\r
+/**\r
+  Get the device path of NVM Express host controller.\r
+\r
+  @param[in]  This                 The PPI instance pointer.\r
+  @param[in]  ControllerId         The ID of the NVM Express host controller.\r
+  @param[out] DevicePathLength     The length of the device path in bytes specified\r
+                                   by DevicePath.\r
+  @param[out] DevicePath           The device path of NVM Express host controller.\r
+                                   This field re-uses EFI Device Path Protocol as\r
+                                   defined by Section 10.2 EFI Device Path Protocol\r
+                                   of UEFI 2.7 Specification.\r
+\r
+  @retval EFI_SUCCESS              The operation succeeds.\r
+  @retval EFI_INVALID_PARAMETER    The parameters are invalid.\r
+  @retval EFI_NOT_FOUND            The specified NVM Express host controller not\r
+                                   found.\r
+  @retval EFI_OUT_OF_RESOURCES     The operation fails due to lack of resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_NVM_EXPRESS_HC_GET_DEVICE_PATH) (\r
+  IN  EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI    *This,\r
+  IN  UINT8                                    ControllerId,\r
+  OUT UINTN                                    *DevicePathLength,\r
+  OUT EFI_DEVICE_PATH_PROTOCOL                 **DevicePath\r
+  );\r
+\r
+//\r
+// This PPI contains a set of services to interact with the NVM Express host\r
+// controller.\r
+//\r
+struct _EDKII_NVM_EXPRESS_HOST_CONTROLLER_PPI {\r
+  EDKII_NVM_EXPRESS_HC_GET_MMIO_BAR       GetNvmeHcMmioBar;\r
+  EDKII_NVM_EXPRESS_HC_GET_DEVICE_PATH    GetNvmeHcDevicePath;\r
+};\r
+\r
+extern EFI_GUID gEdkiiPeiNvmExpressHostControllerPpiGuid;\r
+\r
+#endif\r
index 3802b6e0b86a781b3e99903e472599e351addb07..8d7c97ee919b7e997fd2326cec583cff80d1b154 100644 (file)
   ## Include/Ppi/PlatformSpecificResetHandler.h\r
   gEdkiiPlatformSpecificResetHandlerPpiGuid = { 0x75cf14ae, 0x3441, 0x49dc, { 0xaa, 0x10, 0xbb, 0x35, 0xa7, 0xba, 0x8b, 0xab } }\r
 \r
+  ## Include/Ppi/NvmExpressHostController.h\r
+  gEdkiiPeiNvmExpressHostControllerPpiGuid  = { 0xcae3aa63, 0x676f, 0x4da3, { 0xbd, 0x50, 0x6c, 0xc5, 0xed, 0xde, 0x9a, 0xad } }\r
+\r
 [Protocols]\r
   ## Load File protocol provides capability to load and unload EFI image into memory and execute it.\r
   #  Include/Protocol/LoadPe32Image.h\r