All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@oss.nxp.com>
To: u-boot@lists.denx.de, "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	Marek Vasut <marex@denx.de>, Fabio Estevam <festevam@gmail.com>,
	Wang Jie <dave.wang@rock-chips.com>
Cc: 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 00/10] usb: Add TCPCI driver and DWC3 OTG dual-role support
Date: Tue, 30 Jun 2026 09:48:55 +0800	[thread overview]
Message-ID: <akMgh8AbN6BX9UlS@shlinux89> (raw)
In-Reply-To: <20260621-tcpci-dwc3-v2-0-990ecacc111c@nxp.com>

Hi Marek,

Do you have time to give a look at this series?

Thanks,
Peng

On Sun, Jun 21, 2026 at 10:06:36AM +0800, Peng Fan (OSS) wrote:
>[V2] Just resend this patchset without
>"usb: tcpm: fix inverted poll condition in tcpm_pd_transmit()"
>
>This series adds TCPCI (Type-C Port Controller Interface) driver support
>to U-Boot's TCPM framework and enables runtime USB host/device mode
>switching on platforms using DWC3 with Type-C connectors.
>
>The work is motivated by the NXP i.MX8MP EVK, which has a PTN5110 TCPCI
>chip managing a USB Type-C data port. The goal is to support both
>"usb start" (host mode, for USB storage) and "ums"/"fastboot" (device
>mode, for flashing) on the same Type-C port, switchable at runtime.
>
>The series breaks down into three logical groups:
>
>TCPM bugfixes (patches 1-3):
>  Fix three issues discovered in the upstream TCPM state machine during
>  PD sink testing with various chargers:
>  - Inverted poll condition causing transmit to always time out
>  - Unnecessary hard resets on sink-only ports when source doesn't
>    respond to capabilities request
>  - Premature exit from poll loop after SNK_READY, missing source
>    follow-up messages (Get_Sink_Cap etc.) that trigger hard reset
>
>TCPCI driver and TCPM API extensions (patches 4-7):
>  - Lightweight PD negotiation tracing (RAM ring buffer, zero serial
>    overhead) for debugging charger interop issues
>  - TCPCI driver for NXP PTN5110 and compatible chips, ported from
>    the Linux kernel with adaptations for U-Boot's polled model
>  - New tcpm_setup_host_mode()/tcpm_setup_device_mode() APIs that
>    configure Type-C CC role and detect cable orientation without
>    running the full PD state machine -- appropriate for U-Boot's
>    synchronous, command-driven execution model
>  - pd-disable connector property support in tcpm_post_probe() to
>    skip the PD state machine for data-only ports while keeping the
>    TCPCI driver ops accessible
>
>DWC3 OTG and board support (patches 8-11):
>  - board_usb_init()/board_usb_cleanup() hooks in DWC3 generic glue,
>    called during child probe/remove to allow board-level Type-C
>    configuration before DWC3 core init
>  - OTG dual-bind: when dr_mode="otg", bind both dwc3-generic-host
>    and dwc3-generic-peripheral children; runtime mode switching via
>    dwc3_otg_deactivate_sibling() which removes the active sibling
>    before probing the new one
>  - i.MX8MP EVK board support wiring it all together: TCPCI DT nodes,
>    board_usb_init using TCPM APIs for CC role setup and SS mux
>    control, PD sink configuration for the power port
>
>Tested on NXP i.MX8MP EVK.
>
>Signed-off-by: Peng Fan <peng.fan@nxp.com>
>---
>Changes in v2:
>- Drop "usb: tcpm: fix inverted poll condition in tcpm_pd_transmit"
>  which was sent to list as a separate fix.
>- Link to v1: https://patch.msgid.link/20260617-tcpci-dwc3-v1-0-b824fe1e9299@nxp.com
>
>---
>Peng Fan (9):
>      usb: tcpm: avoid hard reset for sink-only ports on Source_Cap timeout
>      usb: tcpm: continue polling after PD negotiation to handle source messages
>      usb: tcpm: add lightweight PD negotiation tracing
>      usb: tcpm: add TCPCI (Type-C Port Controller Interface) driver
>      usb: tcpm: add setup_host_mode/device_mode/disable_src_vbus APIs
>      usb: tcpm: skip state machine for pd-disable ports
>      usb: dwc3: generic: support OTG dual-bind for runtime host/device switching
>      board: imx8mp_evk: enable USB PD sink via TCPCI
>      board: imx8mp_evk: add USB Type-C OTG support with TCPCI
>
>Ye Li (1):
>      usb: dwc3: generic: add board_usb_init/cleanup hooks
>
> arch/arm/dts/imx8mp-evk-u-boot.dtsi |  52 ++-
> board/nxp/imx8mp_evk/imx8mp_evk.c   |  78 ++++
> configs/imx8mp_evk_defconfig        |   3 +
> drivers/usb/dwc3/dwc3-generic.c     |  73 +++-
> drivers/usb/tcpm/Kconfig            |   9 +
> drivers/usb/tcpm/Makefile           |   1 +
> drivers/usb/tcpm/tcpci.c            | 778 ++++++++++++++++++++++++++++++++++++
> drivers/usb/tcpm/tcpm-internal.h    |  40 ++
> drivers/usb/tcpm/tcpm-uclass.c      |  87 ++++
> drivers/usb/tcpm/tcpm.c             |  46 ++-
> include/usb/tcpci.h                 | 185 +++++++++
> include/usb/tcpm.h                  |   4 +
> 12 files changed, 1350 insertions(+), 6 deletions(-)
>---
>base-commit: debaadb75013a6d3706a2137d540bf4660475e3e
>change-id: 20260617-tcpci-dwc3-653a5d9c8893
>
>Best regards,
>--  
>Peng Fan <peng.fan@nxp.com>
>

  parent reply	other threads:[~2026-06-30  1:45 UTC|newest]

Thread overview: 14+ 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-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 ` Peng Fan [this message]
2026-06-30  6:58   ` [PATCH v2 00/10] usb: Add TCPCI driver and DWC3 OTG dual-role support Marek Vasut
2026-06-30  8:16     ` Peng Fan (OSS)

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=akMgh8AbN6BX9UlS@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=marex@denx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.