Message ID | 20230927164222.3505-2-jszhang@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2770416vqu; Wed, 27 Sep 2023 10:05:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErIo7CqfLmz3duAWQccjiQAHrbefIfNN9ZG6tMxfzoeD1nqrZ9nejd7xjLrJThRl0qwicm X-Received: by 2002:a17:902:d2c9:b0:1c3:e2eb:f79d with SMTP id n9-20020a170902d2c900b001c3e2ebf79dmr11532813plc.8.1695834312783; Wed, 27 Sep 2023 10:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695834312; cv=none; d=google.com; s=arc-20160816; b=EsuduGwZ6zVv37KP4gFeTkIhgN0VH7ipGCPyJKAgv6Ex5oMrc6l0IKs7SsJsB4dkMK Y888pYBa0cVPSYc+Xh8RIgb6B0TEyysnA09q2pCx0ca38e2zQl5aP6Y8qN6+/7qUNTJ3 bmShgMmXAB+a8OdK7RzkkQrb8x5CmxuHP2t2WONEcrFRU6W+kK/b0/jfvJmIkGN/HC+P d0LSnv+w3VLTpueppF0iQsig6sK0nS5Gp+lnqUkyB8zf52ut0T5+ech+uQdVFYQpNPiq PgVTqNatFweVrEA5wKbF6q/1e8WaWUPnhYDmrd4b20CBlGptPtAEahrnchkGcZ+5lie6 x+ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4IEDXa4FytP4wXDVnIVUv/n7+wyXNdt7qlLYRDfXDh0=; fh=l0j/sX16vfpi/oZ3zuhFuzonJ7kkautdUXCrc1sjEAM=; b=xwcDL/Egvs5M1Z67GcqEQTz2uikulS7c9mQuBq5nAYmpqG1VlUV9UXmSjbFEwuMxWp hZmryvE8aAwf2h8Wk+DWhq5pKruwHKF9UljiVDZklE11kJNuzlwJ9sOC9sY4I43gXWUm 0ZzxzaXdvIkutFQ+vY+gYP4CbzO4Li4/LYhgWYZWpOeEeJR1BVetG6e4YVS7dRtcpzej ESFs0xknqykFxA0o5mwBUISrfrI6vEXUHkL6zjtlARilI3z+kqRGkF173kGxWum0ddFh jvirAZV29w1+BmkwZdGPY0/SAK6GX0siHAX+2sGMAerM78+mLuk73NfXc0/FSMF0udAP BlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OS6UKmOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ik12-20020a170902ab0c00b001c60c5bbff2si9354098plb.201.2023.09.27.10.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 10:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OS6UKmOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 444EF8246962; Wed, 27 Sep 2023 09:54:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229527AbjI0Qyb (ORCPT <rfc822;ruipengqi7@gmail.com> + 19 others); Wed, 27 Sep 2023 12:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjI0Qy3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 27 Sep 2023 12:54:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19DD591 for <linux-kernel@vger.kernel.org>; Wed, 27 Sep 2023 09:54:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3815BC433C8; Wed, 27 Sep 2023 16:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695833667; bh=OWCmuPebvFogsaXQ+UWO53mmD8IYPbNXCEUOxHi0SX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OS6UKmOIJ/EdftafGfIt8QW4UBwispRhzODgAANJ7P8uch/3it1bBEZWsLLigHDWD zyjsBBapu3BDfr6Iszc4lUfcX1l5hwuHHagsjSiY25YT71V0mX53itbjZjYG/UDCCH /h/y7TOD7R6dV+WE6mPfpwEMhgEOeGshLQ9CY6fIV+I9P5o+MCjXD4SE6rWu5cAMXk rhJFkRpJbU8XJrjlVEKIfKjuUzYluje1/CETC0vP6ILLDEPXvolfdsHdGPGOI2H1AD JWNOai2dCtkM+pSx3elaxzamyUpsoNNdG36u7/As+zMrOt9a/ECzE9PQgOwCesCXrg YJH3WiMIm7j9A== From: Jisheng Zhang <jszhang@kernel.org> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Thinh Nguyen <Thinh.Nguyen@synopsys.com> Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Guo Ren <guoren@kernel.org>, Fu Wei <wefu@redhat.com>, linux-riscv@lists.infradead.org Subject: [PATCH 1/2] dt-bindings: usb: Add T-HEAD TH1520 USB controller Date: Thu, 28 Sep 2023 00:42:21 +0800 Message-Id: <20230927164222.3505-2-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230927164222.3505-1-jszhang@kernel.org> References: <20230927164222.3505-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:54:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778211160404183357 X-GMAIL-MSGID: 1778211160404183357 |
Series |
usb: dwc3: add driver for T-HEAD TH1520 SoC
|
|
Commit Message
Jisheng Zhang
Sept. 27, 2023, 4:42 p.m. UTC
T-HEAD TH1520 platform's USB has a wrapper module around
the DesignWare USB3 DRD controller. Add binding information doc for
it.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
.../bindings/usb/thead,th1520-usb.yaml | 73 +++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml
Comments
On 2023-09-27 11:42 AM, Jisheng Zhang wrote: > T-HEAD TH1520 platform's USB has a wrapper module around > the DesignWare USB3 DRD controller. Add binding information doc for > it. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > .../bindings/usb/thead,th1520-usb.yaml | 73 +++++++++++++++++++ > 1 file changed, 73 insertions(+) > create mode 100644 Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > > diff --git a/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml b/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > new file mode 100644 > index 000000000000..afb618eb5013 > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > @@ -0,0 +1,73 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/usb/thead,th1520-usb.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: T-HEAD TH1520 DWC3 USB Controller Glue > + > +maintainers: > + - Jisheng Zhang <jszhang@kernel.org> > + > +properties: > + compatible: > + const: thead,th1520-usb > + > + reg: > + maxItems: 1 > + > + clocks: > + maxItems: 4 > + > + clock-names: > + items: > + - const: ref > + - const: bus_early > + - const: phy > + - const: suspend Except for "phy", these clocks are already documented in snps,dwc3.yaml. Are they necessary for the glue/PHY, or do they belong only in the controller node? They are not used by the driver in patch 2. Also, the PHY clock probably belongs with the PHY node. > + > + ranges: true > + > + '#address-cells': > + enum: [ 1, 2 ] > + > + '#size-cells': > + enum: [ 1, 2 ] > + > +# Required child node: > + > +patternProperties: > + "^usb@[0-9a-f]+$": > + $ref: snps,dwc3.yaml# > + > +required: > + - compatible > + - reg > + - clocks > + - clock-names > + - ranges > + > +additionalProperties: false The driver in patch 2 uses the thead,misc-sysreg and vbus-supply properties, neither of which is documented here. Also, depending on the other bindings, the VBUS supply should be referenced from the USB PHY or connector node, not here. Regards, Samuel > +examples: > + - | > + > + usb { > + compatible = "thead,th1520-usb"; > + reg = <0xec03f000 0x1000>; > + clocks = <&clk 1>, > + <&clk 2>, > + <&clk 3>, > + <&clk 4>; > + clock-names = "ref", "bus_early", "phy", "suspend"; > + ranges; > + #address-cells = <1>; > + #size-cells = <1>; > + > + usb@e7040000 { > + compatible = "snps,dwc3"; > + reg = <0xe7040000 0x10000>; > + interrupts = <68>; > + dr_mode = "host"; > + }; > + };
On 27/09/2023 18:42, Jisheng Zhang wrote: > T-HEAD TH1520 platform's USB has a wrapper module around > the DesignWare USB3 DRD controller. Add binding information doc for > it. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- ... > + > + '#address-cells': > + enum: [ 1, 2 ] > + > + '#size-cells': > + enum: [ 1, 2 ] > + > +# Required child node: > + > +patternProperties: > + "^usb@[0-9a-f]+$": > + $ref: snps,dwc3.yaml# > + > +required: > + - compatible > + - reg > + - clocks > + - clock-names > + - ranges > + > +additionalProperties: false > + > +examples: > + - | > + Drop stray blank line > + usb { > + compatible = "thead,th1520-usb"; Use 4 spaces for example indentation. > + reg = <0xec03f000 0x1000>; > + clocks = <&clk 1>, > + <&clk 2>, > + <&clk 3>, > + <&clk 4>; > + clock-names = "ref", "bus_early", "phy", "suspend"; > + ranges; Are you sure you do not have W=1 warnings in DTS? Best regards, Krzysztof
On Thu, 28 Sep 2023 00:42:21 +0800, Jisheng Zhang wrote: > T-HEAD TH1520 platform's USB has a wrapper module around > the DesignWare USB3 DRD controller. Add binding information doc for > it. > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > --- > .../bindings/usb/thead,th1520-usb.yaml | 73 +++++++++++++++++++ > 1 file changed, 73 insertions(+) > create mode 100644 Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: Documentation/devicetree/bindings/usb/thead,th1520-usb.example.dts:25.13-43.11: Warning (unit_address_vs_reg): /example-0/usb: node has a reg or ranges property, but no unit name doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230927164222.3505-2-jszhang@kernel.org The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On 28/09/2023 07:21, Krzysztof Kozlowski wrote: > Drop stray blank line > >> + usb { >> + compatible = "thead,th1520-usb"; > > Use 4 spaces for example indentation. > >> + reg = <0xec03f000 0x1000>; >> + clocks = <&clk 1>, >> + <&clk 2>, >> + <&clk 3>, >> + <&clk 4>; >> + clock-names = "ref", "bus_early", "phy", "suspend"; >> + ranges; > > Are you sure you do not have W=1 warnings in DTS? Ah, as we can see from bot's report, you have warnings. Please test your DTS with dtbs_check W=1 and fix all (*ALL*) warnings. This looks like missing proper addresses in the ranges. Best regards, Krzysztof
On Wed, Sep 27, 2023 at 03:00:59PM -0500, Samuel Holland wrote: > On 2023-09-27 11:42 AM, Jisheng Zhang wrote: > > T-HEAD TH1520 platform's USB has a wrapper module around > > the DesignWare USB3 DRD controller. Add binding information doc for > > it. > > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org> > > --- > > .../bindings/usb/thead,th1520-usb.yaml | 73 +++++++++++++++++++ > > 1 file changed, 73 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > > > > diff --git a/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml b/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > > new file mode 100644 > > index 000000000000..afb618eb5013 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml > > @@ -0,0 +1,73 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/usb/thead,th1520-usb.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: T-HEAD TH1520 DWC3 USB Controller Glue > > + > > +maintainers: > > + - Jisheng Zhang <jszhang@kernel.org> > > + > > +properties: > > + compatible: > > + const: thead,th1520-usb > > + > > + reg: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 4 > > + > > + clock-names: > > + items: > > + - const: ref > > + - const: bus_early > > + - const: phy > > + - const: suspend > > Except for "phy", these clocks are already documented in snps,dwc3.yaml. Are > they necessary for the glue/PHY, or do they belong only in the controller node? Hi Samuel, Enabling ref, bus_early clks are necessary for the glue layer, because we program the glue registers before calling of_platform_populate() > They are not used by the driver in patch 2. Also, the PHY clock probably belongs > with the PHY node. Except enabling the phy clk, we don't need to touch the phy, so I'm not sure how to handle this if we have a dedicated phy driver thus a phy node. or use the usb-nop-xceiv? Thanks > > > + > > + ranges: true > > + > > + '#address-cells': > > + enum: [ 1, 2 ] > > + > > + '#size-cells': > > + enum: [ 1, 2 ] > > + > > +# Required child node: > > + > > +patternProperties: > > + "^usb@[0-9a-f]+$": > > + $ref: snps,dwc3.yaml# > > + > > +required: > > + - compatible > > + - reg > > + - clocks > > + - clock-names > > + - ranges > > + > > +additionalProperties: false > > The driver in patch 2 uses the thead,misc-sysreg and vbus-supply properties, > neither of which is documented here. Also, depending on the other bindings, the > VBUS supply should be referenced from the USB PHY or connector node, not here. > > Regards, > Samuel > > > +examples: > > + - | > > + > > + usb { > > + compatible = "thead,th1520-usb"; > > + reg = <0xec03f000 0x1000>; > > + clocks = <&clk 1>, > > + <&clk 2>, > > + <&clk 3>, > > + <&clk 4>; > > + clock-names = "ref", "bus_early", "phy", "suspend"; > > + ranges; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + > > + usb@e7040000 { > > + compatible = "snps,dwc3"; > > + reg = <0xe7040000 0x10000>; > > + interrupts = <68>; > > + dr_mode = "host"; > > + }; > > + }; >
diff --git a/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml b/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml new file mode 100644 index 000000000000..afb618eb5013 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/thead,th1520-usb.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/thead,th1520-usb.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: T-HEAD TH1520 DWC3 USB Controller Glue + +maintainers: + - Jisheng Zhang <jszhang@kernel.org> + +properties: + compatible: + const: thead,th1520-usb + + reg: + maxItems: 1 + + clocks: + maxItems: 4 + + clock-names: + items: + - const: ref + - const: bus_early + - const: phy + - const: suspend + + ranges: true + + '#address-cells': + enum: [ 1, 2 ] + + '#size-cells': + enum: [ 1, 2 ] + +# Required child node: + +patternProperties: + "^usb@[0-9a-f]+$": + $ref: snps,dwc3.yaml# + +required: + - compatible + - reg + - clocks + - clock-names + - ranges + +additionalProperties: false + +examples: + - | + + usb { + compatible = "thead,th1520-usb"; + reg = <0xec03f000 0x1000>; + clocks = <&clk 1>, + <&clk 2>, + <&clk 3>, + <&clk 4>; + clock-names = "ref", "bus_early", "phy", "suspend"; + ranges; + #address-cells = <1>; + #size-cells = <1>; + + usb@e7040000 { + compatible = "snps,dwc3"; + reg = <0xe7040000 0x10000>; + interrupts = <68>; + dr_mode = "host"; + }; + };