]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Ppi/NvmExpressHostController.h
MdeModulePkg: Add definitions for EDKII PEI NVME host controller PPI
[mirror_edk2.git] / MdeModulePkg / Include / Ppi / NvmExpressHostController.h
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