@@ -2027,15 +2027,25 @@ bad_config:
/* host side needs more setup */
if (is_host_enabled(musb)) {
struct usb_hcd *hcd = musb_to_hcd(musb);
+ u8 busctl;
otg_set_host(musb->xceiv, &hcd->self);
if (is_otg_enabled(musb))
hcd->self.otg_port = 1;
musb->xceiv->host = &hcd->self;
- if (plat->board_data)
+ if (plat->board_data) {
hcd->power_budget =
2 * (plat->board_data->power ? : 250);
+ /* program PHY to use external vBus if required */
+ if (plat->board_data->extvbus) {
+ busctl = musb_readb(musb->mregs,
+ MUSB_ULPI_BUSCONTROL);
+ busctl |= ULPI_USE_EXTVBUS;
+ musb_writeb(musb->mregs,
+ MUSB_ULPI_BUSCONTROL, busctl);
+ }
+ }
}
/* For the host-only role, we can activate right away.
@@ -72,6 +72,10 @@
#define MUSB_DEVCTL_HR 0x02
#define MUSB_DEVCTL_SESSION 0x01
+/* ULPI VBUSCONTROL */
+#define ULPI_USE_EXTVBUS 0x01
+#define ULPI_USE_EXTVBUSIND 0x02
+
/* TESTMODE */
#define MUSB_TEST_FORCE_HOST 0x80
#define MUSB_TEST_FIFO_ACCESS 0x40
@@ -246,6 +250,7 @@
/* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
#define MUSB_HWVERS 0x6C /* 8 bit */
+#define MUSB_ULPI_BUSCONTROL 0x70 /* 8 bit */
#define MUSB_EPINFO 0x78 /* 8 bit */
#define MUSB_RAMINFO 0x79 /* 8 bit */
@@ -33,7 +33,8 @@ struct musb_hdrc_board_data {
u8 power;
/* (HOST or OTG) msec/2 after VBUS on till power good */
u8 potpgt;
-
+ /* flag to program PHY to use external Vbus */
+ u8 extvbus;
};
struct musb_hdrc_config {