Received: by 10.192.165.148 with SMTP id m20csp834602imm; Wed, 25 Apr 2018 08:22:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx48g0NkvZ2Ql9HkIXQ5pFyUtxDW/3IqTBljks0u5arLGVQji7i2y31BrtexWEBy8if9sPiBe X-Received: by 10.99.148.1 with SMTP id m1mr24046538pge.140.1524669761329; Wed, 25 Apr 2018 08:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524669761; cv=none; d=google.com; s=arc-20160816; b=u0JvCUmGpKFxlbS/Bn+qYuO8oecEcIuIFfT9YoXMTc4ZbByoxqsKMdIrCr1Qu3fp8t EL5cqj2twUwrTyIY8U2ZlWaYGhf4mC1uoDdESo9WUOdwdat2sql9kqpxvcE3CTVrAmhm dPB4i7e6oP8pl0SqETIbj2abfuO2ZN3pTXwXvQMspRFDBCKQqsuCWaC2/LxY9XoYWx3m /uoPBbZk/XRe0D3i5x2FuCnUplaRVyUp/zFX01PVS2AiBPg9w4bPOIxY7n3G8ExWtMDa QUlHlQyKQO0iPyLjerraPjxZoFFtJX4e8rZTqVUYCOblOZa2Q1R+OxGbAoMvSdHt7AG6 uW1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=KViDUAuA20o1VnT9LAcdqEVXLuNpEPyb45aL2TQiBnY=; b=A7BbBsFyypJMuSkRMvVtWkL2WkveKjvE88u1AfXoPqKNVcuCS2rmbItY95tjfJVqpA up6PCxU5aj3JYhMrG/SdAWBG3d99WjqqYTh403i91y1+ZZ0yykAUQgGUvton0F30EIjj ThsY7RGmKN5o6ppV6al6QDewO5YWKGylUb0x4mQ6+IjpE7xZwwIZS7WdYHz1kgPJZ04t eFE9ynGPZSn7mbi0WRF1P8H0AszS9UXTyCyQMFah634+MArsjv4BkR5emhqwBC42b0Jz 5WuBuuv+Hy4lYSiZTfsxM7gfj5hz+yO8qajlD2Cd0ago6jJahKrkslXEQt29JVHw2pMm tDAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si16084082pll.132.2018.04.25.08.22.26; Wed, 25 Apr 2018 08:22:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754715AbeDYPVT (ORCPT + 99 others); Wed, 25 Apr 2018 11:21:19 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34284 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbeDYPVQ (ORCPT ); Wed, 25 Apr 2018 11:21:16 -0400 Received: by mail-oi0-f65.google.com with SMTP id e23-v6so21207870oiy.1; Wed, 25 Apr 2018 08:21:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KViDUAuA20o1VnT9LAcdqEVXLuNpEPyb45aL2TQiBnY=; b=OMbSvwgSCakCAujLJ2rhDXj6kpOhKiqQFbJUV9jTVuTPiddnRWtOlA7xnX9HxgurkW gUcRXg80onePWqUjYwzM+W4n59aeVfbtUG+ZkNUgPPRXUIU0+OM5j+0XSKjjfNvq3Csg RmAjvgmgi7LHeXMn5r1v8QqieBZwVeOeGTWcitjUXSZMcfYxK9Pu7nQlRXdA7u6sDmp4 abY8ef9JJFrX0hCeeaqjeUpUI0vY5j0sdLBW8L7tRAi3egUyqDlJ+40x/U7olq1Kbyuu F059EzthD3trzrZG7vohQAZVK5tfvMbSBGrXo2Tuv+f5W6MXo7xt4qt3FLJv116g2wmT ZfpA== X-Gm-Message-State: ALQs6tCwX5hitsZfiYBgSBYTK3pDPQP35J/X0c/F2yxq82lTZ41uY1ob YJn7w6RR+t/PjTIMXnu9mw== X-Received: by 2002:aca:5f86:: with SMTP id t128-v6mr17093826oib.148.1524669675757; Wed, 25 Apr 2018 08:21:15 -0700 (PDT) Received: from localhost (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.gmail.com with ESMTPSA id d69-v6sm10453705oih.58.2018.04.25.08.21.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Apr 2018 08:21:15 -0700 (PDT) Date: Wed, 25 Apr 2018 10:21:14 -0500 From: Rob Herring To: Masahiro Yamada Cc: linux-usb@vger.kernel.org, Felipe Balbi , Roger Quadros , Martin Blumenstingl , Masami Hiramatsu , Jassi Brar , Kunihiko Hayashi , devicetree@vger.kernel.org, Felipe Balbi , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Mark Rutland Subject: Re: [PATCH v2 2/2] usb: dwc3: support clocks and resets for DWC3 core Message-ID: <20180425152114.pzklc5uqva3nil5v@rob-hp-laptop> References: <1524135818-14825-1-git-send-email-yamada.masahiro@socionext.com> <1524135818-14825-3-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524135818-14825-3-git-send-email-yamada.masahiro@socionext.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2018 at 08:03:38PM +0900, Masahiro Yamada wrote: > Historically, the clocks and resets are handled on the glue layer > side instead of the DWC3 core. For simple cases, dwc3-of-simple.c > takes care of arbitrary number of clocks and resets. The DT node > structure typically looks like as follows: > > dwc3-glue { > compatible = "foo,dwc3"; > clocks = ...; > resets = ...; > ... > > dwc3 { > compatible = "snps,dwc3"; > ... > }; > } > > By supporting the clocks and the reset in the dwc3/core.c, it will > be turned into a single node: > > dwc3 { > compatible = "foo,dwc3", "snps,dwc3"; > clocks = ...; > resets = ...; > ... > } > > This commit adds the binding of clocks and resets specific to this IP. > The number of clocks should generally be the same across SoCs, it is > just some SoCs either tie clocks together or do not provide software > control of some of the clocks. > > I took the clock names from the Synopsys datasheet: "ref" (ref_clk), > "bus_early" (bus_clk_early), and "suspend" (suspend_clk). > > I found only one reset line in the datasheet, hence the reset-names > property is omitted. > > Supporting those clocks and resets is the requirement for new platforms. > Enforcing the new binding breaks existing platforms since they specify > clocks and resets in their glue layer node, but nothing in the core > node. I listed such exceptional cases in the DT binding. The driver > code is loosened up to accept no clock/reset. This change is based > on the discussion [1]. > > I inserted reset_control_deassert() and clk_bulk_enable() before the > first register access, i.e. dwc3_cache_hwparams(). > > [1] https://patchwork.kernel.org/patch/10284265/ > > Signed-off-by: Masahiro Yamada > --- > > Changes in v2: > - Make clocks specific to this IP based on Synopsys datasheet > - Use clk_bulk API > - Add description to struct header > > Documentation/devicetree/bindings/usb/dwc3.txt | 21 ++++++ > drivers/usb/dwc3/core.c | 89 +++++++++++++++++++++++++- > drivers/usb/dwc3/core.h | 8 +++ > 3 files changed, 116 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt > index 0dbd308..feb1cc33 100644 > --- a/Documentation/devicetree/bindings/usb/dwc3.txt > +++ b/Documentation/devicetree/bindings/usb/dwc3.txt > @@ -7,6 +7,27 @@ Required properties: > - compatible: must be "snps,dwc3" > - reg : Address and length of the register set for the device > - interrupts: Interrupts used by the dwc3 controller. > + - clock-names: should contain "ref", "bus_early", "suspend" > + - clocks: list of phandle and clock specifier pairs corresponding to > + entries in the clock-names property. > + - resets: a single pair of phandle and reset specifier This should be optional as some SoCs don't have separate, s/w controlled resets of modules. Otherise, for the DT binding: Reviewed-by: Rob Herring Rob