06 Oct, 2014

5 commits


19 Sep, 2014

2 commits


29 Aug, 2014

1 commit


09 Aug, 2014

2 commits


31 Jul, 2014

1 commit


22 Jul, 2014

1 commit


10 Jul, 2014

1 commit


05 Jul, 2014

1 commit


26 Jun, 2014

3 commits


24 May, 2014

1 commit


23 May, 2014

1 commit


17 May, 2014

1 commit


15 May, 2014

3 commits

  • A few changes are made to the Tegra EHCI driver so that it can set
    everything up for device-mode operation on the first USB controller.
    This can be used in conjunction with ci_udc.c to operate as a USB
    device.

    Detailed changes are:

    * Rename set_host_mode() to set_up_vbus() since that's really what it
    does.

    * Modify set_up_vbus() to know whether it's initializing in host or
    device mode, and:

    - Skip the external VBUS check in device mode, since external VBUS is
    expected in this case.

    - Disable VBUS output in device mode.

    * Modify init_phy_mux() to know whether it's initializing in host or
    device mode, and hence skip setting USBMODE_CM_HC (which enables host
    mode) in device mode. See the comments in that function for why this
    is safe w.r.t. the ordering requirements of PHY selection.

    * Modify init_utmi_usb_controller() to force "b session valid" in device
    mode, since the HW requires this. This is done in UTMI-specific code,
    since we only support device mode on the first USB controller, and that
    controller can only talk to a UTMI PHY.

    * Enhance ehci_hcd_init() to error-check the requested host-/device-mode
    vs. the dr_mode (dual-role mode) value present in device tree, and the
    HW configurations which support device mode.

    * Enhance ehci_hcd_init() not to skip HW initialization when switching
    between host and device mode on a controller. This requires remembering
    which mode the last initialization used.

    Cc: Jim Lin
    Cc: Stefan Agner
    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • Both init_{utmi,ulpi}_usb_controller() have nearly identical code for
    PHY type selection. Pull this out into a common function to remove the
    duplication.

    Cc: Jim Lin
    Cc: Stefan Agner
    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • The TRM for Tegra30 and later all state that USBMODE_CM_HC must be set
    before writing to hostpc1_devlc to select which PHY to use for a USB
    controller. However, neither init_{utmi,ulpi}_usb_controller() do this
    today, so the register writes they perform for PHY selection do not
    work.

    For the UTMI case, this was hacked around in commit 7e44d9320ed4 "ARM:
    Tegra: USB: EHCI: Add support for Tegra30/Tegra114" by adding code to
    ehci_hcd_init() which sets USBMODE_CM_HC and duplicates the PHY
    selection register write. This code doesn't cover the ULPI case, so I
    wouldn't be surprised if ULPI doesn't work with the current code, unless
    the ordering requirement only ends up being an issue in HW for UTMI not
    ULPI.

    This patch fixes init_{utmi,ulpi}_usb_controller() to correctly set
    USBMODE_CM_HC before selecting the PHY. Now that this works, we can
    remove the duplicate UTMI-specific code in ehci_hcd_init(), thus
    simplifying that function.

    Cc: Jim Lin
    Cc: Stefan Agner
    Signed-off-by: Stephen Warren

    Stephen Warren
     

14 May, 2014

1 commit


09 May, 2014

1 commit


30 Apr, 2014

3 commits


23 Apr, 2014

3 commits


17 Apr, 2014

3 commits

  • Combine the Tegra USB header file into one header file for all SoCs.
    Use ifdef to account for the difference, especially Tegra20 is quite
    different from newer SoCs. This avoids duplication, mainly for
    Tegra30 and newer devices.

    Reviewed-by: Stephen Warren
    Signed-off-by: Stefan Agner
    Signed-off-by: Tom Warren

    Stefan Agner
     
  • On Tegra30 and later, the PTS (parallel transceiver select) and STS
    (serial transceiver select) are part of the HOSTPC1_DEVLC_0 register
    rather than PORTSC1_0 register. Since the reset configuration
    usually matches the intended configuration, this error did not show
    up on Tegra30 devices.

    Also use the slightly different bit fields of first USB, (USBD) on
    Tegra20 and move those definitions to the Tegra20 specific header
    file.

    Reviewed-by: Stephen Warren
    Signed-off-by: Stefan Agner
    Signed-off-by: Tom Warren

    Stefan Agner
     
  • Clear the forced powerdown bit in the UTMIP_PLL_CFG2_0 register
    which brings USB2 in UTMI mode to work. This was clearly missing
    since the forced powerdown bit is set in reset by default for all
    USB ports.

    Acked-by: Stephen Warren
    Signed-off-by: Stefan Agner
    Tested-by: Stephen Warren
    Signed-off-by: Tom Warren

    Stefan Agner
     

11 Mar, 2014

3 commits

  • Many USB host controller drivers contain almost identical copies of the
    same virtual root hub descriptors. Put these into a common file to avoid
    duplication.

    Note that there were some very minor differences between the descriptors
    in the various files, such as:

    - USB 1.0 vs. USB 1.1
    - Manufacturer/Device ID
    - Max packet size
    - String content

    I assume these aren't relevant.

    Cc: Thomas Lange
    Cc: Shinya Kuribayashi
    Cc: Gary Jennejohn
    Cc: Wolfgang Denk
    Cc: Eric Millbrandt
    Cc: Pierre Aubert
    Cc: Stefan Roese
    Cc: Daniel Hellstrom
    Cc: Denis Peter
    Cc: Rodolfo Giometti
    Cc: Zhang Wei
    Cc: Mateusz Zalega
    Cc: Remy Bohmer
    Cc: Markus Klotzbuecher
    Cc: Minkyu Kang
    Cc: Gary Jennejohn
    Cc: C Nauman
    Cc: David Müller
    Cc: Yoshihiro Shimoda
    Cc: Nobuhiro Iwamatsu
    Cc: Thomas Abraham
    Cc: Tom Rini
    Cc: Andrew Murray
    Cc: Matej Frančeškin
    Cc: Cliff Cai
    Cc: Bryan Wu
    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • These data structures are passed to cache-flushing routines, and hence
    must be conform to both the USB the cache-flusing alignment requirements.
    That means aligning to USB_DMA_MINALIGN. This is important on systems
    where cache lines are >32 bytes.

    Signed-off-by: Stephen Warren

    Stephen Warren
     
  • Section 4.10.2 "Advance Queue" of ehci-specification-for-usb.pdf
    specifies how an EHCI controller loads a new QTD for processing if the
    QH is not already marked as active. It states:

    =====
    If the field Bytes to Transfer is not zero and the T-bit in the Alternate
    Next qTD Pointer is set to zero, then the host controller uses the
    Alternate Next qTD Pointer. Otherwise, the host controller uses the Next
    qTD Pointer. If Next qTD Pointer’s T-bit is set to a one, then the host
    controller exits this state and uses the horizontal pointer to the next
    schedule data structure.
    =====

    Hence, we must ensure that the alternate next QTD pointer's T-bit
    (TERMINATE) is set, so the EHCI controller knows to use the next QTD
    pointer.

    Signed-off-by: Stephen Warren

    Stephen Warren
     

26 Feb, 2014

1 commit


25 Feb, 2014

1 commit

  • Use first four characters for phy_type comparison. Strcmp() should not
    be used to check the phy_type string which maybe parsed by hwconfig_subarg().
    Hwconfig_subarg() returns part of hwconfig string starting from
    phy_type value till the end of the string. Since phy_type could be
    either "utmi" or "ulpi", strncmp() should be used so that a comparison
    of "utmi;fsl_ddr:bank_intlv=auto" with "utmi" will succeed.

    Signed-off-by: Shaohui Xie
    Signed-off-by: Nikhil Badola
    Reviewed-by: York Sun

    Nikhil Badola
     

06 Feb, 2014

1 commit