]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Internal.h
SourceLevelDebugPkg DebugUsb3: Re-Support IOMMU
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugCommunicationLibUsb3 / DebugCommunicationLibUsb3Internal.h
index 356485c5f6973fa0150406a7b56115d9ab8a19ab..8673dad6c55e72cc7fd6a4ee1b0e9a1e53930133 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Debug Port Library implementation based on usb3 debug port.\r
 \r
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 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
@@ -46,6 +46,7 @@
 #define USB3DBG_DBG_CAB       1   // The XHCI host controller supports debug capability\r
 #define USB3DBG_ENABLED       2   // The XHCI debug device is enabled\r
 #define USB3DBG_NOT_ENABLED   4   // The XHCI debug device is not enabled\r
+#define USB3DBG_UNINITIALIZED 255 // The XHCI debug device is uninitialized\r
 \r
 #define USB3_DEBUG_PORT_WRITE_MAX_PACKET_SIZE 0x08\r
 \r
@@ -456,7 +457,7 @@ typedef struct _USB3_DEBUG_PORT_INSTANCE {
   UINT8                                   Initialized;\r
 \r
   //\r
-  // The flag indicates debug device is ready\r
+  // The flag indicates debug capability is supported\r
   //\r
   BOOLEAN                                 DebugSupport;\r
   \r
@@ -465,6 +466,21 @@ typedef struct _USB3_DEBUG_PORT_INSTANCE {
   //\r
   BOOLEAN                                 Ready;\r
 \r
+  //\r
+  // The flag indicates the instance is from HOB\r
+  //\r
+  BOOLEAN                                 FromHob;\r
+\r
+  //\r
+  // Prevent notification being interrupted by debug timer\r
+  //\r
+  BOOLEAN                                 InNotify;\r
+\r
+  //\r
+  // PciIo protocol event\r
+  //\r
+  EFI_PHYSICAL_ADDRESS                    PciIoEvent;\r
+\r
   //\r
   // The flag indicates if USB 3.0 ports has been turn off/on power\r
   //  \r
@@ -540,7 +556,7 @@ typedef struct _USB3_DEBUG_PORT_INSTANCE {
 UINT32\r
 XhcReadDebugReg (\r
   IN  USB3_DEBUG_PORT_HANDLE    *Handle,\r
-  IN  UINT32                      Offset\r
+  IN  UINT32                    Offset\r
   );\r
 \r
 /**\r
@@ -554,8 +570,8 @@ XhcReadDebugReg (
 VOID\r
 XhcSetDebugRegBit (\r
   IN USB3_DEBUG_PORT_HANDLE  *Handle,\r
-  IN UINT32                   Offset,\r
-  IN UINT32                   Bit\r
+  IN UINT32                  Offset,\r
+  IN UINT32                  Bit\r
   );\r
   \r
 /**\r
@@ -573,43 +589,6 @@ XhcWriteDebugReg (
   IN UINT32                     Data\r
   );\r
 \r
-/**\r
-  Discover the USB3 debug device.\r
-  \r
-  @param  Handle                Debug port handle.\r
-  \r
-  @retval RETURN_SUCCESS        The serial device was initialized.\r
-  @retval RETURN_DEVICE_ERROR   The serial device could not be initialized.\r
-\r
-**/\r
-RETURN_STATUS\r
-DiscoverUsb3DebugPort(\r
-  USB3_DEBUG_PORT_HANDLE  *Handle\r
-  );\r
-  \r
-/**\r
-  Initialize the Serial Device hardware.\r
-  \r
-  @param  Handle            Debug port handle.\r
-\r
-  @retval RETURN_SUCCESS    The serial device was initialized successfully.\r
-  @retval !RETURN_SUCCESS   Error.\r
-\r
-**/\r
-RETURN_STATUS\r
-InitializeUsb3DebugPort (\r
-  USB3_DEBUG_PORT_HANDLE  *Handle\r
-  );\r
-\r
-/**\r
-  Return XHCI MMIO base address.\r
-\r
-**/\r
-EFI_PHYSICAL_ADDRESS\r
-GetXhciBaseAddress (\r
-  VOID\r
-  );\r
-\r
 /**\r
   Verifies if the bit positions specified by a mask are set in a register.\r
 \r
@@ -728,4 +707,37 @@ XhcDataTransfer (
   IN     UINTN                               Timeout\r
   );\r
 \r
+/**\r
+  Initialize usb debug port hardware.\r
+\r
+  @param  Handle           Debug port handle.\r
+\r
+  @retval TRUE             The usb debug port hardware configuration is changed.\r
+  @retval FALSE            The usb debug port hardware configuration is not changed.\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+InitializeUsbDebugHardware (\r
+  IN USB3_DEBUG_PORT_HANDLE *Handle\r
+  );\r
+\r
+/**\r
+  Return USB3 debug instance address pointer.\r
+\r
+**/  \r
+EFI_PHYSICAL_ADDRESS *\r
+GetUsb3DebugPortInstanceAddrPtr (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Return USB3 debug instance address.\r
+\r
+**/  \r
+USB3_DEBUG_PORT_HANDLE *\r
+GetUsb3DebugPortInstance (\r
+  VOID\r
+  );\r
+\r
 #endif //__SERIAL_PORT_LIB_USB__\r