[U-Boot] [PATCH 1/1] tegra: usb: Fix device enumeration problem of USB1

Jim Lin jilin at nvidia.com
Thu Jun 14 12:40:03 CEST 2012


For some reason, bit 1 (connect status change) of PORTSC will be set
after issuing Port Reset (like "usb reset" in u-boot command line).
This will be treated as an error and stops later device enumeration.

Therefore we add a definition in header file to ignore checking of that bit
after Port Reset.
CONFIG_USB_RESET_IGNORE_CONNECT_CHANGE

Signed-off-by: Jim Lin <jilin at nvidia.com>
---
To reproduce this issue, you can modify board .dts file to set
as the following to build u-boot binary.
"
 usb0 = "/usb at c5000000";
 usb1 = "/usb at c5008000";
"
Install device on USB1 port (address at 0xc5000000).
And run "usb reset" in u-boot console to enumerate device.

 common/usb_hub.c                |    4 ++++
 include/configs/tegra2-common.h |    7 +++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index e0edaad..8e6bdd8 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -180,8 +180,12 @@ int hub_port_reset(struct usb_device *dev, int port,
 			(portstatus & USB_PORT_STAT_CONNECTION) ? 1 : 0,
 			(portstatus & USB_PORT_STAT_ENABLE) ? 1 : 0);
 
+#ifdef CONFIG_USB_RESET_IGNORE_CONNECT_CHANGE
+		if (!(portstatus & USB_PORT_STAT_CONNECTION))
+#else
 		if ((portchange & USB_PORT_STAT_C_CONNECTION) ||
 		    !(portstatus & USB_PORT_STAT_CONNECTION))
+#endif
 			return -1;
 
 		if (portstatus & USB_PORT_STAT_ENABLE)
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 1931179..904c17e 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -111,6 +111,13 @@
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_EHCI_DCACHE
 
+/*
+ * For some reason, bit 1 (Connect Status Change) of PORTSC register will be
+ * set after issuing Port Reset. This setting is to ignore checking of that
+ * bit after reset.
+ */
+#define CONFIG_USB_RESET_IGNORE_CONNECT_CHANGE
+
 /* Total I2C ports on Tegra2 */
 #define TEGRA_I2C_NUM_CONTROLLERS	4
 
-- 
1.7.3

nvpublic


More information about the U-Boot mailing list