Revision: 14776
          http://sourceforge.net/p/edk2/code/14776
Author:   erictian
Date:     2013-10-15 06:13:14 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
MdeModulePkg/XhciDxe: Usb legacy support feature is optional. For those usb 3.0 
devices which doesn?\226?\128?\153t support this feature, should directly 
return and not touch corresponding registers

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sergey Isakov <[email protected]>
Signed-off-by: Tian, Feng <[email protected]>
Reviewed-by:   Li, Elvin <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
    trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c      2013-10-15 03:12:04 UTC 
(rev 14775)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c      2013-10-15 06:13:14 UTC 
(rev 14776)
@@ -164,7 +164,7 @@
   // Flow through, same behavior as Host Controller Reset
   //
   case EFI_USB_HC_RESET_HOST_CONTROLLER:
-    if (((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset) & 0xFF) == 
XHC_CAP_USB_DEBUG) &&
+    if ((Xhc->DebugCapSupOffset != 0xFFFFFFFF) && ((XhcReadExtCapReg (Xhc, 
Xhc->DebugCapSupOffset) & 0xFF) == XHC_CAP_USB_DEBUG) &&
         ((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset + XHC_DC_DCCTRL) & 
BIT0) != 0)) {
       Status = EFI_SUCCESS;
       goto ON_EXIT;

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c   2013-10-15 03:12:04 UTC 
(rev 14775)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c   2013-10-15 06:13:14 UTC 
(rev 14776)
@@ -543,6 +543,10 @@
 {
   UINT32                    Buffer;
 
+  if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) {
+    return;
+  }
+
   DEBUG ((EFI_D_INFO, "XhcSetBiosOwnership: called to set BIOS ownership\n"));
 
   Buffer = XhcReadExtCapReg (Xhc, Xhc->UsbLegSupOffset);
@@ -563,6 +567,10 @@
 {
   UINT32                    Buffer;
 
+  if (Xhc->UsbLegSupOffset == 0xFFFFFFFF) {
+    return;
+  }
+
   DEBUG ((EFI_D_INFO, "XhcClearBiosOwnership: called to clear BIOS 
ownership\n"));
 
   Buffer = XhcReadExtCapReg (Xhc, Xhc->UsbLegSupOffset);
@@ -606,7 +614,7 @@
     ExtCapOffset += (NextExtCapReg << 2);
   } while (NextExtCapReg != 0);
 
-  return 0;
+  return 0xFFFFFFFF;
 }
 
 /**
@@ -676,7 +684,7 @@
     }
   }
 
-  if (((XhcReadExtCapReg (Xhc, Xhc->DebugCapSupOffset) & 0xFF) != 
XHC_CAP_USB_DEBUG) ||
+  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);
     Status = XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, XHC_USBCMD_RESET, FALSE, 
Timeout);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to