[U-Boot] chiliSOM: USB bug

sdrb sdrb at onet.eu
Wed Apr 11 06:18:39 UTC 2018


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 at 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 at 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);



More information about the U-Boot mailing list