]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Include/Library/NonDiscoverableDeviceRegistrationLib.h
MdeModulePkg: introduce helper library to register non-discoverable devices
[mirror_edk2.git] / MdeModulePkg / Include / Library / NonDiscoverableDeviceRegistrationLib.h
diff --git a/MdeModulePkg/Include/Library/NonDiscoverableDeviceRegistrationLib.h b/MdeModulePkg/Include/Library/NonDiscoverableDeviceRegistrationLib.h
new file mode 100644 (file)
index 0000000..120d914
--- /dev/null
@@ -0,0 +1,62 @@
+/** @file\r
+  Copyright (c) 2016, Linaro, Ltd. All rights reserved.<BR>\r
+\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 __NON_DISCOVERABLE_DEVICE_REGISTRATION_LIB_H__\r
+#define __NON_DISCOVERABLE_DEVICE_REGISTRATION_LIB_H__\r
+\r
+#include <Protocol/NonDiscoverableDevice.h>\r
+\r
+typedef enum {\r
+  NonDiscoverableDeviceTypeAhci,\r
+  NonDiscoverableDeviceTypeAmba,\r
+  NonDiscoverableDeviceTypeEhci,\r
+  NonDiscoverableDeviceTypeNvme,\r
+  NonDiscoverableDeviceTypeOhci,\r
+  NonDiscoverableDeviceTypeSdhci,\r
+  NonDiscoverableDeviceTypeUfs,\r
+  NonDiscoverableDeviceTypeUhci,\r
+  NonDiscoverableDeviceTypeXhci,\r
+  NonDiscoverableDeviceTypeMax,\r
+} NON_DISCOVERABLE_DEVICE_TYPE;\r
+\r
+/**\r
+  Register a non-discoverable MMIO device\r
+\r
+  @param[in]      DeviceType          The type of non-discoverable device\r
+  @param[in]      DmaType             Whether the device is DMA coherent\r
+  @param[in]      InitFunc            Initialization routine to be invoked when\r
+                                      the device is enabled\r
+  @param[in,out]  Handle              The handle onto which to install the\r
+                                      non-discoverable device protocol.\r
+                                      If Handle is NULL or *Handle is NULL, a\r
+                                      new handle will be allocated.\r
+  @param[in]      NumMmioResources    The number of UINTN base/size pairs that\r
+                                      follow, each describing an MMIO region\r
+                                      owned by the device\r
+\r
+  @retval EFI_SUCCESS                 The registration succeeded.\r
+  @retval Other                       The registration failed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+RegisterNonDiscoverableMmioDevice (\r
+  IN      NON_DISCOVERABLE_DEVICE_TYPE      Type,\r
+  IN      NON_DISCOVERABLE_DEVICE_DMA_TYPE  DmaType,\r
+  IN      NON_DISCOVERABLE_DEVICE_INIT      InitFunc,\r
+  IN OUT  EFI_HANDLE                        *Handle OPTIONAL,\r
+  IN      UINTN                             NumMmioResources,\r
+  ...\r
+  );\r
+\r
+#endif\r