summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-11 05:55:14 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2009-08-11 05:55:14 +0000
commitba19956ac3c600eaeff1c90556457105032218d8 (patch)
treed42ca673ba325c5c627456f75003d4633f3029bf /MdeModulePkg/Bus
parent488899900894e3c2a9e581cb2d1eec0d3761296b (diff)
downloadedk2-platforms-ba19956ac3c600eaeff1c90556457105032218d8.tar.xz
add comments to clarify the enhancement on EHCI driver, which is guaranteed to get attached to EHCI host controller before UHCI driver attaches to uhci host controller.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9040 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c25
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf5
2 files changed, 27 insertions, 3 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index c6c7e5a519..d6210255f4 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -1,7 +1,15 @@
-/** @file
-
+/** @file
The Ehci controller driver.
+ EhciDxe driver is responsible for managing the behavior of EHCI controller.
+ It implements the interfaces of monitoring the status of all ports and transferring
+ Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
+
+ Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
+ to the EHCI controller before the UHCI driver attaches to the companion UHCI controller.
+ This way avoids the control transfer on a shared port between EHCI and companion host
+ controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
+
Copyright (c) 2006 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -1570,6 +1578,9 @@ EhcDriverBindingStart (
goto CLOSE_PCIIO;
}
+ //
+ // Get the Pci device class code.
+ //
Status = PciIo->Pci.Read (
PciIo,
EfiPciIoWidthUint8,
@@ -1582,7 +1593,11 @@ EhcDriverBindingStart (
Status = EFI_UNSUPPORTED;
goto CLOSE_PCIIO;
}
-
+ //
+ // determine if the device is UHCI host controller or not. If yes, then find out the
+ // companion usb ehci host controller and force EHCI driver get attached to it before
+ // UHCI driver attaches to UHCI host controller.
+ //
if ((UsbClassCReg.PI == PCI_IF_UHCI) &&
(UsbClassCReg.BaseCode == PCI_CLASS_SERIAL) &&
(UsbClassCReg.SubClassCode == PCI_CLASS_SERIAL_USB)) {
@@ -1645,6 +1660,10 @@ EhcDriverBindingStart (
if (EFI_ERROR (Status)) {
goto CLOSE_PCIIO;
}
+ //
+ // Currently, the judgment on the companion usb host controller is through the
+ // same bus number, which may vary on different platform.
+ //
if (EhciBusNumber == UhciBusNumber) {
gBS->CloseProtocol (
Controller,
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
index fd98e4200f..381f4bd400 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
@@ -6,6 +6,11 @@
# It implements the interfaces of monitoring the status of all ports and transferring
# Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.
#
+# Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached
+# to the EHCI controller before the UHCI driver attaches to the companion UHCI controller.
+# This way avoids the control transfer on a shared port between EHCI and companion host
+# controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
+#
# Copyright (c) 2006 - 2009, Intel Corporation.
#
# All rights reserved. This program and the accompanying materials