]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Ppi/AtaAhciController.h
MdeModulePkg: Add definitions for ATA AHCI host controller PPI
[mirror_edk2.git] / MdeModulePkg / Include / Ppi / AtaAhciController.h
diff --git a/MdeModulePkg/Include/Ppi/AtaAhciController.h b/MdeModulePkg/Include/Ppi/AtaAhciController.h
new file mode 100644 (file)
index 0000000..2bdd53f
--- /dev/null
@@ -0,0 +1,89 @@
+/** @file\r
+\r
+  Copyright (c) 2019, 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_ATA_AHCI_HOST_CONTROLLER_PPI_H_\r
+#define _EDKII_ATA_AHCI_HOST_CONTROLLER_PPI_H_\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+///\r
+/// Global ID for the EDKII_ATA_AHCI_HOST_CONTROLLER_PPI.\r
+///\r
+#define EDKII_ATA_AHCI_HOST_CONTROLLER_PPI_GUID \\r
+  { \\r
+    0x61dd33ea, 0x421f, 0x4cc0, { 0x89, 0x29, 0xff, 0xee, 0xa9, 0xa1, 0xa2, 0x61 } \\r
+  }\r
+\r
+//\r
+// Forward declaration for the EDKII_ATA_AHCI_HOST_CONTROLLER_PPI.\r
+//\r
+typedef struct _EDKII_ATA_AHCI_HOST_CONTROLLER_PPI  EDKII_ATA_AHCI_HOST_CONTROLLER_PPI;\r
+\r
+/**\r
+  Get the MMIO base address of ATA AHCI host controller.\r
+\r
+  @param[in]  This                 The PPI instance pointer.\r
+  @param[in]  ControllerId         The ID of the ATA AHCI 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 ATA AHCI host controller not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EDKII_ATA_AHCI_HC_GET_MMIO_BAR) (\r
+  IN  EDKII_ATA_AHCI_HOST_CONTROLLER_PPI    *This,\r
+  IN  UINT8                                 ControllerId,\r
+  OUT UINTN                                 *MmioBar\r
+  );\r
+\r
+/**\r
+  Get the device path of ATA AHCI host controller.\r
+\r
+  @param[in]  This                 The PPI instance pointer.\r
+  @param[in]  ControllerId         The ID of the ATA AHCI 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 ATA AHCI 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 ATA AHCI host controller not 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_ATA_AHCI_HC_GET_DEVICE_PATH) (\r
+  IN  EDKII_ATA_AHCI_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 ATA AHCI host controller.\r
+//\r
+struct _EDKII_ATA_AHCI_HOST_CONTROLLER_PPI {\r
+  EDKII_ATA_AHCI_HC_GET_MMIO_BAR       GetAhciHcMmioBar;\r
+  EDKII_ATA_AHCI_HC_GET_DEVICE_PATH    GetAhciHcDevicePath;\r
+};\r
+\r
+extern EFI_GUID gEdkiiPeiAtaAhciHostControllerPpiGuid;\r
+\r
+#endif\r