From patchwork Wed Apr 11 06:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WK X-Patchwork-Id: 897201 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=onet.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=onet.eu header.i=@onet.eu header.b="RRlRUDTv"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40LmQg400Dz9s1j for ; Thu, 12 Apr 2018 00:20:11 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9A83FC21D8A; Wed, 11 Apr 2018 14:20:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C49E6C21C38; Wed, 11 Apr 2018 14:20:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BE544C21C2F; Wed, 11 Apr 2018 06:18:42 +0000 (UTC) Received: from smtpo112.poczta.onet.pl (smtpo77.poczta.onet.pl [141.105.16.27]) by lists.denx.de (Postfix) with ESMTPS id 7AB2CC21C2C for ; Wed, 11 Apr 2018 06:18:42 +0000 (UTC) Received: from [192.168.1.146] (87-204-112-33.static.ip.netia.com.pl [87.204.112.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sdrb@onet.eu) by smtp.poczta.onet.pl (Onet) with ESMTPSA id 40LYl36lN7z18XdZG for ; Wed, 11 Apr 2018 08:18:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onet.eu; s=2011; t=1523427519; bh=OPEnnMFhmf5IszY34DzlQyVkI7NTEAizZFltabJ7Q7k=; h=To:From:Subject:Date:From; b=RRlRUDTvsCUg0uVYYSC6wfbKHCljNzB0nNwwOv/FAiBQWNTNzEBw1QyVpOVswXd6s 7KXjlxM92u894lBxOsuxqLRVFZltMO9j22/e7+Ftu6gLd7N0YpAqF0otk1KdyXTpcL fEALQ11+1kwKuQSxVdqxx+2l0OPPYGMZbvkfk2rM= To: u-boot@lists.denx.de From: sdrb Message-ID: <9ce549aa-79a9-81e4-b569-b9a5d574850d@onet.eu> Date: Wed, 11 Apr 2018 08:18:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 11 Apr 2018 14:20:03 +0000 Subject: [U-Boot] chiliSOM: USB bug X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "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 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 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);