Re: [PATCH v7 01/13] dt-bindings: phy: Add zx297520v3 USB phy documentation

From: Krzysztof Kozlowski

Date: Fri Jul 17 2026 - 02:32:36 EST


On Fri, Jul 17, 2026 at 12:35:37AM +0300, Stefan Dösinger wrote:
> This binding will be used as a subnode of topcrm, which will be added in
> the next patch.

Irrelevant, drop. Also not true, because next patch is driver patch.

>
> Why is this a child node and not #phy-cells added to topcrm itself,
> like clocks and resets as writing-bindings.rst suggests? Because
> of_phy_provider_register checks if the of_node the PHY provider is added
> to belongs to the device or is a child of the device, so I can't put the
> PHY driver into an MFD (or AUX) child without its own node.

>
> Signed-off-by: Stefan Dösinger <stefandoesinger@xxxxxxxxx>
>
> ---
>
> How do I handle examples? It would be identical to the example in
> topcrm. The example needs the reset defines from the next patch in
> either case.

1. No, it does not need. Just use whatever numbers.
2. Other code would give you the hint: one example in parent's schema.

> ---
> .../bindings/phy/zte,zx297520v3-usb-phy.yaml | 96 ++++++++++++++++++++++
> MAINTAINERS | 2 +
> include/dt-bindings/phy/phy-zte-zx297520v3-usb.h | 12 +++
> 3 files changed, 110 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/phy/zte,zx297520v3-usb-phy.yaml b/Documentation/devicetree/bindings/phy/zte,zx297520v3-usb-phy.yaml
> new file mode 100644
> index 000000000000..8bad9365d5cc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/zte,zx297520v3-usb-phy.yaml
> @@ -0,0 +1,96 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/phy/zte,zx297520v3-usb-phy.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ZTE zx297520v3 USB and HSIC PHY
> +
> +maintainers:
> + - Stefan Dösinger <stefandoesinger@xxxxxxxxx>
> +
> +description: |
> + This PHY is found on zx297520v3 boards. It has no configurability on its own,
> + but it does require a correct reset and wait sequence to initialize. It can
> + provide interrupt notification when USB is connected and disconnected.
> +
> + The phy is a component of the board's topcrm controller. The hardware needs to
> + be declared as a child node of the zte,zx297520v3-topcrm node.
> +
> + The register space and IRQs always account for two PHYs: One USB 2.0 OTG phy
> + and a HSIC PHY. Not all boards have both. If one is missing, the corresponding
> + ready flag will never be set.
> +
> + The "include/dt-bindings/phy/phy-zte-zx297520v3-usb.h" header contains the
> + definition for the PHY indices.
> +
> +properties:
> + compatible:
> + const: zte,zx297520v3-usb-phy
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + items:
> + - description: IRQ reporting USB connection
> + - description: IRQ reporting USB disconnection
> + - description: IRQ reporting HSIC connection
> + - description: IRQ reporting HSIC disconnection
> +
> + interrupt-names:
> + items:
> + - const: usb-up
> + - const: usb-down
> + - const: hsic-up
> + - const: hsic-down
> +
> + resets:
> + items:
> + - description: USB phy reset
> + - description: HSIC phy reset

Why do you reference here resets from the parent? That's a clear signal
you have one device, so one device node regardless of Linux phy core
behavior.

> +
> + reset-names:
> + items:
> + - const: usb
> + - const: hsic
> +
> + "#phy-cells":
> + const: 1
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - interrupt-names
> + - resets
> + - reset-names
> + - "#phy-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/phy/phy-zte-zx297520v3-usb.h>
> +
> + topcrm: clock-controller {
> + compatible = "zte,zx297520v3-topcrm", "syscon";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #reset-cells = <1>;

Drop node, you have warnings.

> +
> + usb-phy@84 {
> + compatible = "zte,zx297520v3-usb-phy";
> + reg = <0x84>;
> + interrupts = <GIC_SPI 42 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 43 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 45 IRQ_TYPE_EDGE_RISING>,
> + <GIC_SPI 46 IRQ_TYPE_EDGE_RISING>;

Align it properly/

> + interrupt-names = "usb-up", "usb-down", "hsic-up", "hsic-down";
> + resets = <&topcrm 18>,
> + <&topcrm 20>;

Same here.

> + reset-names = "usb", "hsic";
> + #phy-cells = <1>;
> + };
> + };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 8729cea57c3d..cb50c2e3b4ea 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -3878,8 +3878,10 @@ L: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx (moderated for non-subscribers)
> S: Odd fixes
> F: Documentation/arch/arm/zte/
> F: Documentation/devicetree/bindings/arm/zte.yaml
> +F: Documentation/devicetree/bindings/phy/zte,zx297520v3-usb-phy.yaml
> F: arch/arm/boot/dts/zte/
> F: arch/arm/mach-zte/
> +F: include/dt-bindings/phy/phy-zte-zx297520v3-usb.h
>
> ARM/ZYNQ ARCHITECTURE
> M: Michal Simek <michal.simek@xxxxxxx>
> diff --git a/include/dt-bindings/phy/phy-zte-zx297520v3-usb.h b/include/dt-bindings/phy/phy-zte-zx297520v3-usb.h
> new file mode 100644
> index 000000000000..8a0a3ccbdd63
> --- /dev/null
> +++ b/include/dt-bindings/phy/phy-zte-zx297520v3-usb.h

Filename MUST match compatible.

> @@ -0,0 +1,12 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +/*
> + * Copyright (C) Stefan Dösinger.
> + */
> +
> +#ifndef __DT_BINDINGS_PHY_USB_ZX297520V3_H
> +#define __DT_BINDINGS_PHY_USB_ZX297520V3_H
> +
> +#define ZX297520V3_USB_PHY 0
> +#define ZX297520V3_HSIC_PHY 1
> +
> +#endif /* __DT_BINDINGS_PHY_USB_ZX297520V3_H */
>
> --
> 2.54.0
>