From patchwork Wed Sep 21 02:01:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76643 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1783728qgf; Tue, 20 Sep 2016 19:00:55 -0700 (PDT) X-Received: by 10.28.70.70 with SMTP id t67mr648286wma.35.1474423255250; Tue, 20 Sep 2016 19:00:55 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id b11si27122204wjs.147.2016.09.20.19.00.54; Tue, 20 Sep 2016 19:00:55 -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 358B4A7550; Wed, 21 Sep 2016 04:00:44 +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 MENYwSEdaV93; Wed, 21 Sep 2016 04:00:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3AD48B3823; Wed, 21 Sep 2016 04:00:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C458A7534 for ; Wed, 21 Sep 2016 04:00:18 +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 8nJqKvVCzhBx for ; Wed, 21 Sep 2016 04:00:18 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) by theia.denx.de (Postfix) with ESMTPS id 10B2CA752D for ; Wed, 21 Sep 2016 04:00:11 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id u8L1xKJG021633; Wed, 21 Sep 2016 10:59:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com u8L1xKJG021633 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474423176; bh=2UpklQJQmtM/NOPH+p0iCl9ViqY8dQ5errLKdkHE6N4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eVNmRv92czy57n0gA3McczTUv8yI93WYCPQg3b/yOtTaAwHKINpGNMwUdogvXR1Lw QC8lgoC79Iv74zm/8MsDmIg2u5ey8oxFGlq2t+olixi1sf3DVu1VG44wGXsdWbQ1In Ywd9T6O6ss8MeAUMuejvSMOr3Ep5dyDDqHkNtJITrYgkE8khOqAU3V01tl1RJDq+Cd ZsJ8SMprIIYeF1sO/lORWY6vpO4oeGXXPX5NWSGCpHEnVd3pCeZifNzzB2nxkSkeh5 E4AwsYI29Sl4EZWnEQnCWRz8RadutRg2guXVhPkxgvuaOYHaqLOof79LKc7KZFnONV OEs1ZGr1/oqtQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Wed, 21 Sep 2016 11:01:12 +0900 Message-Id: <1474423285-14403-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474423285-14403-1-git-send-email-yamada.masahiro@socionext.com> References: <1474423285-14403-1-git-send-email-yamada.masahiro@socionext.com> Cc: Marek Vasut , Tom Rini , Alexey Brodkin Subject: [U-Boot] [PATCH 8/8] 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)));