Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2362723rdb; Mon, 11 Sep 2023 22:07:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXR3YyJKWb7zzDgaOcsePKom4SlF1q/ghPnnUPM0SZlRwTq+mQ5dXN4c5Y6yrLsDFltTpt X-Received: by 2002:a05:6830:1203:b0:6bd:ba2c:fbbd with SMTP id r3-20020a056830120300b006bdba2cfbbdmr13397075otp.20.1694495237575; Mon, 11 Sep 2023 22:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694495237; cv=none; d=google.com; s=arc-20160816; b=E56qT0as4z+Wl+CV84h/7vGO87p/Fc7OO5vOl57dTHsPXAmvIq/7rc+HxO1hm9Enj+ c8qeD+zhKJXBkK42aewooxkhTUNjG/7T0seuvymUYgurnw7XPLQ462qDh8a/hY7Geb/U DEKuqKjFqcdlgfh6TGF4A0wWxaXGgU9dS7Ixh81mAMmZhXtcYDKJYV7J8eOmXetRMjDs Ge/zYqrWSTuZ5e5lhmVfIvdtyIZlZz48m0OYEatjL7xHTc7aoZeX5+ztwQPWegtSp62Y 7EJCMqoZFLtTylYMkAiCJbsjCDvFy7RHhSO/iE0Z0hJdyVfNkNvcUzF7jTO4vPsYJ0x+ R3/Q== 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=0RClonRkydLt7l6/e0uxe7mjXxtQktr+sqhCU4k4CJc=; fh=+a6LdlUnZwFztcqqNoGC5wkMieB14DAL4jIoJhCwMiE=; b=EifTyTATCFs6nHy7lmAGS5LbpOYSPrUKJtlIaAY4LU4cyI9TsBzz5e8zrqL84LaZCI 0gYp/GrW0FKvwvljRNw6kkzWivJT454m87iDLqyYSmoxlkg/rghV5MOFMxLAPykGWRWJ FCA6KDzuafMFoHDAZAfYAV3ZopKq4adckYOqriNBKVbESaNA0VoafrsG76wGD1f5C5nN tFCO+u8Jezq0mp12cl+QdH0+yqnugVPJR3xOsy7y6Uu74fCTChRtVf2igEdHlOj1Tc8e d6bj1kp/+LVdpDQmdjJDrOfZVSpyhj8YSybLmeH21ZCIewXe8h3l8RWJ6jrO7OLafbaC T0aQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id z19-20020a63e113000000b00565e6b6c4aesi3700773pgh.370.2023.09.11.22.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 22:07:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3B9CA80BB5C8; Mon, 11 Sep 2023 21:50:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231493AbjILETb (ORCPT + 99 others); Tue, 12 Sep 2023 00:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230210AbjILET0 (ORCPT ); Tue, 12 Sep 2023 00:19:26 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7D0891B9; Mon, 11 Sep 2023 21:19:22 -0700 (PDT) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 38C4J5sfC2127449, 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.92/5.92) with ESMTPS id 38C4J5sfC2127449 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 12 Sep 2023 12:19:05 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) 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, 12 Sep 2023 12:19:05 +0800 Received: from RTEXH36505.realtek.com.tw (172.21.6.25) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Tue, 12 Sep 2023 12:19:05 +0800 Received: from localhost.localdomain (172.21.252.101) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server id 15.1.2375.32 via Frontend Transport; Tue, 12 Sep 2023 12:19:05 +0800 From: Stanley Chang To: Thinh Nguyen CC: Stanley Chang , Rob Herring , Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , , , Subject: [PATCH v3 2/2] dt-bindings: usb: dwc3: Add DWC_usb3 TX/RX threshold configurable Date: Tue, 12 Sep 2023 12:19:03 +0800 Message-ID: <20230912041904.30721-2-stanley_chang@realtek.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230912041904.30721-1-stanley_chang@realtek.com> References: <20230912041904.30721-1-stanley_chang@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-KSE-ServerInfo: RTEXMBS04.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:50:50 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 Reviewed-by: Rob Herring --- v2 to v3 change: No change 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