]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / XhciPei / XhcPeim.c
index 99f69f730b3fe4d052b24ba79db75e16a9157629..4b670ebedf6e24acafd59299cb3fdc11e3f77ed3 100644 (file)
@@ -2,16 +2,9 @@
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid\r
 which is used to enable recovery function from USB Drivers.\r
 \r
-Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
 \r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions\r
-of the BSD License which accompanies this distribution.  The\r
-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
@@ -211,29 +204,7 @@ XhcPeiReadCapRegister (
   return Data;\r
 }\r
 \r
-/**\r
-  Read XHCI door bell register.\r
-\r
-  @param  Xhc       The XHCI device.\r
-  @param  Offset    The offset of the door bell register.\r
-\r
-  @return The register content read\r
 \r
-**/\r
-UINT32\r
-XhcPeiReadDoorBellReg (\r
-  IN  PEI_XHC_DEV       *Xhc,\r
-  IN  UINT32            Offset\r
-  )\r
-{\r
-  UINT32                  Data;\r
-\r
-  ASSERT (Xhc->DBOff != 0);\r
-\r
-  Data = MmioRead32 (Xhc->UsbHostControllerBaseAddress + Xhc->DBOff + Offset);\r
-\r
-  return Data;\r
-}\r
 \r
 /**\r
   Write the data to the XHCI door bell register.\r
@@ -1339,7 +1310,8 @@ XhcPeiGetRootHubPortStatus (
   DEBUG ((EFI_D_INFO, "XhcPeiGetRootHubPortStatus: Port: %x State: %x\n", PortNumber, State));\r
 \r
   //\r
-  // According to XHCI 1.0 spec, bit 10~13 of the root port status register identifies the speed of the attached device.\r
+  // According to XHCI 1.1 spec November 2017,\r
+  // bit 10~13 of the root port status register identifies the speed of the attached device.\r
   //\r
   switch ((State & XHC_PORTSC_PS) >> 10) {\r
     case 2:\r
@@ -1351,6 +1323,7 @@ XhcPeiGetRootHubPortStatus (
       break;\r
 \r
     case 4:\r
+    case 5:\r
       PortStatus->PortStatus |= USB_PORT_STAT_SUPER_SPEED;\r
       break;\r
 \r
@@ -1427,6 +1400,8 @@ XhcEndOfPei (
 \r
   XhcPeiHaltHC (Xhc, XHC_GENERIC_TIMEOUT);\r
 \r
+  XhcPeiFreeSched (Xhc);\r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -1461,8 +1436,6 @@ XhcPeimEntry (
     return EFI_SUCCESS;\r
   }\r
 \r
-  IoMmuInit ();\r
-\r
   Status = PeiServicesLocatePpi (\r
              &gPeiUsbControllerPpiGuid,\r
              0,\r
@@ -1473,6 +1446,8 @@ XhcPeimEntry (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
+  IoMmuInit ();\r
+\r
   Index = 0;\r
   while (TRUE) {\r
     Status = UsbControllerPpi->GetUsbController (\r