All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot]  chiliSOM: USB bug
@ 2018-04-11  6:18 sdrb
  2018-04-11 16:08 ` Marcin Niestroj
  0 siblings, 1 reply; 10+ messages in thread
From: sdrb @ 2018-04-11  6:18 UTC (permalink / raw)
  To: u-boot

Hi,

I use Grinn's chiliSOM and very old U-boot 2014.07 on it. Unfortunately 
the newest u-boot doesn't run SPL properly - so I'm forced to use 
2014.07 version.

I noticed that there is some problem with USB maintenance. As far as I 
know the chiliSOM is TI AM335x compatible system so it uses Mentor USB 
OTG controller.

The problem occures when I'm trying to use following sequence of commands:

# usb start
# usb stop
# usb start

and after the second "usb start" I get error:

[2018-04-06 08:13:42.600] U-Boot# usb start
[2018-04-06 08:13:44.162] (Re)start USB...
[2018-04-06 08:13:44.164] USB0:   scanning bus 0 for devices... 5 USB 
Device(s) found
[2018-04-06 08:13:50.872]        scanning usb for storage devices... 0 
Storage Device(s) found
[2018-04-06 08:13:50.881] U-Boot# usb stop
[2018-04-06 08:13:55.514] stopping USB..
[2018-04-06 08:13:55.521] U-Boot# usb start
[2018-04-06 08:14:01.962] (Re)start USB...
[2018-04-06 08:14:01.964] USB0:   lowlevel init failed
[2018-04-06 08:14:16.730] USB error: all controllers failed lowlevel init
[2018-04-06 08:14:16.734] U-Boot#

I dig a little the code and I noticed that there is some line which 
breaks up things.
The problem is in proc musb_generic_disable() where there is zeroed 
DEVCTL register.
Seems like zeroing breaks somehow Mentor USB because after it it not 
possible to turn USB host mode.

I tried to solve the problem with push MUSB into suspend mode, then zero 
DEVCTL and then resume MUSB, but still no success.
So I decided to remove this line from my code and now it seems to work. 
I mean now USB is working fine:

[2018-04-06 08:15:44.290] U-Boot# usb start
[2018-04-06 08:15:45.787] (Re)start USB...
[2018-04-06 08:15:45.790] USB0:   scanning bus 0 for devices... 5 USB 
Device(s) found
[2018-04-06 08:15:52.489]        scanning usb for storage devices... 0 
Storage Device(s) found
[2018-04-06 08:15:52.495] U-Boot# usb stop
[2018-04-06 08:15:54.835] stopping USB..
[2018-04-06 08:15:54.837] U-Boot# usb start
[2018-04-06 08:17:03.323] (Re)start USB...
[2018-04-06 08:17:03.325] USB0:   scanning bus 0 for devices... 5 USB 
Device(s) found
[2018-04-06 08:17:09.864]        scanning usb for storage devices... 0 
Storage Device(s) found
[2018-04-06 08:17:09.871] U-Boot#


I know that my u-boot version 2014.07 is quite old, but the proc 
musb_generic_disable() in newest version is the same so probably the 
problem also still occures on other boards.

Anyone can verify or confirm that? I'd like to know if this is not 
specific to my board with chiliSOM.
I removed zeroing of DEVCTL register but maybe there is some better 
solution?

Any thoughts?

WK


commit 22447924ca27d3332698d3976f3e5e653bf893cc
Author: Witold Kowolik <sdrb@onet.eu>
Date:   Wed Apr 11 07:49:42 2018 +0200

     ARM: am335x: chiliSOM: Temporary workaround for Mentor OTG USB in 
host mode

     Signed-off-by: Witold Kowolik <sdrb@onet.eu>

diff --git a/drivers/usb/musb-new/musb_core.c 
b/drivers/usb/musb-new/musb_core.c
index 79e118ef85..2be2bd6081 100644
--- a/drivers/usb/musb-new/musb_core.c
+++ b/drivers/usb/musb-new/musb_core.c
@@ -977,7 +977,7 @@ static void musb_generic_disable(struct musb *musb)
  	musb_writew(mbase, MUSB_INTRRXE, 0);

  	/* off */
-	musb_writeb(mbase, MUSB_DEVCTL, 0);
+	/* musb_writeb(mbase, MUSB_DEVCTL, 0); */

  	/*  flush pending interrupts */
  	temp = musb_readb(mbase, MUSB_INTRUSB);

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

end of thread, other threads:[~2018-04-13  9:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11  6:18 [U-Boot] chiliSOM: USB bug sdrb
2018-04-11 16:08 ` Marcin Niestroj
2018-04-12  4:37   ` sdrb
2018-04-12  8:28     ` Marcin Niestrój
2018-04-12  9:09       ` sdrb
2018-04-12 11:05         ` Marcin Niestroj
2018-04-12 11:35           ` sdrb
2018-04-13  7:56             ` Marcin Niestroj
2018-04-13  9:12               ` sdrb
2018-04-13  9:42                 ` Marcin Niestroj

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.