]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/usb/musb-new/omap2430.c
usb: ohci: enable cache support
[karo-tx-uboot.git] / drivers / usb / musb-new / omap2430.c
index b1c4dc7828518252c856e658ddf4c5c92863e1e6..77273a49a31e47edb27d05437d4c7faf17e21965 100644 (file)
@@ -24,7 +24,6 @@
  * Suite 330, Boston, MA  02111-1307  USA
  *
  */
-#define __UBOOT__
 #ifndef __UBOOT__
 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -322,6 +321,7 @@ static int omap2430_musb_init(struct musb *musb)
 {
        u32 l;
        int status = 0;
+       unsigned long int start;
 #ifndef __UBOOT__
        struct device *dev = musb->controller;
        struct omap2430_glue *glue = dev_get_drvdata(dev->parent);
@@ -332,6 +332,21 @@ static int omap2430_musb_init(struct musb *musb)
                (struct omap_musb_board_data *)musb->controller;
 #endif
 
+       /* Reset the controller */
+       musb_writel(musb->mregs, OTG_SYSCONFIG, SOFTRST);
+
+       start = get_timer(0);
+
+       while (1) {
+               l = musb_readl(musb->mregs, OTG_SYSCONFIG);
+               if ((l & SOFTRST) == 0)
+                       break;
+
+               if (get_timer(start) > (CONFIG_SYS_HZ / 1000)) {
+                       dev_err(musb->controller, "MUSB reset is taking too long\n");
+                       return -ENODEV;
+               }
+       }
 
 #ifndef __UBOOT__
        /* We require some kind of external transceiver, hooked
@@ -385,7 +400,11 @@ err1:
        return status;
 }
 
+#ifndef __UBOOT__
 static void omap2430_musb_enable(struct musb *musb)
+#else
+static int omap2430_musb_enable(struct musb *musb)
+#endif
 {
 #ifndef __UBOOT__
        u8              devctl;
@@ -430,6 +449,7 @@ static void omap2430_musb_enable(struct musb *musb)
                                __PRETTY_FUNCTION__);
        }
 #endif
+       return 0;
 #endif
 }