Re: [PATCH v4 1/2] dt-bindings: qcom,snps-dwc3: Add property indicating presence of eUSB2 phy

From: Thinh Nguyen

Date: Thu Jul 16 2026 - 19:54:08 EST


On Wed, Jul 15, 2026, Peter Chen wrote:
> On 26-07-16 00:09:47, Thinh Nguyen wrote:
> > >
> > > Only the new user for adding phy_type="eusb2" at dts needs to check the
> > > controller logic, and this is what the user needs to do that check the
> > > new added device tree property logic at the driver.
> >
> > To clarify, are you suggesting to introduce a new phy_type property to
> > indicate phy type? If so, that sounds similar to qcom,has-eusb2-phy but
> > more generic. Also, where do you plan to define it (dwc3 or phy node)?
> >
>
> No, I meant just adding new entry at below usbphy_modes array, that's the
> easier way. At the current code at of.c, it indeed mixes description of
> the phy interface (between controller and phy) and phy type, the array
> names phy interface, and dt property names "phy_type".

The naming of the property is unfortunate, but the usb.yaml explicitly
documents "phy_type" is for configuring the controller base on
phy-controller interface. Repurposing it to also mean phy type would be
a semantic change and may be harder to convince the DT maintainers to
accept.

>
> diff --git a/drivers/usb/phy/of.c b/drivers/usb/phy/of.c
> index 1ab134f45d67..5cbf17d493ad 100644
> --- a/drivers/usb/phy/of.c
> +++ b/drivers/usb/phy/of.c
> @@ -16,6 +16,7 @@ static const char *const usbphy_modes[] = {
> [USBPHY_INTERFACE_MODE_ULPI] = "ulpi",
> [USBPHY_INTERFACE_MODE_SERIAL] = "serial",
> [USBPHY_INTERFACE_MODE_HSIC] = "hsic",
> + [USBPHY_INTERFACE_MODE_EUSB2] = "eusb2",
> };
>
> line34: err = of_property_read_string(np, "phy_type", &phy_type);
>
> In fact, HSIC is not the interface between controller and PHY, it is
> after UTMI(+) or ULPI, and similar with eUSB2.
>
> The API of_usb_get_phy_mode is mainly used by controller driver
> to know what kinds of PHY it is connected, and do corresponding
> configuration, the configuration may not limit to interface between
> controller and PHY. Do you agree we just take "phy mode" and
> "phy type" are same thing, and delete "INTERFACE" in this file
> and add "eusb2" as a new "phy_type"?
>

So just deleting "INTERFACE" isn't enough. We'd also need to update the
documentation description and its enum list.

Also, for dwc3 core, phy_type = "eusb2" doesn't tell whether the UTMI
interface is 8-bit or 16-bit, which may be needed to configure
GUSB2PHYCFG.

BR,
Thinh