1. 10 5月, 2019 1 次提交
  2. 01 12月, 2018 1 次提交
  3. 30 7月, 2018 3 次提交
  4. 18 6月, 2018 1 次提交
  5. 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
  6. 15 5月, 2018 2 次提交
  7. 22 3月, 2018 3 次提交
  8. 13 3月, 2018 2 次提交
  9. 28 2月, 2018 1 次提交
  10. 15 2月, 2018 1 次提交
    • R
      usb: dwc3: core: Fix ULPI PHYs and prevent phy_get/ulpi_init during suspend/resume · 98112041
      Roger Quadros 提交于
      In order for ULPI PHYs to work, dwc3_phy_setup() and dwc3_ulpi_init()
      must be doene before dwc3_core_get_phy().
      
      commit 541768b0 ("usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys")
      broke this.
      
      The other issue is that dwc3_core_get_phy() and dwc3_ulpi_init() should
      be called only once during the life cycle of the driver. However,
      as dwc3_core_init() is called during system suspend/resume it will
      result in multiple calls to dwc3_core_get_phy() and dwc3_ulpi_init()
      which is wrong.
      
      Fix this by moving dwc3_ulpi_init() out of dwc3_phy_setup()
      into dwc3_core_ulpi_init(). Use a flag 'ulpi_ready' to ensure that
      dwc3_core_ulpi_init() is called only once from dwc3_core_init().
      
      Use another flag 'phys_ready' to call dwc3_core_get_phy() only once from
      dwc3_core_init().
      
      Fixes: 541768b0 ("usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys")
      Fixes: f54edb53 ("usb: dwc3: core: initialize ULPI before trying to get the PHY")
      Cc: linux-stable <stable@vger.kernel.org> # >= v4.13
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      98112041
  11. 12 2月, 2018 2 次提交
  12. 29 12月, 2017 1 次提交
    • V
      phy: exynos5-usbdrd: Calibrate LOS levels for exynos5420/5800 · d8c80bb3
      Vivek Gautam 提交于
      Adding phy calibration sequence for USB 3.0 DRD PHY present on
      Exynos5420/5800 systems.
      This calibration facilitates setting certain PHY parameters viz.
      the Loss-of-Signal (LOS) Detector Threshold Level, as well as
      Tx-Vboost-Level for Super-Speed operations.
      Additionally we also set proper time to wait for RxDetect measurement,
      for desired PHY reference clock, so as to solve issue with enumeration
      of few USB 3.0 devices, like Samsung SUM-TSB16S 3.0 USB drive
      on the controller.
      
      We are using CR_port for this purpose to send required data
      to override the LOS values.
      
      On testing with USB 3.0 devices on USB 3.0 port present on
      SMDK5420, and peach-pit boards should see following message:
      usb 2-1: new SuperSpeed USB device number 2 using xhci-hcd
      
      and without this patch, should see below shown message:
      usb 1-1: new high-speed USB device number 2 using xhci-hcd
      
      [Also removed unnecessary extra lines in the register macro definitions]
      Signed-off-by: NVivek Gautam <gautam.vivek@samsung.com>
      [adapted to use phy_calibrate as entry point]
      Signed-off-by: NAndrzej Pietrasiewicz <andrzej.p@samsung.com>
      Acked-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
      d8c80bb3
  13. 11 12月, 2017 1 次提交
    • R
      usb: dwc3: Allow disabling of metastability workaround · 42bf02ec
      Roger Quadros 提交于
      Some platforms (e.g. TI's DRA7 USB2 instance) have more trouble
      with the metastability workaround as it supports only
      a High-Speed PHY and the PHY can enter into an Erratic state [1]
      when the controller is set in SuperSpeed mode as part of
      the metastability workaround.
      
      This causes upto 2 seconds delay in enumeration on DRA7's USB2
      instance in gadget mode.
      
      If these platforms can be better off without the workaround,
      provide a device tree property to suggest that so the workaround
      is avoided.
      
      [1] Device mode enumeration trace showing PHY Erratic Error.
           irq/90-dwc3-969   [000] d...    52.323145: dwc3_event: event (00000901): Erratic Error [U0]
           irq/90-dwc3-969   [000] d...    52.560646: dwc3_event: event (00000901): Erratic Error [U0]
           irq/90-dwc3-969   [000] d...    52.798144: dwc3_event: event (00000901): Erratic Error [U0]
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      42bf02ec
  14. 07 11月, 2017 1 次提交
    • G
      USB: dwc3: Remove redundant license text · b5ea4757
      Greg Kroah-Hartman 提交于
      Now that the SPDX tag is in all USB files, that identifies the license
      in a specific and legally-defined manner.  So the extra GPL text wording
      can be removed as it is no longer needed at all.
      
      This is done on a quest to remove the 700+ different ways that files in
      the kernel describe the GPL license text.  And there's unneeded stuff
      like the address (sometimes incorrect) for the FSF which is never
      needed.
      
      No copyright headers or other non-license-description text was removed.
      
      Cc: Kukjin Kim <kgene@kernel.org>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Acked-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5ea4757
  15. 04 11月, 2017 1 次提交
  16. 24 10月, 2017 3 次提交
  17. 17 7月, 2017 1 次提交
    • V
      usb: dwc3: core: Call dwc3_core_get_phy() before initializing phys · 541768b0
      Vignesh R 提交于
      commit f54edb53 ("usb: dwc3: core: initialize ULPI before trying to
      get the PHY") moved call to dwc3_core_get_phy() from dwc3_probe() to
      dwc3_core_init() after dwc3_core_soft_reset(). But
      dwc3_core_soft_reset() calls phy_init(), therefore dwc3_core_get_phy()
      needs to be called before dwc3_core_soft_reset().
      
      Fix this by moving call to dwc3_core_get_phy() before
      dwc3_core_soft_reset().
      
      This fixes the following abort seen on DRA7xx platforms
      [   24.769118] usb usb2: SerialNumber: xhci-hcd.1.auto
      [   24.781144] hub 2-0:1.0: USB hub found
      [   24.787836] hub 2-0:1.0: 1 port detected
      [   24.809939] Unhandled fault: imprecise external abort (0x1406) at 0x00000000
      Reported-by: NCarlos Hernandez <ceh@ti.com>
      Signed-off-by: NVignesh R <vigneshr@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      541768b0
  18. 13 6月, 2017 2 次提交
  19. 17 5月, 2017 1 次提交
    • W
      usb: dwc3: add disable u2mac linestate check quirk · 65db7a0c
      William Wu 提交于
      This patch adds a quirk to disable USB 2.0 MAC linestate check
      during HS transmit. Refer the dwc3 databook, we can use it for
      some special platforms if the linestate not reflect the expected
      line state(J) during transmission.
      
      When use this quirk, the controller implements a fixed 40-bit
      TxEndDelay after the packet is given on UTMI and ignores the
      linestate during the transmit of a token (during token-to-token
      and token-to-data IPGAP).
      
      On some rockchip platforms (e.g. rk3399), it requires to disable
      the u2mac linestate check to decrease the SSPLIT token to SETUP
      token inter-packet delay from 566ns to 466ns, and fix the issue
      that FS/LS devices not recognized if inserted through USB 3.0 HUB.
      Acked-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NGuenter Roeck <groeck@chromium.org>
      Signed-off-by: NWilliam Wu <william.wu@rock-chips.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      65db7a0c
  20. 11 4月, 2017 4 次提交
    • R
      usb: dwc3: Add dual-role support · 9840354f
      Roger Quadros 提交于
      If dr_mode is "otg" then support dual role mode of operation.
      Currently this mode is only supported when an extcon handle is
      present in the dwc3 device tree node. This is needed to
      get the ID status events of the port.
      
      We're using a workqueue to manage the dual-role state transitions
      as the extcon notifier (dwc3_drd_notifier) is called in an atomic
      context by extcon_sync() and this doesn't go well with
      usb_del_gadget_udc() causing a lockdep and softirq warning.
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      9840354f
    • R
      usb: dwc3: core: make dwc3_set_mode() work properly · 41ce1456
      Roger Quadros 提交于
      We can't have both Host and Peripheral roles active at the same time
      because of one detail on DWC3: it shares the same memory area for both
      Host and Peripheral registers.
      
      When swapping roles we must reinitialize the new role every
      time. Let's make sure this works for our debugfs interface.
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      41ce1456
    • R
      usb: dwc3: core: add current_dr_role member · 6b3261a2
      Roger Quadros 提交于
      We're going to use this member to track which role we're currently
      playing, that way we can more easily implement dual-role swap in
      upcoming patches.
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      6b3261a2
    • B
      usb: dwc3: refactor gadget endpoint count calculation · 47d3946e
      Bryan O'Donoghue 提交于
      - DWC_USB3_NUM indicates the number of Device mode single directional
        endpoints, including OUT and IN endpoint 0.
      
      - DWC_USB3_NUM_IN_EPS indicates the maximum number of Device mode IN
        endpoints active at any time, including control endpoint 0.
      
      It's possible to configure RTL such that DWC_USB3_NUM_EPS is equal to
      DWC_USB3_NUM_IN_EPS.
      
      dwc3-core calculates the number of OUT endpoints as DWC_USB3_NUM minus
      DWC_USB3_NUM_IN_EPS. If RTL has been configured with DWC_USB3_NUM_IN_EPS
      equal to DWC_USB3_NUM then dwc3-core will calculate the number of OUT
      endpoints as zero.
      
      For example a from dwc3_core_num_eps() shows:
      [    1.565000]  /usb0@f01d0000: found 8 IN and 0 OUT endpoints
      
      This patch refactors the endpoint calculation down to one variable
      dwc->num_eps taking care to maintain the current mapping of endpoints for
      fixed FPGA configurations as described in Table 4-7 of version 2.60a of the
      DWC USB3 databook.
      
      The endpoint mapping will then be EP-OUT, EP-IN etc, up to DWC_USB3_NUM.
      If DWC_USB3_NUM is odd then OUT will take the extra endpoint.
      Suggested-by: NFelipe Balbi <balbi@kernel.org>
      Signed-off-by: NBryan O'Donoghue <pure.logic@nexus-software.ie>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      47d3946e
  21. 27 3月, 2017 1 次提交
  22. 18 11月, 2016 6 次提交