[PATCH 11/13] usb: ehci-mx6: Fix usb type issue in DM driver

Marek Vasut marex at denx.de
Wed Sep 16 15:45:00 CEST 2020


On 9/16/20 2:57 PM, peng.fan at nxp.com wrote:
> From: Ye Li <ye.li at nxp.com>
> 
> Currently the clocks and power of USB controller and USB PHY are both
> controlled by ehci-mx6 driver in device probe. However, the function
> "ehci_usb_ofdata_to_platdata" calls "ehci_usb_phy_mode"
> to access PHY registers when "dr_mode" is set to OTG, both "dr_mode" and
> "extcon" properties are not set in DTB. This may cause hang at accessing
> USB PHY registers if the power and clocks are not enabled.
> 
> Change the usb type logic to more clear way:
> 1. plat->init_type: The requested USB mode type from uplayers
> 2. priv->init_type: The USB mode type specified by DTB or by the USB ID pin or
>    by external controller like tcpc or GPIO.
> 3. If two init_type are not same, return failure. Align with non-DM driver.
> 4. USB PHY access is moved after power and clock enabled.

Can we get rid of the board-specific function and move the information
into the DT, and then have the driver extract the info from the DT while
correctly managing clock and power domains ?


More information about the U-Boot mailing list