The XHCI register operation routines.\r
\r
Copyright (c) 2011 - 2017, 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
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
return XHC_REG_BIT_IS_SET (Xhc, XHC_USBSTS_OFFSET, XHC_USBSTS_HSE);\r
}\r
\r
+/**\r
+ Set USBCMD Host System Error Enable(HSEE) Bit if PCICMD SERR# Enable Bit is set.\r
+\r
+ The USBCMD HSEE Bit will be reset to default 0 by USBCMD Host Controller Reset(HCRST).\r
+ This function is to set USBCMD HSEE Bit if PCICMD SERR# Enable Bit is set.\r
+\r
+ @param Xhc The XHCI Instance.\r
+\r
+**/\r
+VOID\r
+XhcSetHsee (\r
+ IN USB_XHCI_INSTANCE *Xhc\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_PCI_IO_PROTOCOL *PciIo;\r
+ UINT16 XhciCmd;\r
+\r
+ PciIo = Xhc->PciIo;\r
+ Status = PciIo->Pci.Read (\r
+ PciIo,\r
+ EfiPciIoWidthUint16,\r
+ PCI_COMMAND_OFFSET,\r
+ sizeof (XhciCmd) / sizeof (UINT16),\r
+ &XhciCmd\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ if ((XhciCmd & EFI_PCI_COMMAND_SERR) != 0) {\r
+ XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_HSEE);\r
+ }\r
+ }\r
+}\r
+\r
/**\r
Reset the XHCI host controller.\r
\r
//\r
gBS->Stall (XHC_1_MILLISECOND);\r
Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout);\r
+\r
+ if (!EFI_ERROR (Status)) {\r
+ //\r
+ // The USBCMD HSEE Bit will be reset to default 0 by USBCMD HCRST.\r
+ // Set USBCMD HSEE Bit if PCICMD SERR# Enable Bit is set.\r
+ //\r
+ XhcSetHsee (Xhc);\r
+ }\r
}\r
\r
return Status;\r