From patchwork Sat Apr 9 13:46:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Vailugin X-Patchwork-Id: 608375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qhyKJ74RJz9t6k for ; Sat, 9 Apr 2016 23:46:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex.ru header.i=@yandex.ru header.b=sXUezs/A; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id EAD4EB91776; Sat, 9 Apr 2016 15:46:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=5.0 tests=FREEMAIL_FROM,RDNS_NONE, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Sat, 9 Apr 2016 15:46:05 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 58C50B91773 for ; Sat, 9 Apr 2016 15:46:05 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .yandex. - helo: .forward20h.cmail.yandex. - helo-domain: .yandex.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from forward20h.cmail.yandex.net (unknown [87.250.230.162]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 9 Apr 2016 15:46:03 +0200 (CEST) Received: from web3h.yandex.ru (web3h.yandex.ru [84.201.186.32]) by forward20h.cmail.yandex.net (Yandex) with ESMTP id 2EFAA21128 for ; Sat, 9 Apr 2016 16:46:03 +0300 (MSK) Received: from web3h.yandex.ru (localhost [127.0.0.1]) by web3h.yandex.ru (Yandex) with ESMTP id C794A7282244; Sat, 9 Apr 2016 16:46:02 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1460209562; bh=sVeunibptBvLl4bXHguyPpDA5qPlzpPdBntGT2bS0sE=; h=From:To:Subject:Date; b=sXUezs/AYRbYcmOhcTpmixc6PdmGCY/fsoltDLsyMFVIygi5v2sU9dKN95xr689J0 e/KO1/jCLiMTeBlCpZWdcRaCNV6n86ZGuCEzSXgcK71aufjMABWiIY7lBMyLd4wZia jA9pwVcsUbk9c3O7gOLuas8pyWqMHvVbZdcbFq3Y= Received: by web3h.yandex.ru with HTTP; Sat, 09 Apr 2016 16:46:02 +0300 From: =?koi8-r?B?88XSx8XKIPfB08nMwMfJzg==?= To: OpenWrt Development List MIME-Version: 1.0 Message-Id: <6453381460209562@web3h.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 09 Apr 2016 19:46:02 +0600 Subject: [OpenWrt-Devel] [RFC] ramips: awake rt305x USB controller X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Long story of rt305x USB controller feature [1] arise again in trunk [2]. I make quick fix but not sure that it's correct. Possiblely it's time to reanimate device_reset() patch? Signed-Off-By: Serge Vasilugin [1] http://marc.info/?l=linux-usb&m=137398626102108&w=2 [2] https://dev.openwrt.org/ticket/21396 [3] https://dev.openwrt.org/changeset/42445 --- serge --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c @@ -375,6 +375,12 @@ static int dwc2_driver_probe(struct plat dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n", (unsigned long)res->start, hsotg->regs); + /* Enable USB port before any regs access */ + if(dwc2_readl(hsotg->regs + PCGCTL) & 0x0f) { + dwc2_writel(0x00, hsotg->regs + PCGCTL); + /* TODO: mdelay(25) here? vendor driver don't use it */ + } + hsotg->dr_mode = usb_get_dr_mode(&dev->dev); if (IS_ENABLED(CONFIG_USB_DWC2_HOST) && hsotg->dr_mode != USB_DR_MODE_HOST) {