summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2012-06-18 06:25:34 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2012-06-18 06:25:34 +0000
commit23b0b155262644f0514b13d5c8f23f310e33d75b (patch)
treedbad4c606a798a32b4a2c1d36bec750a8b0186a1 /MdeModulePkg
parentaf3a71b85b1810be7b9a6e0ec5a85b698473e636 (diff)
downloadedk2-platforms-23b0b155262644f0514b13d5c8f23f310e33d75b.tar.xz
MdeMoMdeMdeModulePkg/EhciPei: By default power on all root ports of EHCI host controller for recovery path
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
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c
index 6c179b0935..cefdf09915 100644
--- a/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c
+++ b/MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c
@@ -2,7 +2,7 @@
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid
which is used to enable recovery function from USB Drivers.
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -401,6 +401,26 @@ EhcRunHC (
}
/**
+ Power On All EHCI Ports.
+
+ @param Ehc The EHCI device.
+
+**/
+VOID
+EhcPowerOnAllPorts (
+ IN PEI_USB2_HC_DEV *Ehc
+ )
+{
+ UINT8 PortNumber;
+ UINT8 Index;
+
+ PortNumber = (UINT8)(Ehc->HcStructParams & HCSP_NPORTS);
+ for (Index = 0; Index < PortNumber; Index++) {
+ EhcSetOpRegBit (Ehc, EHC_PORT_STAT_OFFSET + 4 * Index, PORTSC_POWER);
+ }
+}
+
+/**
Initialize the HC hardware.
EHCI spec lists the five things to do to initialize the hardware.
1. Program CTRLDSSEGMENT.
@@ -443,6 +463,9 @@ EhcInitHC (
if (Ehc->Urb == NULL) {
return Status;
}
+
+ EhcPowerOnAllPorts (Ehc);
+ MicroSecondDelay (EHC_ROOT_PORT_RECOVERY_STALL);
Status = EhcInitSched (Ehc);