From 23b0b155262644f0514b13d5c8f23f310e33d75b Mon Sep 17 00:00:00 2001 From: erictian Date: Mon, 18 Jun 2012 06:25:34 +0000 Subject: [PATCH] MdeMoMdeMdeModulePkg/EhciPei: By default power on all root ports of EHCI host controller for recovery path Signed-off-by: Tian Feng Reviewed-by: Sun Rui git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13460 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/EhciPei/EhcPeim.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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.
+Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions @@ -400,6 +400,26 @@ EhcRunHC ( return Status; } +/** + 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. @@ -443,6 +463,9 @@ EhcInitHC ( if (Ehc->Urb == NULL) { return Status; } + + EhcPowerOnAllPorts (Ehc); + MicroSecondDelay (EHC_ROOT_PORT_RECOVERY_STALL); Status = EhcInitSched (Ehc); -- 2.39.2