Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4496642rwb; Tue, 8 Aug 2023 09:16:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/a1jiRbnr2dzjqVzX+3qJvtTuPIzrguE4yeKKypYh7GxF/J+ufFX48wqrHzVX1ICABOpw X-Received: by 2002:a05:6512:ad5:b0:4fe:1b6c:7d37 with SMTP id n21-20020a0565120ad500b004fe1b6c7d37mr9609954lfu.65.1691511373009; Tue, 08 Aug 2023 09:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691511372; cv=none; d=google.com; s=arc-20160816; b=dPCTdokqf+t6Aa/8bUPiZEWAwQ9Hea/kQlTXHD4AkZsuY00NavQvNWXAUFKkIqZ2Jh JaQ16JnkB6Qpy5UFd6FEITrg6Yrk8G2r7ZA1hmi0zUYyy0S7mrqZX8Mwk/ynAXlNUYxu ZeeeuKDbz52E/LcAuWyiA2euynz0Pms6XNk1UU03c2mPOs1WhG6WLBUYjrVDuTxOEZUH iUvjneLicc0Ap4PT7LSnD5Xu+9bRY35nxaO3SgR9n2DbfP5OuUJMa/iDCPzVaGXrAxhF PIxAdsRdMbwwjAbpQ6AkxvU69zVolbL3wAY1z/aD5HtrrsHKETix5n/fkhjGmLdNkx9W wu0w== 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; bh=u4t7Ohi58qOI3pjN38otU6idm2UrxcCXpwrl3AsF18g=; fh=KlfUrAh/M+3jg6Aka2t0p3FJ34aEDfbZ7R9yuLPOQWA=; b=OWBe910gSho6Tb+vLD0CkDwsZLZ/59CPw/Tcz3lwA5vsNmq2g5do5X2e5MFpLjZ+QS BouUMF97UCtTyFDMjQLUueG6XfybPSphAyVpf8ifeSs2LC77sJvuXc8u0uykDCmtId51 4gvWLdq3R4cl21XgrivaKdYi2oiWAEoAnPGUeh6HjqFVk1hWRPIHYYq6iQ8xsIHQS9tr zcIYJy8RtEMoLZXrJQIvDqMXTiShoVVtGzrQ7bJ9NKCpjxm00xj0+zj4b7FZAG4dQNsk GoNnG6hlrD+ftV9ZXmE7OdKJMhOlS27yFYRqgtb7qqZulxOFAB4I5x/AAwmAdLY4BS2Y bcsg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020aa7d495000000b0052221a15156si2412346edr.490.2023.08.08.09.15.47; Tue, 08 Aug 2023 09:16:12 -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 S232298AbjHHQOe (ORCPT + 99 others); Tue, 8 Aug 2023 12:14:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232155AbjHHQNS (ORCPT ); Tue, 8 Aug 2023 12:13:18 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51CEA3C19; Tue, 8 Aug 2023 08:47:25 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 37865U8t8011396, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 37865U8t8011396 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Tue, 8 Aug 2023 14:05:31 +0800 Received: from RTEXMBS05.realtek.com.tw (172.21.6.98) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Tue, 8 Aug 2023 14:05:31 +0800 Received: from RTEXH36506.realtek.com.tw (172.21.6.27) by RTEXMBS05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 8 Aug 2023 14:05:31 +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; Tue, 8 Aug 2023 14:05:31 +0800 From: Stanley Chang To: Thinh Nguyen CC: Stanley Chang , Greg Kroah-Hartman , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , Felipe Balbi , , , Subject: [PATCH v2 2/2] dt-bindings: usb: dwc3: Add DWC_usb3 TX/RX threshold configurable Date: Tue, 8 Aug 2023 14:05:23 +0800 Message-ID: <20230808060530.9727-2-stanley_chang@realtek.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230808060530.9727-1-stanley_chang@realtek.com> References: <20230808060530.9727-1-stanley_chang@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-KSE-ServerInfo: RTEXMBS05.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-ServerInfo: RTEXH36505.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, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,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: X-Mailing-List: linux-kernel@vger.kernel.org In Synopsys's dwc3 data book: To avoid underrun and overrun during the burst, in a high-latency bus system (like USB), threshold and burst size control is provided through GTXTHRCFG and GRXTHRCFG registers. By default, USB TX and RX threshold are not enabled. To enable TX or RX threshold, both packet threshold count and max burst size properties must be set to a valid non-zero value. In Realtek DHC SoC, DWC3 USB 3.0 uses AHB system bus. When dwc3 is connected with USB 2.5G Ethernet, there will be overrun problem. Therefore, setting TX/RX thresholds can avoid this issue. Signed-off-by: Stanley Chang --- v1 to v2 change: Add the properties for TX/RX threshold setting --- .../devicetree/bindings/usb/snps,dwc3.yaml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index a696f23730d3..ee5af4b381b1 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -310,6 +310,62 @@ properties: maximum: 62 deprecated: true + snps,rx-thr-num-pkt: + description: + USB RX packet threshold count. In host mode, this field specifies + the space that must be available in the RX FIFO before the core can + start the corresponding USB RX transaction (burst). + In device mode, this field specifies the space that must be + available in the RX FIFO before the core can send ERDY for a + flow-controlled endpoint. It is only used for SuperSpeed. + The valid values for this field are from 1 to 15. (DWC3 SuperSpeed + USB 3.0 Controller Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 15 + + snps,rx-max-burst: + description: + Max USB RX burst size. In host mode, this field specifies the + Maximum Bulk IN burst the DWC_usb3 core can perform. When the system + bus is slower than the USB, RX FIFO can overrun during a long burst. + You can program a smaller value to this field to limit the RX burst + size that the core can perform. It only applies to SS Bulk, + Isochronous, and Interrupt IN endpoints in the host mode. + In device mode, this field specifies the NUMP value that is sent in + ERDY for an OUT endpoint. + The valid values for this field are from 1 to 16. (DWC3 SuperSpeed + USB 3.0 Controller Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 16 + + snps,tx-thr-num-pkt: + description: + USB TX packet threshold count. This field specifies the number of + packets that must be in the TXFIFO before the core can start + transmission for the corresponding USB transaction (burst). + This count is valid in both host and device modes. It is only used + for SuperSpeed operation. + Valid values are from 1 to 15. (DWC3 SuperSpeed USB 3.0 Controller + Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 15 + + snps,tx-max-burst: + description: + Max USB TX burst size. When the system bus is slower than the USB, + TX FIFO can underrun during a long burst. Program a smaller value + to this field to limit the TX burst size that the core can execute. + In Host mode, it only applies to SS Bulk, Isochronous, and Interrupt + OUT endpoints. This value is not used in device mode. + Valid values are from 1 to 16. (DWC3 SuperSpeed USB 3.0 Controller + Databook) + $ref: /schemas/types.yaml#/definitions/uint8 + minimum: 1 + maximum: 16 + snps,rx-thr-num-pkt-prd: description: Periodic ESS RX packet threshold count (host mode only). Set this and -- 2.34.1