1. 15 3月, 2020 3 次提交
    • J
      usb: dwc3: Add support for role-switch-default-mode binding · 98ed256a
      John Stultz 提交于
      Support the new role-switch-default-mode binding for configuring
      the default role the controller assumes as when the usb role is
      USB_ROLE_NONE
      
      This patch was split out from a larger patch originally by
      Yu Chen <chenyu56@huawei.com>
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      CC: ShuFan Lee <shufan_lee@richtek.com>
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>
      Cc: Yu Chen <chenyu56@huawei.com>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Jun Li <lijun.kernel@gmail.com>
      Cc: Valentin Schneider <valentin.schneider@arm.com>
      Cc: Guillaume Gardet <Guillaume.Gardet@arm.com>
      Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
      Cc: Jack Pham <jackp@codeaurora.org>
      Cc: linux-usb@vger.kernel.org
      Cc: devicetree@vger.kernel.org
      Tested-by: NBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      98ed256a
    • Y
      usb: dwc3: Registering a role switch in the DRD code. · 8a0a1379
      Yu Chen 提交于
      The Type-C drivers use USB role switch API to inform the
      system about the negotiated data role, so registering a role
      switch in the DRD code in order to support platforms with
      USB Type-C connectors.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      CC: ShuFan Lee <shufan_lee@richtek.com>
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>
      Cc: Yu Chen <chenyu56@huawei.com>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Jun Li <lijun.kernel@gmail.com>
      Cc: Valentin Schneider <valentin.schneider@arm.com>
      Cc: Guillaume Gardet <Guillaume.Gardet@arm.com>
      Cc: Jack Pham <jackp@codeaurora.org>
      Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
      Cc: linux-usb@vger.kernel.org
      Cc: devicetree@vger.kernel.org
      Suggested-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Tested-by: NBryan O'Donoghue <bryan.odonoghue@linaro.org>
      Signed-off-by: NYu Chen <chenyu56@huawei.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      8a0a1379
    • N
      usb: dwc3: core: add support for disabling SS instances in park mode · 7ba6b09f
      Neil Armstrong 提交于
      In certain circumstances, the XHCI SuperSpeed instance in park mode
      can fail to recover, thus on Amlogic G12A/G12B/SM1 SoCs when there is high
      load on the single XHCI SuperSpeed instance, the controller can crash like:
       xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command.
       xhci-hcd xhci-hcd.0.auto: Host halt failed, -110
       xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead
       xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command.
       hub 2-1.1:1.0: hub_ext_port_status failed (err = -22)
       xhci-hcd xhci-hcd.0.auto: HC died; cleaning up
       usb 2-1.1-port1: cannot reset (err = -22)
      
      Setting the PARKMODE_DISABLE_SS bit in the DWC3_USB3_GUCTL1 mitigates
      the issue. The bit is described as :
      "When this bit is set to '1' all SS bus instances in park mode are disabled"
      
      Synopsys explains:
      The GUCTL1.PARKMODE_DISABLE_SS is only available in
      dwc_usb3 controller running in host mode.
      This should not be set for other IPs.
      This can be disabled by default based on IP, but I recommend to have a
      property to enable this feature for devices that need this.
      
      CC: Dongjin Kim <tobetter@gmail.com>
      Cc: Jianxin Pan <jianxin.pan@amlogic.com>
      Cc: Thinh Nguyen <thinhn@synopsys.com>
      Cc: Jun Li <lijun.kernel@gmail.com>
      Reported-by: NTim <elatllat@gmail.com>
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      7ba6b09f
  2. 15 1月, 2020 2 次提交
  3. 09 8月, 2019 1 次提交
  4. 20 6月, 2019 1 次提交
  5. 18 6月, 2019 1 次提交
    • A
      usb: dwc3: gadget: Add support for disabling U1 and U2 entries · 729dcffd
      Anurag Kumar Vulisha 提交于
      Gadget applications may have a requirement to disable the U1 and U2
      entry based on the usecase. Below are few usecases where the disabling
      U1/U2 entries may be possible.
      
      Usecase 1:
      When combining dwc3 with an redriver for a USB Type-C device solution, it
      sometimes have problems with leaving U1/U2 for certain hosts, resulting in
      link training errors and reconnects. For this U1/U2 state entries may be
      avoided.
      
      Usecase 2:
      When performing performance benchmarking on mass storage gadget the
      U1 and U2 entries can be disabled.
      
      Usecase 3:
      When periodic transfers like ISOC transfers are used with bInterval
      of 1 which doesn't require the link to enter into U1 or U2 state entry
      (since ping is issued from host for every uframe interval). In this
      case the U1 and U2 entry can be disabled.
      
      Disablement of U1/U2 can be done by setting U1DevExitLat and U2DevExitLat
      values to 0 in the BOS descriptor. Host on seeing 0 value for U1DevExitLat
      and U2DevExitLat, it doesn't send SET_SEL requests to the gadget. There
      may be some hosts which may send SET_SEL requests even after seeing 0 in
      the UxDevExitLat of BOS descriptor. To aviod U1/U2 entries for these type
      of hosts, dwc3 controller can be programmed to reject those U1/U2 requests
      by not enabling ACCEPTUxENA bits in DCTL register.
      
      This patch updates the same.
      Signed-off-by: NAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
      Signed-off-by: NClaus H. Stovgaard <cst@phaseone.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      729dcffd
  6. 03 5月, 2019 1 次提交
  7. 04 2月, 2019 1 次提交
  8. 28 1月, 2019 2 次提交
  9. 05 12月, 2018 1 次提交
  10. 27 11月, 2018 1 次提交
    • F
      usb: dwc3: gadget: check if dep->frame_number is still valid · d5370106
      Felipe Balbi 提交于
      Gadget driver may take an unbounded amount of time to queue requests
      after XferNotReady. This is important for isochronous endpoints which
      need to be started for a specific (micro-)frame.
      
      If we fail to start a transfer for isochronous endpoint, let's try
      queueing to a future interval and see if that helps. We will stop trying
      if we fail a start transfer for 5 intervals in the future.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      d5370106
  11. 26 11月, 2018 10 次提交
  12. 30 7月, 2018 3 次提交
  13. 21 5月, 2018 6 次提交
  14. 16 5月, 2018 1 次提交
    • M
      usb: dwc3: support clocks and resets for DWC3 core · fe8abf33
      Masahiro Yamada 提交于
      Historically, the clocks and resets are handled on the glue layer
      side instead of the DWC3 core.  For simple cases, dwc3-of-simple.c
      takes care of arbitrary number of clocks and resets.  The DT node
      structure typically looks like as follows:
      
        dwc3-glue {
                compatible = "foo,dwc3";
                clocks = ...;
                resets = ...;
                ...
      
                dwc3 {
                        compatible = "snps,dwc3";
                        ...
                };
        }
      
      By supporting the clocks and the reset in the dwc3/core.c, it will
      be turned into a single node:
      
        dwc3 {
                compatible = "foo,dwc3", "snps,dwc3";
                clocks = ...;
                resets = ...;
                ...
        }
      
      This commit adds the binding of clocks and resets specific to this IP.
      The number of clocks should generally be the same across SoCs, it is
      just some SoCs either tie clocks together or do not provide software
      control of some of the clocks.
      
      I took the clock names from the Synopsys datasheet: "ref" (ref_clk),
      "bus_early" (bus_clk_early), and "suspend" (suspend_clk).
      
      I found only one reset line in the datasheet, hence the reset-names
      property is omitted.
      
      Those clocks are required for new platforms.  Enforcing the new
      binding breaks existing platforms since they specify clocks (and
      resets) in their glue layer node, but nothing in the core node.
      I listed such exceptional cases in the DT binding.  The driver
      code has been relaxed to accept no clock.  This change is based
      on the discussion [1].
      
      I inserted reset_control_deassert() and clk_bulk_enable() before the
      first register access, i.e. dwc3_cache_hwparams().
      
      [1] https://patchwork.kernel.org/patch/10284265/Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      fe8abf33
  15. 22 3月, 2018 5 次提交
    • T
      usb: dwc3: Dump LSP and BMU debug info · 80b77634
      Thinh Nguyen 提交于
      Dump LSP and BMU debug info.
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      80b77634
    • T
      usb: dwc3: Check for ESS TX/RX threshold config · 938a5ad1
      Thinh Nguyen 提交于
      Check and configure TX/RX threshold for DWC_usb31. Update dwc3 structure
      with new fields to store these threshold configurations.
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      938a5ad1
    • T
      usb: dwc3: Add DWC_usb31 GTXTHRCFG reg fields · 6743e817
      Thinh Nguyen 提交于
      Add new GTXTHRCFG bit field macros for DWC_usb31. The GTXTHRCFG register
      fields for DWC_usb31 is as follows:
       +-------+--------------------------+-----------------------------------+
       | BITS  | Name                     | Description                       |
       +=======+==========================+===================================+
       | 31:27 | reserved                 |                                   |
       | 26    | UsbTxPktCntSel           | Async ESS transmit packet         |
       |       |                          | threshold enable                  |
       | 25:21 | UsbTxPktCnt              | Async ESS transmit packet         |
       |       |                          | threshold count                   |
       | 20:16 | UsbMaxTxBurstSize        | Async ESS Max transmit burst size |
       | 15    | UsbTxThrNumPktSel_HS_Prd | HS high bandwidth periodic        |
       |       |                          | transmit packet threshold enable  |
       | 14:13 | UsbTxThrNumPkt_HS_Prd    | HS high bandwidth periodic        |
       |       |                          | transmit packet threshold count   |
       | 12:11 | reserved                 |                                   |
       | 10    | UsbTxThrNumPktSel_Prd    | Periodic ESS transmit packet      |
       |       |                          | threshold enable                  |
       | 9:5   | UsbTxThrNumPkt_Prd       | Periodic ESS transmit packet      |
       |       |                          | threshold count                   |
       | 4:0   | UsbMaxTxBurstSize_Prd    | Max periodic ESS TX burst size    |
       +-------+--------------------------+-----------------------------------+
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      6743e817
    • T
      usb: dwc3: Add DWC_usb31 GRXTHRCFG bit fields · 2fbc5bdc
      Thinh Nguyen 提交于
      Add new GRXTHRCFG bit field macros for DWC_usb31. The GRXTHRCFG register
      fields for DWC_usb31 is as follows:
       +-------+--------------------------+----------------------------------+
       | BITS  | Name                     | Description                      |
       +=======+==========================+==================================+
       | 31:27 | reserved                 |                                  |
       | 26    | UsbRxPktCntSel           | Async ESS receive packet         |
       |       |                          | threshold enable                 |
       | 25:21 | UsbRxPktCnt              | Async ESS receive packet         |
       |       |                          | threshold count                  |
       | 20:16 | UsbMaxRxBurstSize        | Async ESS Max receive burst size |
       | 15    | UsbRxThrNumPktSel_HS_Prd | HS high bandwidth periodic       |
       |       |                          | receive packet threshold enable  |
       | 14:13 | UsbRxThrNumPkt_HS_Prd    | HS high bandwidth periodic       |
       |       |                          | receive packet threshold count   |
       | 12:11 | reserved                 |                                  |
       | 10    | UsbRxThrNumPktSel_Prd    | Periodic ESS receive packet      |
       |       |                          | threshold enable                 |
       | 9:5   | UsbRxThrNumPkt_Prd       | Periodic ESS receive packet      |
       |       |                          | threshold count                  |
       | 4:0   | UsbMaxRxBurstSize_Prd    | Max periodic ESS RX burst size   |
       +-------+--------------------------+----------------------------------+
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      2fbc5bdc
    • T
      usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields · 0cab8d26
      Thinh Nguyen 提交于
      Update two GTXFIFOSIZ bit fields for the DWC_usb31 controller. TXFDEP
      is a 15-bit value instead of 16-bit value, and bit 15 is TXFRAMNUM.
      
      The GTXFIFOSIZ register for DWC_usb31 is as follows:
       +-------+-----------+----------------------------------+
       | BITS  | Name      | Description                      |
       +=======+===========+==================================+
       | 31:16 | TXFSTADDR | Transmit FIFOn RAM Start Address |
       | 15    | TXFRAMNUM | Asynchronous/Periodic TXFIFO     |
       | 14:0  | TXFDEP    | TXFIFO Depth                     |
       +-------+-----------+----------------------------------+
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      0cab8d26
  16. 13 3月, 2018 1 次提交