MdeModulePkg: introduce non-discoverable device protocol
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 31 Oct 2016 14:54:56 +0000 (14:54 +0000)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 7 Dec 2016 09:01:27 +0000 (09:01 +0000)
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>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
MdeModulePkg/Include/Guid/NonDiscoverableDevice.h [new file with mode: 0644]
MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h [new file with mode: 0644]
MdeModulePkg/MdeModulePkg.dec

diff --git a/MdeModulePkg/Include/Guid/NonDiscoverableDevice.h b/MdeModulePkg/Include/Guid/NonDiscoverableDevice.h
new file mode 100644 (file)
index 0000000..d182e4b
--- /dev/null
@@ -0,0 +1,58 @@
+/** @file\r
+  GUIDs to identify devices that are not on a discoverable bus but can be\r
+  controlled by a standard class driver\r
+\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_GUID_H__\r
+#define __NON_DISCOVERABLE_DEVICE_GUID_H__\r
+\r
+#define EDKII_NON_DISCOVERABLE_AHCI_DEVICE_GUID \\r
+  { 0xC7D35798, 0xE4D2, 0x4A93, {0xB1, 0x45, 0x54, 0x88, 0x9F, 0x02, 0x58, 0x4B } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_AMBA_DEVICE_GUID \\r
+  { 0x94440339, 0xCC93, 0x4506, {0xB4, 0xC6, 0xEE, 0x8D, 0x0F, 0x4C, 0xA1, 0x91 } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_EHCI_DEVICE_GUID \\r
+  { 0xEAEE5615, 0x0CFD, 0x45FC, {0x87, 0x69, 0xA0, 0xD8, 0x56, 0x95, 0xAF, 0x85 } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_NVME_DEVICE_GUID \\r
+  { 0xC5F25542, 0x2A79, 0x4A26, {0x81, 0xBB, 0x4E, 0xA6, 0x32, 0x33, 0xB3, 0x09 } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_OHCI_DEVICE_GUID \\r
+  { 0xB20005B0, 0xBB2D, 0x496F, {0x86, 0x9C, 0x23, 0x0B, 0x44, 0x79, 0xE7, 0xD1 } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_SDHCI_DEVICE_GUID \\r
+  { 0x1DD1D619, 0xF9B8, 0x463E, {0x86, 0x81, 0xD1, 0xDC, 0x7C, 0x07, 0xB7, 0x2C } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_UFS_DEVICE_GUID \\r
+  { 0x2EA77912, 0x80A8, 0x4947, {0xBE, 0x69, 0xCD, 0xD0, 0x0A, 0xFB, 0xE5, 0x56 } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_UHCI_DEVICE_GUID \\r
+  { 0xA8CDA0A2, 0x4F37, 0x4A1B, {0x8E, 0x10, 0x8E, 0xF3, 0xCC, 0x3B, 0xF3, 0xA8 } }\r
+\r
+#define EDKII_NON_DISCOVERABLE_XHCI_DEVICE_GUID \\r
+  { 0xB1BE0BC5, 0x6C28, 0x442D, {0xAA, 0x37, 0x15, 0x1B, 0x42, 0x57, 0xBD, 0x78 } }\r
+\r
+\r
+extern EFI_GUID gEdkiiNonDiscoverableAhciDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableAmbaDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableEhciDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableNvmeDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableOhciDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableSdhciDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableUfsDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableUhciDeviceGuid;\r
+extern EFI_GUID gEdkiiNonDiscoverableXhciDeviceGuid;\r
+\r
+#endif\r
diff --git a/MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h b/MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h
new file mode 100644 (file)
index 0000000..976ae83
--- /dev/null
@@ -0,0 +1,77 @@
+/** @file\r
+  Protocol to describe devices that are not on a discoverable bus\r
+\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_H__\r
+#define __NON_DISCOVERABLE_DEVICE_H__\r
+\r
+#include <IndustryStandard/Acpi.h>\r
+\r
+#define EDKII_NON_DISCOVERABLE_DEVICE_PROTOCOL_GUID \\r
+  { 0x0d51905b, 0xb77e, 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d, 0x51, 0x4a } }\r
+\r
+//\r
+// Protocol interface structure\r
+//\r
+typedef struct _NON_DISCOVERABLE_DEVICE NON_DISCOVERABLE_DEVICE;\r
+\r
+//\r
+// Data Types\r
+//\r
+typedef enum {\r
+  NonDiscoverableDeviceDmaTypeCoherent,\r
+  NonDiscoverableDeviceDmaTypeNonCoherent,\r
+  NonDiscoverableDeviceDmaTypeMax,\r
+} NON_DISCOVERABLE_DEVICE_DMA_TYPE;\r
+\r
+//\r
+// Function Prototypes\r
+//\r
+\r
+/**\r
+  Perform device specific initialization before the device is started\r
+\r
+  @param  This          The non-discoverable device protocol pointer\r
+\r
+  @retval EFI_SUCCESS   Initialization successful, the device may be used\r
+  @retval Other         Initialization failed, device should not be started\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *NON_DISCOVERABLE_DEVICE_INIT) (\r
+  IN  NON_DISCOVERABLE_DEVICE       *This\r
+  );\r
+\r
+struct _NON_DISCOVERABLE_DEVICE {\r
+  //\r
+  // The type of device\r
+  //\r
+  CONST EFI_GUID                      *Type;\r
+  //\r
+  // Whether this device is DMA coherent\r
+  //\r
+  NON_DISCOVERABLE_DEVICE_DMA_TYPE    DmaType;\r
+  //\r
+  // Initialization function for the device\r
+  //\r
+  NON_DISCOVERABLE_DEVICE_INIT        Initialize;\r
+  //\r
+  // The MMIO and I/O regions owned by the device\r
+  //\r
+  EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR   *Resources;\r
+};\r
+\r
+extern EFI_GUID gEdkiiNonDiscoverableDeviceProtocolGuid;\r
+\r
+#endif\r
index 7cffcae50a833a7c2729fbdc4f5d90ef3ce6a5d6..abd5da5daa0cab936180e0bd44d087f11163858f 100644 (file)
   ## Include/Guid/PiSmmMemoryAttributesTable.h\r
   gEdkiiPiSmmMemoryAttributesTableGuid = { 0x6b9fd3f7, 0x16df, 0x45e8, {0xbd, 0x39, 0xb9, 0x4a, 0x66, 0x54, 0x1a, 0x5d}}\r
 \r
+  ## Include/Guid/NonDiscoverableDevice.h\r
+  gEdkiiNonDiscoverableAhciDeviceGuid = { 0xC7D35798, 0xE4D2, 0x4A93, {0xB1, 0x45, 0x54, 0x88, 0x9F, 0x02, 0x58, 0x4B } }\r
+  gEdkiiNonDiscoverableAmbaDeviceGuid = { 0x94440339, 0xCC93, 0x4506, {0xB4, 0xC6, 0xEE, 0x8D, 0x0F, 0x4C, 0xA1, 0x91 } }\r
+  gEdkiiNonDiscoverableEhciDeviceGuid = { 0xEAEE5615, 0x0CFD, 0x45FC, {0x87, 0x69, 0xA0, 0xD8, 0x56, 0x95, 0xAF, 0x85 } }\r
+  gEdkiiNonDiscoverableNvmeDeviceGuid = { 0xC5F25542, 0x2A79, 0x4A26, {0x81, 0xBB, 0x4E, 0xA6, 0x32, 0x33, 0xB3, 0x09 } }\r
+  gEdkiiNonDiscoverableOhciDeviceGuid = { 0xB20005B0, 0xBB2D, 0x496F, {0x86, 0x9C, 0x23, 0x0B, 0x44, 0x79, 0xE7, 0xD1 } }\r
+  gEdkiiNonDiscoverableSdhciDeviceGuid = { 0x1DD1D619, 0xF9B8, 0x463E, {0x86, 0x81, 0xD1, 0xDC, 0x7C, 0x07, 0xB7, 0x2C } }\r
+  gEdkiiNonDiscoverableUfsDeviceGuid = { 0x2EA77912, 0x80A8, 0x4947, {0xBE, 0x69, 0xCD, 0xD0, 0x0A, 0xFB, 0xE5, 0x56 } }\r
+  gEdkiiNonDiscoverableUhciDeviceGuid = { 0xA8CDA0A2, 0x4F37, 0x4A1B, {0x8E, 0x10, 0x8E, 0xF3, 0xCC, 0x3B, 0xF3, 0xA8 } }\r
+  gEdkiiNonDiscoverableXhciDeviceGuid = { 0xB1BE0BC5, 0x6C28, 0x442D, {0xAA, 0x37, 0x15, 0x1B, 0x42, 0x57, 0xBD, 0x78 } }\r
+\r
 [Ppis]\r
   ## Include/Ppi/AtaController.h\r
   gPeiAtaControllerPpiGuid       = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}\r
   #  Include/Protocol/Ps2Policy.h\r
   gEfiPs2PolicyProtocolGuid = { 0x4DF19259, 0xDC71, 0x4D46, { 0xBE, 0xF1, 0x35, 0x7B, 0xB5, 0x78, 0xC4, 0x18 } }\r
 \r
+  ## Include/Protocol/NonDiscoverableDevice.h\r
+  gEdkiiNonDiscoverableDeviceProtocolGuid = { 0x0d51905b, 0xb77e, 0x452a, {0xa2, 0xc0, 0xec, 0xa0, 0xcc, 0x8d, 0x51, 0x4a } }\r
+\r
 #\r
 # [Error.gEfiMdeModulePkgTokenSpaceGuid]\r
 #   0x80000001 | Invalid value provided.\r