mbox series

[v1,0/6] arm64: dts: verdin-imx8mp: usb dual-role switching et. al.

Message ID 20221102131203.35648-1-marcel@ziswiler.com (mailing list archive)
Headers show
Series arm64: dts: verdin-imx8mp: usb dual-role switching et. al. | expand

Message

Marcel Ziswiler Nov. 2, 2022, 1:11 p.m. UTC
From: Marcel Ziswiler <marcel.ziswiler@toradex.com>


This series is an assortment of USB dual-role specific commits as
follows:

Improvement of pinctrl for vbus-supplies:
As we are using two fixed regulators for Verdin USB_1_EN (SODIMM 155)
and Verdin USB_2_EN (SODIMM 185), those should be muxed as GPIOs rather
than OTG_PWR.

Removal of USB_2 over-current detection disabling:
The disable-over-current property is only applicable for the
ci-hdrc-usb2 and dwc2 drivers while the i.MX 8M Plus integrates dwc3
IP. Therefore remove this property which does not really serve any
purpose here.

Addition of USB_1 over-current detection:
Add Verdin USB_1 over-current detection functionality via Verdin
USB_1_OC# (SODIMM 157) being active-low and removing its previous
gpio_hog3 mapping.

Disabling of USB port power controls:
Disable port power control on Verdin USB_1/2 as we use regular
fixed-regulators with Verdin USB_1/2_EN as enable GPIOs.

Addition of GPIO USB-B connector:
Add GPIO USB-B connector (gpio-usb-b-connector) functionality using
Verdin USB_1_ID.

Marking USB_2 as permanently attached:
As both Dahlia and the Verdin Development Board have on-carrier
permanently attached USB hubs mark Verdin USB_2 as such.

Note:
Currently, I am still seeing a rare race condition of sorts when booting
the system with Verdin USB_1 as a host port with a USB memory stick
plugged in. This exact patch series applied on top of NXP's latest
downstream 5.15.52_2.1.0 release (together with backporting a few more
dwc3-specific patches) actually makes this same use case work very
reliably. However, NXP also keeps further downstream-only patches which
I plan to further investigate and hopefully upstream a proper fix for
soon.


Marcel Ziswiler (6):
  arm64: dts: verdin-imx8mp: improve pinctrl for vbus-supplies
  arm64: dts: verdin-imx8mp: remove usb_2 over-current detection
    disabling
  arm64: dts: verdin-imx8mp: add usb_1 over-current detection
  arm64: dts: verdin-imx8mp: disable usb port power control
  arm64: dts: verdin-imx8mp: add gpio usb-b connector
  arm64: dts: verdin-imx8mp: dahlia: mark usb_2 permanently attached

 .../dts/freescale/imx8mp-verdin-dahlia.dtsi   |  1 +
 .../boot/dts/freescale/imx8mp-verdin.dtsi     | 40 ++++++++++++++-----
 2 files changed, 32 insertions(+), 9 deletions(-)

Comments

Shawn Guo Nov. 11, 2022, 5:48 a.m. UTC | #1
On Wed, Nov 02, 2022 at 02:11:57PM +0100, Marcel Ziswiler wrote:
> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> 
> 
> This series is an assortment of USB dual-role specific commits as
> follows:
> 
> Improvement of pinctrl for vbus-supplies:
> As we are using two fixed regulators for Verdin USB_1_EN (SODIMM 155)
> and Verdin USB_2_EN (SODIMM 185), those should be muxed as GPIOs rather
> than OTG_PWR.
> 
> Removal of USB_2 over-current detection disabling:
> The disable-over-current property is only applicable for the
> ci-hdrc-usb2 and dwc2 drivers while the i.MX 8M Plus integrates dwc3
> IP. Therefore remove this property which does not really serve any
> purpose here.
> 
> Addition of USB_1 over-current detection:
> Add Verdin USB_1 over-current detection functionality via Verdin
> USB_1_OC# (SODIMM 157) being active-low and removing its previous
> gpio_hog3 mapping.
> 
> Disabling of USB port power controls:
> Disable port power control on Verdin USB_1/2 as we use regular
> fixed-regulators with Verdin USB_1/2_EN as enable GPIOs.
> 
> Addition of GPIO USB-B connector:
> Add GPIO USB-B connector (gpio-usb-b-connector) functionality using
> Verdin USB_1_ID.
> 
> Marking USB_2 as permanently attached:
> As both Dahlia and the Verdin Development Board have on-carrier
> permanently attached USB hubs mark Verdin USB_2 as such.
> 
> Note:
> Currently, I am still seeing a rare race condition of sorts when booting
> the system with Verdin USB_1 as a host port with a USB memory stick
> plugged in. This exact patch series applied on top of NXP's latest
> downstream 5.15.52_2.1.0 release (together with backporting a few more
> dwc3-specific patches) actually makes this same use case work very
> reliably. However, NXP also keeps further downstream-only patches which
> I plan to further investigate and hopefully upstream a proper fix for
> soon.

Thanks for the noting!

> 
> 
> Marcel Ziswiler (6):
>   arm64: dts: verdin-imx8mp: improve pinctrl for vbus-supplies
>   arm64: dts: verdin-imx8mp: remove usb_2 over-current detection
>     disabling
>   arm64: dts: verdin-imx8mp: add usb_1 over-current detection
>   arm64: dts: verdin-imx8mp: disable usb port power control
>   arm64: dts: verdin-imx8mp: add gpio usb-b connector
>   arm64: dts: verdin-imx8mp: dahlia: mark usb_2 permanently attached

Applied all, thanks!