public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/Xhci: add 1ms delay before access MMIO reg during reset
@ 2016-09-14  1:37 Feng Tian
  2016-09-14  2:58 ` Zeng, Star
  2016-09-14 13:08 ` Leif Lindholm
  0 siblings, 2 replies; 10+ messages in thread
From: Feng Tian @ 2016-09-14  1:37 UTC (permalink / raw)
  To: star.zeng; +Cc: edk2-devel

Some XHCI host controllers require to have extra 1ms delay before
accessing any MMIO register during HC reset.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index d0f2205..cb822a6 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
@@ -2,7 +2,7 @@
 
   The XHCI register operation routines.
 
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
@@ -687,6 +687,10 @@ XhcResetHC (
   if ((Xhc->DebugCapSupOffset == 0xFFFFFFFF) || ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset) & 0xFF) != XHC_CAP_USB_DEBUG) ||
       ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset + XHC_DC_DCCTRL) & BIT0) == 0)) {
     XhcSetOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET);
+    //
+    // some XHCI host controllers require to have extra 1ms delay before accessing any MMIO register during reset.
+    //
+    gBS->Stall (XHC_1_MILLISECOND);
     Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, Timeout);
   }
 
-- 
2.7.1.windows.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-20  2:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14  1:37 [patch] MdeModulePkg/Xhci: add 1ms delay before access MMIO reg during reset Feng Tian
2016-09-14  2:58 ` Zeng, Star
2016-09-14  2:59   ` Tian, Feng
2016-09-14 13:08 ` Leif Lindholm
2016-09-14 17:14   ` Kinney, Michael D
2016-09-14 17:37     ` Andrew Fish
2016-09-14 18:07       ` Kinney, Michael D
2016-09-15 10:19     ` Leif Lindholm
2016-09-20  2:01       ` Tian, Feng
2016-09-20  1:39   ` Tian, Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox