Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4796723ybp; Mon, 7 Oct 2019 14:11:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTndP0g4aKKYD8gTHxcnaq5zTPg9ceMSsAl4DkyZ3KfkkgnYkohTGdOxqm0p5m+GEw51Wu X-Received: by 2002:a50:ef02:: with SMTP id m2mr31145299eds.157.1570482715264; Mon, 07 Oct 2019 14:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570482715; cv=none; d=google.com; s=arc-20160816; b=sT6VCLR2R+4nzdxPLkgCrlXJM+qGj8pB8SGxAA7nr8LrLf+xSg/4wCsQTkSCNKcH/A yqEuUhoTUdxQrxDhocdPqwf6uPdpJeSQCcIh9+9YzivcnjD2WQGBU92W074OTl6zgR6t 57oQbNcCeslr14i+pI12l5SxWhNyI76NplaoSgksB+1wzURDU944we6bZS5RMc2skLa0 dVgFi7kU5rmxmhvBFwm6M7cgwivBQTgKqKnwS0UQtNtSjfN2S0jXANj1hS4fKA/JBS+H xX2y/yoqy3WX9WUfZ+WTTCxZnDkz7P5+PRbVpAR/d4MW6jQ9xVWvkPaNKQiom+uc+XU8 tFQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3JbyXdqVN4J/90gFVdEf46vBqjY0yHuaVt2l0tSTgyg=; b=GGEZdXMaZ+8UcSVfRQJjHVTittWCIBP4EpkcHbz461P/PCcmjtEV6Hl1Q/0B2J79fG yaqtM0eDp1d/zYP3AThoK12jf5BfiUnUVfG6V6hfBwl9/kuH9+TZOO2QQHz6vhz46k1R dUAoVou4BJsc988bdsvej8bFn63cPzl1gzLmGp1rbHEWgkVkMALli3pZWOh5Jk7DO8Jg oGyBI6jlj5jhxEHy/i7EBJAcuFWgHybeoe2DJEEJHcXkQUFrHfUzq6Z/JtDtpIiyAtmI 4sXDYW8+/ov1BsEYtgmSpZSgI4ed3+NPfitzUuQxCgoMdfNmJ75XbGiy5CJMjR6DJ5IC cW9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MqnJMCvI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14si9267417ede.421.2019.10.07.14.11.30; Mon, 07 Oct 2019 14:11:55 -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; dkim=pass header.i=@kernel.org header.s=default header.b=MqnJMCvI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729005AbfJGVLR (ORCPT + 99 others); Mon, 7 Oct 2019 17:11:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728273AbfJGVLR (ORCPT ); Mon, 7 Oct 2019 17:11:17 -0400 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A95321871; Mon, 7 Oct 2019 21:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570482675; bh=2++8T5z+QfZLxrx0+JY4Ig6nJlGMQTg7pMrbsTi8s/A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MqnJMCvIdq80J7Il5BK3z4Hl/Rjz0FvDiuBTyPxi1L/hJdXCjTadbkoZzujx+rP5i lboI8E810fgzQpg7RhEyqt7H/YOS+BHlBnKfYDSLNZdwRL5Tmr7JjhO1Lf2A7Y9Dy6 8qi++nUKNtWLv6HGtIhG6oqo+fgIj3YKezVgUrB0= Received: by mail-qt1-f172.google.com with SMTP id o12so21414190qtf.3; Mon, 07 Oct 2019 14:11:15 -0700 (PDT) X-Gm-Message-State: APjAAAW/6LPeMArZ4m7LwDFARoaovbjtDFJEx0j2kDu4pdeMkZa8SNZn gXMSLVCX3+qRvbjB3/uZ+9nrDUrY134UDsZ1RQ== X-Received: by 2002:a05:6214:1590:: with SMTP id m16mr29194689qvw.20.1570482674220; Mon, 07 Oct 2019 14:11:14 -0700 (PDT) MIME-Version: 1.0 References: <20191007175553.66940-1-john.stultz@linaro.org> <20191007175553.66940-5-john.stultz@linaro.org> In-Reply-To: From: Rob Herring Date: Mon, 7 Oct 2019 16:11:02 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH v2 4/5] dt-bindings: usb: dwc3: of-simple: add compatible for HiSi To: John Stultz Cc: lkml , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Mark Rutland , Yu Chen , Matthias Brugger , Chunfeng Yun , Linux USB List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 7, 2019 at 2:07 PM John Stultz wrote: > > On Mon, Oct 7, 2019 at 11:38 AM Rob Herring wrote: > > > > On Mon, Oct 7, 2019 at 12:56 PM John Stultz wrote: > > > > > > Add necessary compatible flag for HiSi's DWC3 so > > > dwc3-of-simple will probe. > > > > > > Cc: Greg Kroah-Hartman > > > Cc: Felipe Balbi > > > Cc: Andy Shevchenko > > > Cc: Rob Herring > > > Cc: Mark Rutland > > > Cc: Yu Chen > > > Cc: Matthias Brugger > > > Cc: Chunfeng Yun > > > Cc: linux-usb@vger.kernel.org > > > Cc: devicetree@vger.kernel.org > > > Signed-off-by: John Stultz > > > --- > > > v2: Tweaked clock names as clk_usb3phy_ref didn't seem right. > > > --- > > > .../devicetree/bindings/usb/hisi,dwc3.txt | 52 +++++++++++++++++++ > > > 1 file changed, 52 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/usb/hisi,dwc3.txt > > > > Can you make this a schema. > > Sorry, I'm not sure exactly what you're asking. I'm guessing from > grepping around you want the bindings in yaml instead (I see a few > examples)? Yes. > Is there some pointer to documentation? The > Documentation/devicetree/bindings/writing-bindings.txt file doesn't > seem to say much on it. You mean Documentation/devicetree/writing-schemas.rst? There's that and Documentation/devicetree/bindings/example-schema.yaml which has a bunch of annotations on what each part means. > > > diff --git a/Documentation/devicetree/bindings/usb/hisi,dwc3.txt b/Documentation/devicetree/bindings/usb/hisi,dwc3.txt > > > new file mode 100644 > > > index 000000000000..3a3e5c320f2a > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/usb/hisi,dwc3.txt > > > @@ -0,0 +1,52 @@ > > > +HiSi SuperSpeed DWC3 USB SoC controller > > > + > > > +Required properties: > > > +- compatible: should contain "hisilicon,hi3660-dwc3" for HiSi SoC > > > +- clocks: A list of phandle + clock-specifier pairs for the > > > + clocks listed in clock-names > > > +- clock-names: Should contain the following: > > > + "clk_abb_usb" USB reference clk Probably 'ref' from dwc3.txt. > > > + "aclk_usb3otg" USB3 OTG aclk 'bus_early'? IIRC, 'aclk' is the clock name for AXI bus clock. > > > + > > > +- assigned-clocks: Should be: > > > + HI3660_ACLK_GATE_USB3OTG > > > +- assigned-clock-rates: Should be: > > > + 229Mhz (229000000) for HI3660_ACLK_GATE_USB3OTG > > > + > > > +Optional properties: > > > +- resets: Phandle to reset control that resets core and wrapper. > > > > Looks like 4 resets though. > > Good point. I'll fix that up. > > > > + > > > +Required child node: > > > +A child node must exist to represent the core DWC3 IP block. The name of > > > +the node is not important. The content of the node is defined in dwc3.txt. > > > + > > > +Example device nodes: > > > + > > > + usb3: hisi_dwc3 { > > > + compatible = "hisilicon,hi3660-dwc3"; > > > + #address-cells = <2>; > > > + #size-cells = <2>; > > > + ranges; > > > + > > > + clocks = <&crg_ctrl HI3660_CLK_ABB_USB>, > > > + <&crg_ctrl HI3660_ACLK_GATE_USB3OTG>; > > > + clock-names = "clk_abb_usb", "aclk_usb3otg"; > > > + > > > + assigned-clocks = <&crg_ctrl HI3660_ACLK_GATE_USB3OTG>; > > > + assigned-clock-rates = <229 000 000>; > > > + resets = <&crg_rst 0x90 8>, > > > + <&crg_rst 0x90 7>, > > > + <&crg_rst 0x90 6>, > > > + <&crg_rst 0x90 5>; > > > + > > > + dwc3: dwc3@ff100000 { > > > > If it's only clocks and resets for the wrapper node, just make this > > all one node. > > Just to make sure I'm following, you're suggesting I put all the > clocks/resets in the dwc3 node (renamed to usb for the node name) and > not add the wrapper? Yes. > I'll have to see if that's possible. The generic dwc3 binding wants 3 > clocks, but I only have two in the code I've worked with (similarly it > seems to only want two resets, not 4) so I'll have to see if I can > figure out how to adapt that. Possible since commit fe8abf332b8f ("usb: dwc3: support clocks and resets for DWC3 core"). > > If that approach is preferred, do I also no longer need a separate > binding document/schema? Correct. And then no need to convert to schema yet (though feel free to convert dwc3.txt :)). Rob