
16 Sep
2020
16 Sep
'20
3:45 p.m.
On 9/16/20 2:57 PM, peng.fan@nxp.com wrote:
From: Ye Li ye.li@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:
- plat->init_type: The requested USB mode type from uplayers
- priv->init_type: The USB mode type specified by DTB or by the USB ID pin or by external controller like tcpc or GPIO.
- If two init_type are not same, return failure. Align with non-DM driver.
- 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 ?