Message ID | 20230728035318.18741-2-stanley_chang@realtek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp186067vqg; Thu, 27 Jul 2023 21:22:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGUw+2Vwoz4/QuUQWFUlyCs3A5VupJ3fFZHbP3vRQkf/w/tNjMBAMG/Yr2CViyGoUqJ+txE X-Received: by 2002:a05:6a00:2e04:b0:682:57f0:7c0e with SMTP id fc4-20020a056a002e0400b0068257f07c0emr981542pfb.11.1690518165231; Thu, 27 Jul 2023 21:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690518165; cv=none; d=google.com; s=arc-20160816; b=cZtD+nYOiZw9A77J9OzvrkkauzFpkRF8dEk2HY1ubjcld5064vexR3eLHAm/U98gUc X/E7uEnmjxcxLVKAjmRODlACoux5LdQketnYJoaYtA4hJm7CeDyFfpzZVdFveKC7A3RG B97PIs/vxlCSVjpHLmYqsvBvJBp84/3+JwkKgzotUTKSRFB0e/6te344wiBxXIOx8O+Z MKGZ7X4stj9MFO4W7Q3fEPaoC7pWm+sGuxDbWik0A2rq0LVgijqvzlLkhT/ldO38tsBV z+qL3N6a5jS88Zb1IoJDPv25D6I5Pxvtwfylp++hS550xxmvGptStTpnCZvJ2pY6OtIV W+uQ== 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 :authenticated-by; bh=cgxtD3ZV1z1zYWk4FFJu/MIpUxDDBi3hXrfm6nD/ucQ=; fh=13mI/TgfHLysivpEIxYeiinthNQlMs4IC27qKAvUe8c=; b=DFSrbxH8bEN10iaKQ+MC0LxATT6V/o1AqzgoGkM6Hn43Fn8LhaomTyRn0xRe8IVyuF VJQfOKsimKeyy6XZw/M1JgSA6a13ZI2NR15snpUV3PF8/Me4FVimxirXV6wQdI6FhZMR M4PM7JadzCEOq7prr9bp0UboOx8iN2qL50eeBPysm6xC01wCc2nbUv2d7CdImhdG36Bu 2g81Ia4qNvWtKdLbWACIeFmPltIhztnWYtHBSuW0VdjkrhdSyTD6ZgjXPOclo8pn7ALT ZRc/uyTSOA4/uQGVGfUayCwkzyoccXv9DMUptmH25tsUfgIwNUtNihFkZQZltsl/dGTJ vH/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h16-20020a633850000000b00563d74b6350si676789pgn.737.2023.07.27.21.22.31; Thu, 27 Jul 2023 21:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233221AbjG1Dxn (ORCPT <rfc822;hanasaki@gmail.com> + 99 others); Thu, 27 Jul 2023 23:53:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbjG1Dxh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Jul 2023 23:53:37 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD3B02D64; Thu, 27 Jul 2023 20:53:34 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 36S3r8jQ5023535, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 36S3r8jQ5023535 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Fri, 28 Jul 2023 11:53:08 +0800 Received: from RTEXMBS03.realtek.com.tw (172.21.6.96) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 28 Jul 2023 11:53:20 +0800 Received: from RTEXH36506.realtek.com.tw (172.21.6.27) by RTEXMBS03.realtek.com.tw (172.21.6.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 28 Jul 2023 11:53:20 +0800 Received: from localhost.localdomain (172.21.252.101) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Fri, 28 Jul 2023 11:53:20 +0800 From: Stanley Chang <stanley_chang@realtek.com> To: Thinh Nguyen <Thinh.Nguyen@synopsys.com> CC: Stanley Chang <stanley_chang@realtek.com>, 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>, <linux-usb@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v1 2/2] doc: dt: bindings: usb: realtek,dwc3: Add Realtek DHC RTD SoC DWC3 USB Date: Fri, 28 Jul 2023 11:53:13 +0800 Message-ID: <20230728035318.18741-2-stanley_chang@realtek.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230728035318.18741-1-stanley_chang@realtek.com> References: <20230728035318.18741-1-stanley_chang@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-KSE-ServerInfo: RTEXMBS03.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772636775551133094 X-GMAIL-MSGID: 1772636775551133094 |
Series |
[v1,1/2] usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer driver
|
|
Commit Message
Stanley Chang[昌育德]
July 28, 2023, 3:53 a.m. UTC
Document the DWC3 USB bindings for Realtek SoCs.
Signed-off-by: Stanley Chang <stanley_chang@realtek.com>
---
.../devicetree/bindings/usb/realtek,dwc3.yaml | 107 ++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/realtek,dwc3.yaml
Comments
On 28/07/2023 05:53, Stanley Chang wrote: > Document the DWC3 USB bindings for Realtek SoCs. Please use subject prefixes matching the subsystem. You can get them for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching. My filtering of emails depends on it. > > Signed-off-by: Stanley Chang <stanley_chang@realtek.com> > --- > .../devicetree/bindings/usb/realtek,dwc3.yaml | 107 ++++++++++++++++++ > 1 file changed, 107 insertions(+) > create mode 100644 Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > > diff --git a/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml realtek,rtd-dwc3.yaml > new file mode 100644 > index 000000000000..74d388809924 > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > @@ -0,0 +1,107 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +# Copyright 2023 Realtek Semiconductor Corporation > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/usb/realtek,dwc3.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" Drop quotes. Wasn't tested, because dtschema reports warnings here... > + > +title: Realtek DWC3 USB SoC Controller Glue > + > +maintainers: > + - Stanley Chang <stanley_chang@realtek.com> > + > +description: > + The Realtek DHC SoC embeds a DWC3 USB IP Core configured for USB 2.0 > + and USB 3.0 in host or dual-role mode. > + > +properties: > + compatible: > + items: > + - enum: > + - realtek,rtd1295-dwc3 > + - realtek,rtd1315e-dwc3 > + - realtek,rtd1319-dwc3 > + - realtek,rtd1319d-dwc3 > + - realtek,rtd1395-dwc3 > + - realtek,rtd1619-dwc3 > + - realtek,rtd1619b-dwc3 > + - const: realtek,rtd-dwc3 > + > + reg: > + maxItems: 1 > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 1 > + > + ranges: true > + > + realtek,unlink-usb3-port: > + description: Disable link between USB 3.0 PHY and USB mac. > + Only for RTD1619 SoC, if the board design support maximum 2.0 speed. > + type: boolean > + > + realtek,disable-usb3-phy: > + description: Close USB 3.0 PHY if the board design not support USB 3.0. > + type: boolean > + > + realtek,enable-l4icg: > + description: Enable the power saving feature l4icg by hardware clock. > + gating. You described the desired Linux feature or behavior, not the actual hardware. The bindings are about the latter, so instead you need to rephrase the property and its description to match actual hardware capabilities/features/configuration etc. > + type: boolean > + > +patternProperties: > + "^usb@[0-9a-f]+$": > + $ref: snps,dwc3.yaml# > + description: Required child node > + > +required: > + - compatible > + - reg > + - "#address-cells" > + - "#size-cells" > + - ranges > + > +allOf: > + - if: > + not: > + properties: > + compatible: > + contains: > + enum: > + - realtek,rtd1619-dwc3 > + then: > + properties: > + realtek,unlink-usb3-port: false > + > +additionalProperties: false > + > +examples: > + - | > + usb@98013e00 { > + compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; > + reg = <0x98013e00 0x200>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + status = "okay"; Drop status. > + realtek,disable-usb3-phy; > + realtek,enable-l4icg; > + > + usb@98050000 { > + compatible = "snps,dwc3"; > + reg = <0x98050000 0x9000>; > + interrupts = <0 94 4>; > + phys = <&usb2phy &usb3phy>; > + phy-names = "usb2-phy", "usb3-phy"; > + dr_mode = "otg"; > + usb-role-switch; > + role-switch-default-mode = "host"; > + snps,dis_u2_susphy_quirk; > + snps,parkmode-disable-ss-quirk; > + snps,parkmode-disable-hs-quirk; > + maximum-speed = "high-speed"; > + }; > + }; Best regards, Krzysztof
Hi Krzysztof, > Subject: Re: [PATCH v1 2/2] doc: dt: bindings: usb: realtek,dwc3: Add Realtek > DHC RTD SoC DWC3 USB > > On 28/07/2023 05:53, Stanley Chang wrote: > > Document the DWC3 USB bindings for Realtek SoCs. > > Please use subject prefixes matching the subsystem. You can get them for > example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your > patch is touching. > > My filtering of emails depends on it. I will revise the subject. > > diff --git a/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > > b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > > realtek,rtd-dwc3.yaml I will rename this file. > > +$id: "http://devicetree.org/schemas/usb/realtek,dwc3.yaml#" > > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > > Drop quotes. Wasn't tested, because dtschema reports warnings here... Okay, I will drop it. > > + realtek,unlink-usb3-port: > > + description: Disable link between USB 3.0 PHY and USB mac. > > + Only for RTD1619 SoC, if the board design support maximum 2.0 > speed. > > + type: boolean > > + > > + realtek,disable-usb3-phy: > > + description: Close USB 3.0 PHY if the board design not support USB 3.0. > > + type: boolean > > + > > + realtek,enable-l4icg: > > + description: Enable the power saving feature l4icg by hardware clock. > > + gating. > > You described the desired Linux feature or behavior, not the actual hardware. > The bindings are about the latter, so instead you need to rephrase the property > and its description to match actual hardware > capabilities/features/configuration etc. The l4icg entry is a hardware feature for power saving. The term may not clearly convey the function. So instead of the term "l4icg" I use "hw clock gating". realtek,enable-hw-clock-gating: description: Enable the clock gated function which will gating sram clock when dbus idle. > > +examples: > > + - | > > + usb@98013e00 { > > + compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; > > + reg = <0x98013e00 0x200>; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges; > > + status = "okay"; > > Drop status. > Okay. Thanks, Stanley
On 28/07/2023 19:37, Stanley Chang[昌育德] wrote: >>> + >>> + realtek,disable-usb3-phy: >>> + description: Close USB 3.0 PHY if the board design not support USB 3.0. >>> + type: boolean >>> + >>> + realtek,enable-l4icg: >>> + description: Enable the power saving feature l4icg by hardware clock. >>> + gating. >> >> You described the desired Linux feature or behavior, not the actual hardware. >> The bindings are about the latter, so instead you need to rephrase the property >> and its description to match actual hardware >> capabilities/features/configuration etc. > > The l4icg entry is a hardware feature for power saving. > The term may not clearly convey the function. > So instead of the term "l4icg" I use "hw clock gating". > > realtek,enable-hw-clock-gating: > description: Enable the clock gated function which will gating sram > clock when dbus idle. And why this should be configurable per board? It looks you like to put OS policy into DT, so no. Best regards, Krzysztof
Hi Krzysztof, > >>> + realtek,enable-l4icg: > >>> + description: Enable the power saving feature l4icg by hardware > clock. > >>> + gating. > >> > >> You described the desired Linux feature or behavior, not the actual > hardware. > >> The bindings are about the latter, so instead you need to rephrase > >> the property and its description to match actual hardware > >> capabilities/features/configuration etc. > > > > The l4icg entry is a hardware feature for power saving. > > The term may not clearly convey the function. > > So instead of the term "l4icg" I use "hw clock gating". > > > > realtek,enable-hw-clock-gating: > > description: Enable the clock gated function which will gating sram > > clock when dbus idle. > > And why this should be configurable per board? It looks you like to put OS > policy into DT, so no. > Ok, I'll remove it from DT. I put it in DT because hw-clock-gating is not an OS policy. This is a pure hardware function and is not controlled by software. I want to control enabling or disabling on different SoCs or boards. But for power saving, it should be enabled by default except for rtd1295 SoC. So I would handle this special case of rtd1295 in the driver. Thanks, Stanley
On Fri, Jul 28, 2023 at 11:53:13AM +0800, Stanley Chang wrote: > Document the DWC3 USB bindings for Realtek SoCs. > > Signed-off-by: Stanley Chang <stanley_chang@realtek.com> > --- > .../devicetree/bindings/usb/realtek,dwc3.yaml | 107 ++++++++++++++++++ > 1 file changed, 107 insertions(+) > create mode 100644 Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > > diff --git a/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > new file mode 100644 > index 000000000000..74d388809924 > --- /dev/null > +++ b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml > @@ -0,0 +1,107 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +# Copyright 2023 Realtek Semiconductor Corporation > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/usb/realtek,dwc3.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > + > +title: Realtek DWC3 USB SoC Controller Glue > + > +maintainers: > + - Stanley Chang <stanley_chang@realtek.com> > + > +description: > + The Realtek DHC SoC embeds a DWC3 USB IP Core configured for USB 2.0 > + and USB 3.0 in host or dual-role mode. > + > +properties: > + compatible: > + items: > + - enum: > + - realtek,rtd1295-dwc3 > + - realtek,rtd1315e-dwc3 > + - realtek,rtd1319-dwc3 > + - realtek,rtd1319d-dwc3 > + - realtek,rtd1395-dwc3 > + - realtek,rtd1619-dwc3 > + - realtek,rtd1619b-dwc3 > + - const: realtek,rtd-dwc3 > + > + reg: > + maxItems: 1 Some details on what these registers are would be useful. Or describing what's in the 'glue' device? > + > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 1 > + > + ranges: true > + > + realtek,unlink-usb3-port: > + description: Disable link between USB 3.0 PHY and USB mac. > + Only for RTD1619 SoC, if the board design support maximum 2.0 speed. > + type: boolean We have a property for this: maximum-speed That belongs in the USB controller node though. > + > + realtek,disable-usb3-phy: > + description: Close USB 3.0 PHY if the board design not support USB 3.0. > + type: boolean Can't this be determined by not having a USB3 phy listed? > + > + realtek,enable-l4icg: > + description: Enable the power saving feature l4icg by hardware clock. > + gating. > + type: boolean > + > +patternProperties: > + "^usb@[0-9a-f]+$": > + $ref: snps,dwc3.yaml# > + description: Required child node > + > +required: > + - compatible > + - reg > + - "#address-cells" > + - "#size-cells" > + - ranges > + > +allOf: > + - if: > + not: > + properties: > + compatible: > + contains: > + enum: > + - realtek,rtd1619-dwc3 > + then: > + properties: > + realtek,unlink-usb3-port: false > + > +additionalProperties: false > + > +examples: > + - | > + usb@98013e00 { > + compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; > + reg = <0x98013e00 0x200>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + status = "okay"; Drop status from examples. > + realtek,disable-usb3-phy; > + realtek,enable-l4icg; > + > + usb@98050000 { > + compatible = "snps,dwc3"; > + reg = <0x98050000 0x9000>; > + interrupts = <0 94 4>; > + phys = <&usb2phy &usb3phy>; > + phy-names = "usb2-phy", "usb3-phy"; > + dr_mode = "otg"; > + usb-role-switch; > + role-switch-default-mode = "host"; > + snps,dis_u2_susphy_quirk; > + snps,parkmode-disable-ss-quirk; > + snps,parkmode-disable-hs-quirk; > + maximum-speed = "high-speed"; > + }; > + }; > -- > 2.34.1 >
Hi Rob, > > +properties: > > + compatible: > > + items: > > + - enum: > > + - realtek,rtd1295-dwc3 > > + - realtek,rtd1315e-dwc3 > > + - realtek,rtd1319-dwc3 > > + - realtek,rtd1319d-dwc3 > > + - realtek,rtd1395-dwc3 > > + - realtek,rtd1619-dwc3 > > + - realtek,rtd1619b-dwc3 > > + - const: realtek,rtd-dwc3 > > + > > + reg: > > + maxItems: 1 > > Some details on what these registers are would be useful. Or describing what's > in the 'glue' device? Ok, I will add the description. > > + realtek,unlink-usb3-port: > > + description: Disable link between USB 3.0 PHY and USB mac. > > + Only for RTD1619 SoC, if the board design support maximum 2.0 > speed. > > + type: boolean > > We have a property for this: maximum-speed > > That belongs in the USB controller node though. I can try to use this property. But I have a question. This property belongs to dwc3. When the dwc3-rtk setting disables USB 3.0 phy, dwc3 is not probed. So I can't use api usb_get_maximum_speed(dev) to get maximum_speed. I can add this property "maximum-speed" to the dwc3-rtk node, which is the same as the dwc3 core node. Is this configuration appropriate? For example usb@98013e00 { compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; reg = <0x98013e00 0x200>; #address-cells = <1>; #size-cells = <1>; ranges; maximum-speed = "high-speed"; usb@98050000 { compatible = "snps,dwc3"; reg = <0x98050000 0x9000>; interrupts = <0 94 4>; phys = <&usb2phy &usb3phy>; phy-names = "usb2-phy", "usb3-phy"; dr_mode = "otg"; usb-role-switch; role-switch-default-mode = "host"; snps,dis_u2_susphy_quirk; snps,parkmode-disable-ss-quirk; snps,parkmode-disable-hs-quirk; maximum-speed = "high-speed"; }; }; > > + > > + realtek,disable-usb3-phy: > > + description: Close USB 3.0 PHY if the board design not support USB 3.0. > > + type: boolean > > Can't this be determined by not having a USB3 phy listed? I will try to use maximum-speed. > > +examples: > > + - | > > + usb@98013e00 { > > + compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; > > + reg = <0x98013e00 0x200>; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + ranges; > > + status = "okay"; > > Drop status from examples. Ok. Thanks, Stanley
diff --git a/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml new file mode 100644 index 000000000000..74d388809924 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/realtek,dwc3.yaml @@ -0,0 +1,107 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +# Copyright 2023 Realtek Semiconductor Corporation +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/usb/realtek,dwc3.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Realtek DWC3 USB SoC Controller Glue + +maintainers: + - Stanley Chang <stanley_chang@realtek.com> + +description: + The Realtek DHC SoC embeds a DWC3 USB IP Core configured for USB 2.0 + and USB 3.0 in host or dual-role mode. + +properties: + compatible: + items: + - enum: + - realtek,rtd1295-dwc3 + - realtek,rtd1315e-dwc3 + - realtek,rtd1319-dwc3 + - realtek,rtd1319d-dwc3 + - realtek,rtd1395-dwc3 + - realtek,rtd1619-dwc3 + - realtek,rtd1619b-dwc3 + - const: realtek,rtd-dwc3 + + reg: + maxItems: 1 + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + ranges: true + + realtek,unlink-usb3-port: + description: Disable link between USB 3.0 PHY and USB mac. + Only for RTD1619 SoC, if the board design support maximum 2.0 speed. + type: boolean + + realtek,disable-usb3-phy: + description: Close USB 3.0 PHY if the board design not support USB 3.0. + type: boolean + + realtek,enable-l4icg: + description: Enable the power saving feature l4icg by hardware clock. + gating. + type: boolean + +patternProperties: + "^usb@[0-9a-f]+$": + $ref: snps,dwc3.yaml# + description: Required child node + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + - ranges + +allOf: + - if: + not: + properties: + compatible: + contains: + enum: + - realtek,rtd1619-dwc3 + then: + properties: + realtek,unlink-usb3-port: false + +additionalProperties: false + +examples: + - | + usb@98013e00 { + compatible = "realtek,rtd1319d-dwc3", "realtek,rtd-dwc3"; + reg = <0x98013e00 0x200>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + status = "okay"; + realtek,disable-usb3-phy; + realtek,enable-l4icg; + + usb@98050000 { + compatible = "snps,dwc3"; + reg = <0x98050000 0x9000>; + interrupts = <0 94 4>; + phys = <&usb2phy &usb3phy>; + phy-names = "usb2-phy", "usb3-phy"; + dr_mode = "otg"; + usb-role-switch; + role-switch-default-mode = "host"; + snps,dis_u2_susphy_quirk; + snps,parkmode-disable-ss-quirk; + snps,parkmode-disable-hs-quirk; + maximum-speed = "high-speed"; + }; + };