diff options
author | Mike J. Chen <mjchen@google.com> | 2012-03-01 09:23:48 -0800 |
---|---|---|
committer | Mike J. Chen <mjchen@google.com> | 2012-03-03 17:29:38 -0800 |
commit | b984d88ea4c4a45fe4f73525ca237c02f1b8d0c6 (patch) | |
tree | f013f09a2af96140aae0d2ade3bae367c246edf8 | |
parent | 4e954a81f4e30c1fc496bd57b49ad14d2206532c (diff) | |
download | uboot-b984d88ea4c4a45fe4f73525ca237c02f1b8d0c6.tar.gz |
musb: Reset controller in case Linux or bootloader left it in bad state
Change-Id: I6c3f9d74a7b3faea783c48336afde2d0311491ed
Signed-off-by: Mike J. Chen <mjchen@google.com>
-rw-r--r-- | drivers/usb/musb/omap3.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/musb/omap3.c b/drivers/usb/musb/omap3.c index c7876ed09..57c3af094 100644 --- a/drivers/usb/musb/omap3.c +++ b/drivers/usb/musb/omap3.c @@ -75,7 +75,6 @@ static struct omap3_otg_regs *otg; #define OMAP3_OTG_FORCESTDBY_STANDBY 0x0001 - #ifdef DEBUG_MUSB_OMAP3 static void musb_db_otg_regs(void) { @@ -118,6 +117,15 @@ int musb_platform_init(void) otg = (struct omap3_otg_regs *)OMAP3_OTG_BASE; + /* Reset Mentor USB block */ + /* soft reset */ + writel(OMAP3_OTG_SYSCONFIG_SOFTRESET | readl(&otg->sysconfig), + &otg->sysconfig); + + /* Wait for reset to finish */ + while ((readl(&otg->sysstatus) & + OMAP3_OTG_SYSSTATUS_RESETDONE) == 0); + /* Set OTG to always be on */ writel(OMAP3_OTG_SYSCONFIG_NO_STANDBY_MODE | OMAP3_OTG_SYSCONFIG_NO_IDLE_MODE, &otg->sysconfig); @@ -138,6 +146,7 @@ int musb_platform_init(void) u32 *usbotghs_control = (u32 *)(CTRL_BASE + 0x33C); *usbotghs_control = 0x15; #endif + platform_needs_initialization = 0; } |