Commit 6591e278 authored by Stanley Chang's avatar Stanley Chang Committed by Greg Kroah-Hartman
Browse files

dt-bindings: usb: dwc3: Add DWC_usb3 TX/RX threshold configurable



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: default avatarStanley Chang <stanley_chang@realtek.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230912041904.30721-2-stanley_chang@realtek.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e72fc8d6
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -311,6 +311,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