Commit 835a5559bd093627baf9a90e82cd626ec59fade9

Authored by Roger Quadros
Committed by Tom Rini
1 parent f33b9bd398

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.

Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
CC: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Roger Quadros <rogerq@ti.com>

Showing 1 changed file with 42 additions and 15 deletions Side-by-side Diff

drivers/usb/host/ehci-omap.c
... ... @@ -28,21 +28,48 @@
28 28  
29 29 static int omap_uhh_reset(void)
30 30 {
31   -/*
32   - * Soft resetting the UHH module causes instability issues on
33   - * all OMAPs so we just avoid it.
34   - *
35   - * See OMAP36xx Errata
36   - * i571: USB host EHCI may stall when entering smart-standby mode
37   - * i660: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
38   - *
39   - * On OMAP4/5, soft-resetting the UHH module will put it into
40   - * Smart-Idle mode and lead to a deadlock.
41   - *
42   - * On OMAP3, this doesn't seem to be the case but still instabilities
43   - * are observed on beagle (3530 ES1.0) if soft-reset is used.
44   - * e.g. NFS root failures with Linux kernel.
45   - */
  31 + int timeout = 0;
  32 + u32 rev;
  33 +
  34 + rev = readl(&uhh->rev);
  35 +
  36 + /* Soft RESET */
  37 + writel(OMAP_UHH_SYSCONFIG_SOFTRESET, &uhh->sysc);
  38 +
  39 + switch (rev) {
  40 + case OMAP_USBHS_REV1:
  41 + /* Wait for soft RESET to complete */
  42 + while (!(readl(&uhh->syss) & 0x1)) {
  43 + if (timeout > 100) {
  44 + printf("%s: RESET timeout\n", __func__);
  45 + return -1;
  46 + }
  47 + udelay(10);
  48 + timeout++;
  49 + }
  50 +
  51 + /* Set No-Idle, No-Standby */
  52 + writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
  53 + break;
  54 +
  55 + default: /* Rev. 2 onwards */
  56 +
  57 + udelay(2); /* Need to wait before accessing SYSCONFIG back */
  58 +
  59 + /* Wait for soft RESET to complete */
  60 + while ((readl(&uhh->sysc) & 0x1)) {
  61 + if (timeout > 100) {
  62 + printf("%s: RESET timeout\n", __func__);
  63 + return -1;
  64 + }
  65 + udelay(10);
  66 + timeout++;
  67 + }
  68 +
  69 + writel(OMAP_UHH_SYSCONFIG_VAL, &uhh->sysc);
  70 + break;
  71 + }
  72 +
46 73 return 0;
47 74 }
48 75