Merge branch 'master' of /home/wd/git/u-boot/master
[oweals/u-boot.git] / drivers / usb / musb / musb_core.c
index 7766069bfcfdb25ca04551783c61f2f560df428a..6fe2c39bce800cb6eac58008431f8c3a2fb36f10 100644 (file)
@@ -34,6 +34,7 @@ void musb_start(void)
 {
 #if defined(CONFIG_MUSB_HCD)
        u8 devctl;
+       u8 busctl;
 #endif
 
        /* disable all interrupts */
@@ -45,6 +46,12 @@ void musb_start(void)
        /* put into basic highspeed mode and start session */
        writeb(MUSB_POWER_HSENAB, &musbr->power);
 #if defined(CONFIG_MUSB_HCD)
+       /* Program PHY to use EXT VBUS if required */
+       if (musb_cfg.extvbus == 1) {
+               busctl = musb_read_ulpi_buscontrol(musbr);
+               musb_write_ulpi_buscontrol(musbr, busctl | ULPI_USE_EXTVBUS);
+       }
+
        devctl = readb(&musbr->devctl);
        writeb(devctl | MUSB_DEVCTL_SESSION, &musbr->devctl);
 #endif
@@ -134,6 +141,11 @@ void write_fifo(u8 ep, u32 length, void *fifo_data)
                writeb(*data++, &musbr->fifox[ep]);
 }
 
+/*
+ * AM35x supports only 32bit read operations so
+ * use seperate read_fifo() function for it.
+ */
+#ifndef CONFIG_USB_AM35X
 /*
  * This function reads data from endpoint fifo
  *
@@ -153,3 +165,4 @@ void read_fifo(u8 ep, u32 length, void *fifo_data)
        while (length--)
                *data++ = readb(&musbr->fifox[ep]);
 }
+#endif /* CONFIG_USB_AM35X */