All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: RFC: PATCH TI81xx fix MUSB software mode setting
       [not found] <464859D4BE03A84686BA47749242C1D03EA93DED@DBDE01.ent.ti.com>
@ 2012-06-19  6:18 ` B, Ravi
  2012-06-19  6:55   ` Andrea Scian - DAVE Simply Embedded
  0 siblings, 1 reply; 3+ messages in thread
From: B, Ravi @ 2012-06-19  6:18 UTC (permalink / raw)
  To: linux-omap; +Cc: andrea.scian


> ----- Original Message -----
> From: Andrea Scian [mailto:rnd4@dave-tech.it]
> Sent: Monday, June 18, 2012 08:25 PM
> To: linux-omap@vger.kernel.org <linux-omap@vger.kernel.org>
> Subject: RFC: PATCH TI81xx fix MUSB software mode setting
> 
> 
> Dear all,
> 
> when configuring our platform (DM8148 based) to work with 
> USB0 as device and USB1 as host I've found some problems.

It seems that you created the patch against the ti-psp release, there
is another way to achieve this (one port as host and other port as device). 
Please refer to release/user's guide.
Moreover, you should create a patch against mainline, where the musb_dsps.c is
used instead of ti81xx.c, where there is no host-only or device-only mode, by 
default OTG mode is used.

> It was fine if I configure both as device or both as host or 
> enable only one port, but configure both in different modes 
> lead to a not working configuration.
> After a bit of debug I've found that probably the problem is inside
> ti81xx_musb_set_mode() because this configure the controller 
> but does not set musb->board_mode. IIUC, without setting this 
> structure the whole musb generic state machine does not work 
> correctly.
> Attached you can find the patch that fixed the problem on our 
> board. I hope -this can help others too and can be integrated 
> inside the main tree.
> Feel free to comment and tell me if I've done something wrong.
> 
> I hope the the patch format is quite correct for you.
> 
> Best Regards,
> 
> 
> -- 
> 
> Andrea SCIAN
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFC: PATCH TI81xx fix MUSB software mode setting
  2012-06-19  6:18 ` RFC: PATCH TI81xx fix MUSB software mode setting B, Ravi
@ 2012-06-19  6:55   ` Andrea Scian - DAVE Simply Embedded
  0 siblings, 0 replies; 3+ messages in thread
From: Andrea Scian - DAVE Simply Embedded @ 2012-06-19  6:55 UTC (permalink / raw)
  To: B, Ravi; +Cc: linux-omap


Dear Ravi,

>>
>> Dear all,
>>
>> when configuring our platform (DM8148 based) to work with
>> USB0 as device and USB1 as host I've found some problems.
>
> It seems that you created the patch against the ti-psp release, there
> is another way to achieve this (one port as host and other port as device).

Yes you are correct, I'm using ti-psp by cloning this tree:

http://arago-project.org/git/projects/linux-omap3.git

> Please refer to release/user's guide.

I've looked here:

http://processors.wiki.ti.com/index.php/Usbgeneralpage#One_port_as_host_and_other_port_as_Gadget_.28for_DM81XX.29

but this setup does not work.

Both ports starts from "b_idle" state and always stay there.
I've try both software setting and from hardware pin (I've left ID pin 
floating for USB0, device, and set ID pin to gnd for USB1, host only) 
without success.
However if I configure both port as host or device (thus disabling OTG 
support) they work correctly (of course, only the device port works as 
device and host port as host in either case ;-) )

> Moreover, you should create a patch against mainline, where the musb_dsps.c is
> used instead of ti81xx.c, where there is no host-only or device-only mode, by
> default OTG mode is used.
>

Ok, but I've found here:

http://processors.wiki.ti.com/index.php/TI81XX_USB_Driver_User_Guide#OTG_support_.28TI816X.2FTI814X.2FTI813x.29

that OTG is not supported for TI81xx.
Am I wrong? Maybe the situation is different in the mainline?

Best Regards and thank for you prompt answer,

Andrea

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RFC: PATCH TI81xx fix MUSB software mode setting
@ 2012-06-18 14:55 Andrea Scian
  0 siblings, 0 replies; 3+ messages in thread
From: Andrea Scian @ 2012-06-18 14:55 UTC (permalink / raw)
  To: linux-omap

[-- Attachment #1: Type: text/plain, Size: 856 bytes --]


Dear all,

when configuring our platform (DM8148 based) to work with USB0 as device 
and USB1 as host I've found some problems.
It was fine if I configure both as device or both as host or enable only 
one port, but configure both in different modes lead to a not working 
configuration.
After a bit of debug I've found that probably the problem is inside 
ti81xx_musb_set_mode() because this configure the controller but does 
not set musb->board_mode. IIUC, without setting this structure the whole 
musb generic state machine does not work correctly.

Attached you can find the patch that fixed the problem on our board. I 
hope this can help others too and can be integrated inside the main tree.

Feel free to comment and tell me if I've done something wrong.

I hope the the patch format is quite correct for you.

Best Regards,


-- 

Andrea SCIAN

[-- Attachment #2: 0001-set-board_mode-too-when-forcing-musb-mode-in-this-wa.patch --]
[-- Type: text/plain, Size: 1140 bytes --]

>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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-19  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <464859D4BE03A84686BA47749242C1D03EA93DED@DBDE01.ent.ti.com>
2012-06-19  6:18 ` RFC: PATCH TI81xx fix MUSB software mode setting B, Ravi
2012-06-19  6:55   ` Andrea Scian - DAVE Simply Embedded
2012-06-18 14:55 Andrea Scian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.