Skip to contentSkip to conversation

OMAP USB host fixes for Beagle & Panda

PATCH New Roger Quadros 5 participants 11 messages Dec 2, 2013 – Dec 4, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover OMAP USB host fixes for Beagle & Panda

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues
- Gets rid of ULPI reset errors on Beagle & Panda

---
cheers,
-roger

Roger Quadros (3):
usb: ehci-omap: Reset the USB Host OMAP module
omap3_beagle: Don't use ulpi_reset
omap4_panda: Don't use ulpi_reset

 drivers/usb/host/ehci-omap.c   | 57 +++++++++++++++++++++++++++++++-----------
 include/configs/omap3_beagle.h |  3 ---
 include/configs/omap4_panda.h  |  3 ---
 3 files changed, 42 insertions(+), 21 deletions(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/3 usb: ehci-omap: Reset the USB Host OMAP module

In commit bb1f327 we removed the UHH reset to fix NFS root (over usb ethernet) problems with Beagleboard (3530 ES1.0). However, this seems to cause USB detection problems for Pandaboard, about (3/8).

On further investigation, it seems that doing the UHH reset is not the cause of the original Beagleboard problem, but in the way the reset was done.

This patch adds proper UHH RESET mechanism for OMAP3 and OMAP4/5 based on the UHH_REVISION register. This should fix the Beagleboard NFS problem as well as the Pandaboard USB detection problem.

---
 drivers/usb/host/ehci-omap.c | 57 ++++++++++++++++++++++++++++++++------------
 1 file changed, 42 insertions(+), 15 deletions(-)
drivers/usb/host/ehci-omap.c +42 -15
index 3c58f9e..98cea00 100644
@@ -28,21 +28,48 @@ static struct omap_ehci *const ehci = (struct omap_ehci *)OMAP_EHCI_BASE;
 
 static int omap_uhh_reset(void)
 {
-/*
- * Soft resetting the UHH module causes instability issues on
- * all OMAPs so we just avoid it.
- *
- * See OMAP36xx Errata
- *  i571: USB host EHCI may stall when entering smart-standby mode
- *  i660: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
- *
- * On OMAP4/5, soft-resetting the UHH module will put it into
- * Smart-Idle mode and lead to a deadlock.
- *
- * On OMAP3, this doesn't seem to be the case but still instabilities
- * are observed on beagle (3530 ES1.0) if soft-reset is used.
- * e.g. NFS root failures with Linux kernel.
- */
+	int timeout = 0;
+	u32 rev;
+
+	rev = readl(&uhh->rev);
+
+	/* Soft RESET */
+	writel(OMAP_UHH_SYSCONFIG_SOFTRESET, &uhh->sysc);
+
+	switch (rev) {
+	case OMAP_USBHS_REV1:
+		/* Wait for soft RESET to complete */
+		while (!(readl(&uhh->syss) & 0x1)) {
+			if (timeout > 100) {
+				printf("%s: RESET timeout\n", __func__);
+				return -1;
+			}
+			udelay(10);
+			timeout++;
+		}
+
+		/* Set No-Idle, No-Standby */
+		writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+		break;
+
+	default:	/* Rev. 2 onwards */
+
+		udelay(2); /* Need to wait before accessing SYSCONFIG back */
+
+		/* Wait for soft RESET to complete */
+		while ((readl(&uhh->sysc) & 0x1)) {
+			if (timeout > 100) {
+				printf("%s: RESET timeout\n", __func__);
+				return -1;
+			}
+			udelay(10);
+			timeout++;
+		}
+
+		writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+		break;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/3 usb: ehci-omap: Reset the USB Host OMAP module

Hi Roger,

This patch fixes a USB issue we had which was caused by the function ehci_shutdown() in usb_lowlevel_stop(). The issue was that once "usb stop" was called, usb devices would no longer be detected by the "usb start" command. With this patch the devices are detected each time.

One suggestion though (see below):

Quoted 16 lines · Roger Quadros

In commit bb1f327 we removed the UHH reset to fix NFS root (over usb ethernet) problems with Beagleboard (3530 ES1.0). However, this seems to cause USB detection problems for Pandaboard, about (3/8).

On further investigation, it seems that doing the UHH reset is not the cause of the original Beagleboard problem, but in the way the reset was done.

This patch adds proper UHH RESET mechanism for OMAP3 and OMAP4/5 based on the UHH_REVISION register. This should fix the Beagleboard NFS problem as well as the Pandaboard USB detection problem.

[...]

Quoted 25 lines
drivers/usb/host/ehci-omap.c +25 -0
+
+	switch (rev) {
+	case OMAP_USBHS_REV1:
+		/* Wait for soft RESET to complete */
+		while (!(readl(&uhh->syss) & 0x1)) {
+			if (timeout > 100) {
+				printf("%s: RESET timeout\n", __func__);
+				return -1;
+			}
+			udelay(10);
+			timeout++;
+		}
+
+		/* Set No-Idle, No-Standby */
+		writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+		break;
+
+	default:	/* Rev. 2 onwards */
+
+		udelay(2); /* Need to wait before accessing SYSCONFIG back */
+
+		/* Wait for soft RESET to complete */
+		while ((readl(&uhh->sysc) & 0x1)) {
+			if (timeout > 100) {
+				printf("%s: RESET timeout\n", __func__);

drivers/usb/host/ehci-omap.c static struct omap_ehci *const ehci = (struct omap_ehci *)OMAP_EHCI_BASE; · line 72

Quoted 10 lines
drivers/usb/host/ehci-omap.c +10 -0
+				return -1;
+			}
+			udelay(10);
+			timeout++;
+		}
+
+		writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
+		break;
+	}
+

You have a lot of unnecessart code duplication in this switch statment. How about:
====
if (rev != OMAP_USBHS_REV1)
udelay(2); /* Need to wait before accessing SYSCONFIG back */

/* Wait for soft RESET to complete */

while (!omap_uhh_reset_done(rev)) {
	if (timeout > 100) {
		printf("%s: RESET timeout\n", __func__);
		return -1;
	}

	udelay(10);
	timeout++;
}

writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
====
With omap_uhh_reset_done() doing the appropriate check for the revision.

Also, why can't we do udelay(2) when rev == OMAP_USBHS_REV1?

Signature · 2 lines
Regards,
Nikita.
#3 lore raw

PATCH 2/3 omap3_beagle: Don't use ulpi_reset

In reply to Roger Quadros

Fixes this error message when USB is started.
"ULPI: ulpi_reset: failed writing reset bit"

It is pointless to manually reset the ULPI as the USB Host Reset and PHY RESET line should take care of that.

---
 include/configs/omap3_beagle.h | 3 ---
 1 file changed, 3 deletions(-)
include/configs/omap3_beagle.h +0 -3
index 9fcd50b..88b67e7 100644
@@ -118,9 +118,6 @@
 #define CONFIG_USB_EHCI_OMAP
 #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	147
 
-#define CONFIG_USB_ULPI
-#define CONFIG_USB_ULPI_VIEWPORT_OMAP
-
 #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
Signature · 1 line
1.8.3.2
#4 lore raw

PATCH 3/3 omap4_panda: Don't use ulpi_reset

In reply to Roger Quadros

Fixes this error message when USB is started.
"ULPI: ulpi_reset: failed writing reset bit"

It is pointless to manually reset the ULPI as the USB Host Reset and PHY RESET line should take care of that.

---
 include/configs/omap4_panda.h | 3 ---
 1 file changed, 3 deletions(-)
include/configs/omap4_panda.h +0 -3
index 8294622..89b1c51 100644
@@ -36,9 +36,6 @@
 #define CONFIG_CMD_PING
 #define CONFIG_CMD_DHCP
 
-#define CONFIG_USB_ULPI
-#define CONFIG_USB_ULPI_VIEWPORT_OMAP
-
 #include <configs/omap4_common.h>
 #define CONFIG_CMD_NET
 
Signature · 1 line
1.8.3.2
#5 lore raw

cover OMAP USB host fixes for Beagle & Panda

In reply to Roger Quadros

Dear Roger Quadros,

Quoted 6 lines

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues
- Gets rid of ULPI reset errors on Beagle & Panda

Is this a V2 or what is this? I already see similar series posted a few days ago.

Best regards,
Marek Vasut

#6 lore raw

cover OMAP USB host fixes for Beagle & Panda

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Marek Vasut

Dear Roger Quadros,

Quoted 6 lines

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues - Gets rid of ULPI reset errors on Beagle & Panda

Is this a V2 or what is this? I already see similar series posted a few days ago.

You missed my email. Roger forgot to CC the mailing list.

- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSnK7kAAoJENk4IS6UOR1W66kP/iVLqu0dQGtXpVxAYZRJshxR 2DNhFS1LBkiEvIMZ2+YihCykHmYQSQk8npKmwfwQ2WRJELUFfjXP+/R9U7O17z0W XEDNo3r0GzfVUpZ2Vp6Ilx4Kcy8XCGFLQs99xlUcSQ8T8yy98Vhn+CApg3j6NPNX X/59CniUkE8lBYlTCURRxbUc+OWw20OpKWbhA9I7VM6mDmnb9tcnBfvmwLimdsGZ 0wtpfbzNHV0DRZzbrPpSliht4kxRp0qRovBYO0kDdZCLzXgoYQlf5NcvDzEXlRMn nsWU7/gyzFXus5tDxPbQ3bW8AMY2sHdB1/kSh5PXPxEhB21IXKtifTaSDtDWMdam 7RZLxcFbKmNeu7JpM1Y1sW297l85rF5xUBO5SMgJLenvUGtXidQ76gQrv+zEgfof UFKEQwzLzabUBEWfihjNQMV+VtP5loR4UM7M3vt+/GPcYzB3lmkGw3/NWOjhUAk1 6CLrw/89Ye2reKZg+BSV3ijXGLdr2CV5kzah/un3rw1hGIGMvzND9KnKlRKypCfO Yrs0Otq0z3vUIfe0p5ZWF6xMRsIZ1XeTWShFRO+WS73r3Wh+CmNS4IzO3+y9Ctq9 LUBAPNNFHWuHJXRd5o2lm2ov2l6qKX5nq+uQCp9tZby5LqGkEid793qoWH4vhEoc +EagxiR4YaXjZYZ5dqYs
=HGsN
-----END PGP SIGNATURE-----

#7 lore raw

cover OMAP USB host fixes for Beagle & Panda

In reply to Marek Vasut

Hi,

Quoted 11 lines

Dear Roger Quadros,

Quoted 6 lines

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues
- Gets rid of ULPI reset errors on Beagle & Panda

Is this a V2 or what is this? I already see similar series posted a few days ago.

I see, it was not posted to the ML before.

Best regards,
Marek Vasut

#8 lore raw

cover OMAP USB host fixes for Beagle & Panda

In reply to Roger Quadros
Quoted 16 lines · Roger Quadros

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues
- Gets rid of ULPI reset errors on Beagle & Panda

---
cheers,
-roger

Roger Quadros (3):
usb: ehci-omap: Reset the USB Host OMAP module
omap3_beagle: Don't use ulpi_reset
omap4_panda: Don't use ulpi_reset

Quoted 4 lines
 drivers/usb/host/ehci-omap.c   | 57 +++++++++++++++++++++++++++++++-----------
 include/configs/omap3_beagle.h |  3 ---
 include/configs/omap4_panda.h  |  3 ---
 3 files changed, 42 insertions(+), 21 deletions(-)

Tested on OMAP4 Panda and OMAP3 Beagle xM.

Usually seems to work, but on Panda I still sometimes see that the eth is not found:

(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found
No ethernet found.

Tomi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131204/0778783f/attachment.pgp>

#9 lore raw

cover OMAP USB host fixes for Beagle & Panda

Hi,

Quoted 27 lines · Tomi Valkeinen
Quoted 16 lines · Roger Quadros

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues
- Gets rid of ULPI reset errors on Beagle & Panda

---
cheers,
-roger

Roger Quadros (3):
usb: ehci-omap: Reset the USB Host OMAP module
omap3_beagle: Don't use ulpi_reset
omap4_panda: Don't use ulpi_reset

Quoted 4 lines
 drivers/usb/host/ehci-omap.c   | 57 +++++++++++++++++++++++++++++++-----------
 include/configs/omap3_beagle.h |  3 ---
 include/configs/omap4_panda.h  |  3 ---
 3 files changed, 42 insertions(+), 21 deletions(-)

Tested on OMAP4 Panda and OMAP3 Beagle xM.

Usually seems to work, but on Panda I still sometimes see that the eth is not found:

Quoted 6 lines

(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found
No ethernet found.

Thanks for the tests. I'll need to investigate more, but the patches are good enough to go as they are.

cheers,
-roger

#10 lore raw

cover OMAP USB host fixes for Beagle & Panda

In reply to Roger Quadros
Quoted 16 lines · Roger Quadros

Hi,

This series

- Fixes OMAP4 Panda USB device detection issues
- Gets rid of ULPI reset errors on Beagle & Panda

---
cheers,
-roger

Roger Quadros (3):
usb: ehci-omap: Reset the USB Host OMAP module
omap3_beagle: Don't use ulpi_reset
omap4_panda: Don't use ulpi_reset

Quoted 4 lines
 drivers/usb/host/ehci-omap.c   | 57 +++++++++++++++++++++++++++++++-----------
 include/configs/omap3_beagle.h |  3 ---
 include/configs/omap4_panda.h  |  3 ---
 3 files changed, 42 insertions(+), 21 deletions(-)

Applied to u-boot-ti/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131204/4f30aec7/attachment.pgp>