All of lore.kernel.org
 help / color / mirror / Atom feed
From: sdrb <sdrb@onet.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot]  chiliSOM: USB bug
Date: Wed, 11 Apr 2018 08:18:39 +0200	[thread overview]
Message-ID: <9ce549aa-79a9-81e4-b569-b9a5d574850d@onet.eu> (raw)

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

             reply	other threads:[~2018-04-11  6:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11  6:18 sdrb [this message]
2018-04-11 16:08 ` [U-Boot] chiliSOM: USB bug 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ce549aa-79a9-81e4-b569-b9a5d574850d@onet.eu \
    --to=sdrb@onet.eu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.