public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: u-boot <u-boot@lists.denx.de>, Marek Vasut <marex@denx.de>,
	"Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	Stefano Babic <sbabic@denx.de>,
	Martyn Welch <martyn.welch@collabora.com>,
	Fabio Estevam <festevam@gmail.com>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Tim Harvey <tharvey@gateworks.com>
Subject: Re: U-Boot support for IMX8MP dual-role
Date: Mon, 19 Sep 2022 08:20:52 +0200	[thread overview]
Message-ID: <12059772.O9o76ZdvQC@steina-w> (raw)
In-Reply-To: <CAJ+vNU14wBVaJuCsocCDUzoM=Rr3BEPJXWVe12Cq4J93zP03nw@mail.gmail.com>

Hello Tim,

Am Freitag, 16. September 2022, 20:43:54 CEST schrieb Tim Harvey:
> Greetings,
> 
> I'm wondering if anyone has done any work to get dual-role USB working
> for the IMX8MP (or any other dwc3 host based board) and how they went
> about it if so.
> 
> The imx8mp-venice-gw74xx has dual-role support through a USB Type-C
> connector with a TPS25821 (driverless) that monitors the CC signals
> and manages VBUS, as well as asserts gpio's:
> FAULT# - pinmuxed to OC pin
> SINK# - used as GPIO for role
> POL# - used for SS mux to connector
> 
> For linux this is managed with a usb-role-switch dt prop and a
> connector node with compatible of gpio-usb-b-connector and id-gpios
> [1]. I did not see anything like that in use in U-Boot for dwc3 hosts
> but perhaps I was looking in the wrong place.
> 
> For U-Boot I can get this type-C connector to work in host mode only
> by changing dr_mode="otg" to dr_mode="host". With the default dt prop
> dr_mode=otg dwc3-generic-peripheral is bound instead of
> dwc3-generic-host thus no host controller is found.
> 
> It seems to me that dwc3_glue_bind needs support added to be able to
> check id-gpios or vbus-gpios if usb-role-switch and something like
> gpio-usb-b-connector or linux,extcon-usb-gpio are used. Does this
> sound like the correct implementation?
> 
> I notice that drivers/usb/host/xhci-dwc3.c which is a driver for the
> dwc3 core (compatible snps,dwc3) and this does look at usb-role-swich
> however this driver as a subnode of fsl,imx8mp-dwc3 (glue) does not
> bind and perhaps that is an issue. In that driver usb-role-switch
> causes the driver to use role-switch-default-mode for the default mode
> which still does not look at an id/vbus pin so that would not be
> feature complete either.

For imx8mp you probably need something like [1] to support usb-role-switch.
But I am not aware how things are done in u-boot.

Best regards,
Alexander

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?id=a102f07e4edf0f1cf06bf9825ab10e26a29dd945

> Best Regards,
> 
> TIm
> 1
> https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git/commit/?
> h=for-next&id=c8a4192d238e9258ab0bc916b3c138a4722af215





      reply	other threads:[~2022-09-19 11:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 18:43 U-Boot support for IMX8MP dual-role Tim Harvey
2022-09-19  6:20 ` Alexander Stein [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12059772.O9o76ZdvQC@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=festevam@gmail.com \
    --cc=marex@denx.de \
    --cc=martyn.welch@collabora.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=sbabic@denx.de \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox