From patchwork Wed Sep 21 02:29:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76649 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1793830qgf; Tue, 20 Sep 2016 19:29:24 -0700 (PDT) X-Received: by 10.195.12.230 with SMTP id et6mr22236152wjd.198.1474424964195; Tue, 20 Sep 2016 19:29:24 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id j188si29648651wmf.3.2016.09.20.19.29.23; Tue, 20 Sep 2016 19:29:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DC75B3899; Wed, 21 Sep 2016 04:28:26 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eoAtLNbkz2ed; Wed, 21 Sep 2016 04:28:26 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F1062B3849; Wed, 21 Sep 2016 04:28:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6A0CAB3856 for ; Wed, 21 Sep 2016 04:28:11 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J8OekGFZUA0Z for ; Wed, 21 Sep 2016 04:28:11 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 IN_IX_MANITU=4.35 (only DNSBL check requested) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by theia.denx.de (Postfix) with ESMTPS id DDB0EB3848 for ; Wed, 21 Sep 2016 04:27:49 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u8L2Qube012826; Wed, 21 Sep 2016 11:27:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u8L2Qube012826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474424834; bh=2UpklQJQmtM/NOPH+p0iCl9ViqY8dQ5errLKdkHE6N4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Bi0M6mYKigpgqjXNamHOovHS1y1PQEaWnk0WsNXqTLgMCypWF0bFNHp3bCap9iUF 4ANPBdb8Di7jdR5jidgsJb691ujO78Q7+DDfZrNcDmyb0fvSXZBZsddkMlitnuj5ZL s2fN23YNTcR40hbTeNSBv144/PLAMW7ZQqzaZ0QhhlDUwU2aRknCl3AW9vD3BxZHiv W6buBsZJwWf/0TwTKqWcACxrITS9rpy52V9o4clMenuieHFe24di/cdFIAsAN23E0D EfxJH7059UzYcjAQHxdLeBe36XAvur9FWBwarkpKmFH3f9bWPSYHsvxoYnvIxrx4tQ oONVjcaPd608A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 21 Sep 2016 11:29:02 +0900 Message-Id: <1474424946-16085-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474424946-16085-1-git-send-email-yamada.masahiro@socionext.com> References: <1474424946-16085-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Tom Rini , Alexey Brodkin Subject: [U-Boot] [RESEND PATCH 10/10] usb: ehci-generic: support reset control for generic EHCI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This driver is designed in a generic manner, so resets should be handled generically as well. Signed-off-by: Masahiro Yamada --- drivers/usb/host/ehci-generic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c index e0377ca..34d9f71 100644 --- a/drivers/usb/host/ehci-generic.c +++ b/drivers/usb/host/ehci-generic.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include "ehci.h" @@ -37,6 +38,18 @@ static int ehci_usb_probe(struct udevice *dev) clk_free(&clk); } + for (i = 0; ; i++) { + struct reset_ctl reset; + int ret; + + ret = reset_get_by_index(dev, i, &reset); + if (ret < 0) + break; + if (reset_deassert(&reset)) + printf("failed to deassert reset %d\n", i); + reset_free(&reset); + } + hccr = map_physmem(dev_get_addr(dev), 0x100, MAP_NOCACHE); hcor = (struct ehci_hcor *)((uintptr_t)hccr + HC_LENGTH(ehci_readl(&hccr->cr_capbase)));