}\r
}\r
\r
-/**\r
- Write the data to the 2-bytes width XHCI operational register.\r
\r
- @param Xhc The XHCI Instance.\r
- @param Offset The offset of the 2-bytes width operational register.\r
- @param Data The data to write.\r
\r
-**/\r
-VOID\r
-XhcWriteOpReg16 (\r
- IN USB_XHCI_INSTANCE *Xhc,\r
- IN UINT32 Offset,\r
- IN UINT16 Data\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- ASSERT (Xhc->CapLength != 0);\r
-\r
- Status = Xhc->PciIo->Mem.Write (\r
- Xhc->PciIo,\r
- EfiPciIoWidthUint16,\r
- XHC_BAR_INDEX,\r
- Xhc->CapLength + Offset,\r
- 1,\r
- &Data\r
- );\r
-\r
- if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "XhcWriteOpReg16: Pci Io Write error: %r at %d\n", Status, Offset));\r
- }\r
-}\r
-\r
-/**\r
- Read XHCI door bell register.\r
-\r
- @param Xhc The XHCI Instance.\r
- @param Offset The offset of the door bell register.\r
\r
- @return The register content read\r
-\r
-**/\r
-UINT32\r
-XhcReadDoorBellReg (\r
- IN USB_XHCI_INSTANCE *Xhc,\r
- IN UINT32 Offset\r
- )\r
-{\r
- UINT32 Data;\r
- EFI_STATUS Status;\r
-\r
- ASSERT (Xhc->DBOff != 0);\r
-\r
- Status = Xhc->PciIo->Mem.Read (\r
- Xhc->PciIo,\r
- EfiPciIoWidthUint32,\r
- XHC_BAR_INDEX,\r
- Xhc->DBOff + Offset,\r
- 1,\r
- &Data\r
- );\r
-\r
- if (EFI_ERROR (Status)) {\r
- DEBUG ((EFI_D_ERROR, "XhcReadDoorBellReg: Pci Io Read error - %r at %d\n", Status, Offset));\r
- Data = 0xFFFFFFFF;\r
- }\r
-\r
- return Data;\r
-}\r
\r
/**\r
Write the data to the XHCI door bell register.\r
IN UINT32 Data\r
);\r
\r
-/**\r
- Write the data to the 2-bytes width XHCI operational register.\r
-\r
- @param Xhc The XHCI Instance.\r
- @param Offset The offset of the 2-bytes width operational register.\r
- @param Data The data to write.\r
-\r
-**/\r
-VOID\r
-XhcWriteOpReg16 (\r
- IN USB_XHCI_INSTANCE *Xhc,\r
- IN UINT32 Offset,\r
- IN UINT16 Data\r
- );\r
\r
/**\r
Read XHCI runtime register.\r
IN UINT32 Data\r
);\r
\r
-/**\r
- Read XHCI door bell register.\r
-\r
- @param Xhc The XHCI Instance.\r
- @param Offset The offset of the door bell register.\r
-\r
- @return The register content read\r
-\r
-**/\r
-UINT32\r
-XhcReadDoorBellReg (\r
- IN USB_XHCI_INSTANCE *Xhc,\r
- IN UINT32 Offset\r
- );\r
\r
/**\r
Write the data to the XHCI door bell register.\r