1. 11 4月, 2017 2 次提交
    • 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
    • R
      usb: dwc3: make macros safe to expression arguments · 8261bd4e
      Roger Quadros 提交于
      We must make sure that our macros are safe against expressions passed
      as arguments. We have seen one problem where GTXFIFOSIZ(n) was failing
      when passed the expression (epnum >> 1) as argument. The problem was
      caused by operator precedence between >> and *.
      
      To make sure macros are safe, we just wrap argument with () when using
      it.
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      8261bd4e
  2. 27 3月, 2017 1 次提交
  3. 24 1月, 2017 2 次提交
  4. 03 1月, 2017 1 次提交
  5. 02 1月, 2017 1 次提交
    • F
      usb: dwc3: core: avoid Overflow events · e71d363d
      Felipe Balbi 提交于
      Now that we're handling so many transfers at a time
      and for some dwc3 revisions LPM events *must* be
      enabled, we can fall into a situation where too many
      events fire and we start receiving Overflow events.
      
      Let's do what XHCI does and allocate a full page for
      the Event Ring, this will avoid any future issues.
      
      Cc: <stable@vger.kernel.org> # v4.9
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      e71d363d
  6. 18 11月, 2016 5 次提交
  7. 03 11月, 2016 7 次提交
  8. 31 10月, 2016 2 次提交
  9. 07 9月, 2016 1 次提交
    • T
      usb: dwc3: Fix dr_mode validation · 9d6173e1
      Thinh Nguyen 提交于
      This patch follows the similar fix in dwc2. See
      commit 5268ed9d ("usb: dwc2: Fix dr_mode validation")
      
      Currently, the dr_mode is only checked against the module configuration.
      It also needs to be checked against the hardware capablities.
      
      The driver now checks if both the module configuration and hardware are
      capable of the dr_mode value. If not, then it will issue a warning and
      fall back to a supported value. If it is unable to fall back to a
      suitable value, then the probe will fail.
      
      Behavior summary:
      
            module          :  actual
       HW   config  dr_mode :  dr_mode
      ---------------------------------
       host  host   any     :  host
       host  dev    any     :  INVALID
       host  otg    any     :  host
      
       dev   host   any     :  INVALID
       dev   dev    any     :  dev
       dev   otg    any     :  dev
      
       otg   host   any     :  host
       otg   dev    any     :  dev
       otg   otg    any     :  dr_mode
      Signed-off-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      9d6173e1
  10. 25 8月, 2016 5 次提交
  11. 22 8月, 2016 1 次提交
  12. 20 6月, 2016 12 次提交