]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeMoMdeMdeModulePkg/EhciPei: By default power on all root ports of EHCI host control...
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 18 Jun 2012 06:25:34 +0000 (06:25 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 18 Jun 2012 06:25:34 +0000 (06:25 +0000)
Signed-off-by: Tian Feng <feng.tian@intel.com>
Reviewed-by: Sun Rui <rui.sun@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13460 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c

index 6c179b093584f459273edff1e5171227427c1feb..cefdf099159bd57f6ecf683ef4ca5fd29dfab8a7 100644 (file)
@@ -2,7 +2,7 @@
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid\r
 which is used to enable recovery function from USB Drivers.\r
 \r
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2012, 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
@@ -400,6 +400,26 @@ EhcRunHC (
   return Status;\r
 }\r
 \r
+/**\r
+  Power On All EHCI Ports.\r
+  \r
+  @param  Ehc             The EHCI device.\r
+\r
+**/\r
+VOID\r
+EhcPowerOnAllPorts (\r
+  IN PEI_USB2_HC_DEV          *Ehc\r
+  )\r
+{\r
+  UINT8 PortNumber;\r
+  UINT8 Index;\r
+\r
+  PortNumber = (UINT8)(Ehc->HcStructParams & HCSP_NPORTS);\r
+  for (Index = 0; Index < PortNumber; Index++) {\r
+    EhcSetOpRegBit (Ehc, EHC_PORT_STAT_OFFSET + 4 * Index, PORTSC_POWER);\r
+  }\r
+}\r
+\r
 /**\r
   Initialize the HC hardware. \r
   EHCI spec lists the five things to do to initialize the hardware.\r
@@ -443,6 +463,9 @@ EhcInitHC (
   if (Ehc->Urb  == NULL) {\r
     return Status;\r
   }\r
+\r
+  EhcPowerOnAllPorts (Ehc);  \r
+  MicroSecondDelay (EHC_ROOT_PORT_RECOVERY_STALL);\r
   \r
   Status = EhcInitSched (Ehc);\r
 \r