Dear All,
in our custom DM8148 based design, we have one USB used at host only, while the other is configured as OTG.
Due missing OTG sw support (seen here http://processors.wiki.ti.com/index.php/TI81XX_USB_Driver_User_Guide#OTG_support_.28TI816X.2FTI814X.2FTI813x.29 ) we choose, for the moment, to restrict USB OTG port usage as device only.
Everything works fine when both are configured as host or as device, however when I configure USB0 as device and USB1 as host (as seen here http://processors.wiki.ti.com/index.php/Usbgeneralpage#One_port_as_host_and_other_port_as_Gadget_.28for_DM81XX.29) , none of them works.
I've found that both of them goes to otg state b_idle.
I've done a little patch,
From d88b38b52d6561e8cee40cb7726fd4dc099fb07f Mon Sep 17 00:00:00 2001 From: Andrea Scian <andrea.scian@dave.eu> Date: Mon, 18 Jun 2012 16:17:28 +0200 Subject: [PATCH] set board_mode too when forcing musb mode, in this way musb is initialized properly --- drivers/usb/musb/ti81xx.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/ti81xx.c b/drivers/usb/musb/ti81xx.c index 22390e7..3656c74 100644 --- a/drivers/usb/musb/ti81xx.c +++ b/drivers/usb/musb/ti81xx.c @@ -1011,6 +1011,7 @@ int ti81xx_musb_set_mode(struct musb *musb, u8 musb_mode) /* TODO: implement this using CONF0 */ if (musb_mode == MUSB_HOST) { + musb->board_mode = MUSB_HOST; regval = musb_readl(reg_base, USB_MODE_REG); regval &= ~USBMODE_USBID_HIGH; @@ -1023,6 +1024,7 @@ int ti81xx_musb_set_mode(struct musb *musb, u8 musb_mode) musb_readl(reg_base, USB_MODE_REG), regval); } else if (musb_mode == MUSB_PERIPHERAL) { + musb->board_mode = MUSB_PERIPHERAL; /* TODO commmented writing 8 to USB_MODE_REG device mode is not working */ regval = musb_readl(reg_base, USB_MODE_REG); -- 1.6.5.GIT
Best Regards and thanks in advance,
Andrea