summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-10 02:46:06 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-10 02:46:06 +0000
commitc843ef6796e39c50eb2352dd3cdf1a368d1a86a5 (patch)
treeb7c3d767f8cabbd32d5795444fc2f12a55762077
parentfa8801f5fc35146818f4445f00ca7b9db83e051e (diff)
downloadedk2-platforms-c843ef6796e39c50eb2352dd3cdf1a368d1a86a5.tar.xz
MdeModulePkg/UsbBusDxe: Timing tunning for better boot performance.
Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13809 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h10
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c7
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h4
3 files changed, 13 insertions, 8 deletions
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
index ad2f95261b..094aea21cd 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.h
@@ -60,10 +60,10 @@ typedef struct _USB_HUB_API USB_HUB_API;
//
// Roothub and hub's polling interval, set by experience,
-// The unit of roothub is 100us, means 1s as interval, and
+// The unit of roothub is 100us, means 100ms as interval, and
// the unit of hub is 1ms, means 64ms as interval.
//
-#define USB_ROOTHUB_POLL_INTERVAL (1000 * 10000U)
+#define USB_ROOTHUB_POLL_INTERVAL (100 * 10000U)
#define USB_HUB_POLL_INTERVAL 64
//
@@ -75,13 +75,13 @@ typedef struct _USB_HUB_API USB_HUB_API;
//
// Wait for port statue reg change, set by experience
//
-#define USB_WAIT_PORT_STS_CHANGE_STALL (5 * USB_BUS_1_MILLISECOND)
+#define USB_WAIT_PORT_STS_CHANGE_STALL (100)
//
// Wait for set device address, refers to specification
// [USB20-9.2.6.3, it says 2ms]
//
-#define USB_SET_DEVICE_ADDRESS_STALL (20 * USB_BUS_1_MILLISECOND)
+#define USB_SET_DEVICE_ADDRESS_STALL (2 * USB_BUS_1_MILLISECOND)
//
// Wait for retry max packet size, set by experience
@@ -99,7 +99,7 @@ typedef struct _USB_HUB_API USB_HUB_API;
// [USB20-7.1.7.5, it says 10ms for hub and 50ms for
// root hub]
//
-#define USB_SET_PORT_RESET_STALL (20 * USB_BUS_1_MILLISECOND)
+#define USB_SET_PORT_RESET_STALL (10 * USB_BUS_1_MILLISECOND)
#define USB_SET_ROOT_PORT_RESET_STALL (50 * USB_BUS_1_MILLISECOND)
//
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
index 78af917ca0..2d24bb4b8a 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c
@@ -763,7 +763,12 @@ UsbHubInit (
UsbHubCtrlSetPortFeature (HubIf->Device, Index, (EFI_USB_PORT_FEATURE) USB_HUB_PORT_POWER);
}
- gBS->Stall (HubDesc.PwrOn2PwrGood * USB_SET_PORT_POWER_STALL);
+ //
+ // Update for the usb hub has no power on delay requirement
+ //
+ if (HubDesc.PwrOn2PwrGood > 0) {
+ gBS->Stall (HubDesc.PwrOn2PwrGood * USB_SET_PORT_POWER_STALL);
+ }
UsbHubAckHubStatus (HubIf->Device);
}
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h
index c7ee16db46..4e5fcd85e0 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.h
@@ -97,9 +97,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Host software return timeout if port status doesn't change
-// after 500ms(LOOP * STALL = 100 * 5ms), set by experience
+// after 500ms(LOOP * STALL = 5000 * 0.1ms), set by experience
//
-#define USB_WAIT_PORT_STS_CHANGE_LOOP 100
+#define USB_WAIT_PORT_STS_CHANGE_LOOP 5000
#pragma pack(1)
//