U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: Marek Vasut <marek.vasut@mailbox.org>
Cc: u-boot@lists.denx.de, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Fabio Estevam <festevam@gmail.com>,
	Wang Jie <dave.wang@rock-chips.com>,
	Tom Rini <trini@konsulko.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Yao Zi <me@ziyao.cc>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Jonas Karlman <jonas@kwiboo.se>,
	Kever Yang <kever.yang@rock-chips.com>,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	Casey Connolly <casey.connolly@linaro.org>, Ye Li <ye.li@nxp.com>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Stefano Babic <sbabic@nabladev.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Alice Guo <alice.guo@nxp.com>,
	Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v2 07/10] usb: dwc3: generic: add board_usb_init/cleanup hooks
Date: Tue, 14 Jul 2026 22:04:32 +0800	[thread overview]
Message-ID: <alZB8CUrzBs1mTs8@shlinux89> (raw)
In-Reply-To: <74b9d259-b180-4ca7-9cf6-1c93e175e1f4@mailbox.org>

On Sat, Jul 11, 2026 at 10:00:52PM +0200, Marek Vasut wrote:
>On 6/21/26 4:06 AM, Peng Fan (OSS) wrote:
>> From: Ye Li <ye.li@nxp.com>
>> 
>> Call board_usb_init() during dwc3_generic_probe() and
>> board_usb_cleanup() during dwc3_generic_remove() to allow
>> board-level USB configuration (e.g. Type-C CC role, SS mux,
>> VBUS control) before DWC3 core initialization.
>> 
>> Signed-off-by: Ye Li <ye.li@nxp.com>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
...
>>   	dwc3_shutdown_phy(dev, &priv->phys);
>>   	unmap_physmem(dwc3->regs, MAP_NOCACHE);
>> +	if (mode == USB_DR_MODE_HOST)
>> +		board_usb_cleanup(dev_seq(dev), USB_INIT_HOST);
>> +	else if (mode == USB_DR_MODE_PERIPHERAL)
>> +		board_usb_cleanup(dev_seq(dev), USB_INIT_DEVICE);
>> +
>This is supposed to be generic DT based glue code, can we avoid the
>board-specific callbacks entirely ?

We need to invoke TCPM configuration code, dropping board callbacks means
we need put some #ifdef in dwc3 drivers:

#if CONFIG_IS_ENABLED(TYPEC_TCPM)
static int dwc3_typec_setup(struct udevice *dev, struct dwc3_generic_priv *priv,
                           enum usb_dr_mode mode)
{
	/* Handling tcpm */	
}
#else
static int dwc3_typec_setup(struct udevice *dev, struct dwc3_generic_priv *priv,
                           enum usb_dr_mode mode)
{
	return 0;
}
#endif

I could use above in V3.

Thanks,
Peng

  reply	other threads:[~2026-07-14 14:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-21  2:06 [PATCH v2 00/10] usb: Add TCPCI driver and DWC3 OTG dual-role support Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 01/10] usb: tcpm: avoid hard reset for sink-only ports on Source_Cap timeout Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 02/10] usb: tcpm: continue polling after PD negotiation to handle source messages Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 03/10] usb: tcpm: add lightweight PD negotiation tracing Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 04/10] usb: tcpm: add TCPCI (Type-C Port Controller Interface) driver Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 05/10] usb: tcpm: add setup_host_mode/device_mode/disable_src_vbus APIs Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 06/10] usb: tcpm: skip state machine for pd-disable ports Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 07/10] usb: dwc3: generic: add board_usb_init/cleanup hooks Peng Fan (OSS)
2026-07-11 20:00   ` Marek Vasut
2026-07-14 14:04     ` Peng Fan [this message]
2026-07-14 14:43       ` Marek Vasut
2026-06-21  2:06 ` [PATCH v2 08/10] usb: dwc3: generic: support OTG dual-bind for runtime host/device switching Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 09/10] board: imx8mp_evk: enable USB PD sink via TCPCI Peng Fan (OSS)
2026-06-21  2:06 ` [PATCH v2 10/10] board: imx8mp_evk: add USB Type-C OTG support with TCPCI Peng Fan (OSS)
2026-06-30  1:48 ` [PATCH v2 00/10] usb: Add TCPCI driver and DWC3 OTG dual-role support Peng Fan
2026-06-30  6:58   ` Marek Vasut
2026-06-30  8:16     ` Peng Fan (OSS)
2026-07-11 14:45       ` Peng Fan
2026-07-11 20:44         ` Marek Vasut

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=alZB8CUrzBs1mTs8@shlinux89 \
    --to=peng.fan@oss.nxp.com \
    --cc=alice.guo@nxp.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=dave.wang@rock-chips.com \
    --cc=festevam@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kauschluss@disroot.org \
    --cc=kever.yang@rock-chips.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marek.vasut@mailbox.org \
    --cc=me@ziyao.cc \
    --cc=mkorpershoek@kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@nabladev.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=semen.protsenko@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@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