Devicetree
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: James Hilliard <james.hilliard1@gmail.com>,
	Lee Jones <lee@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>
Cc: mfd@lists.linux.dev, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v5 4/5] dt-bindings: net: x-powers: add AC200/AC300 EPHY packages
Date: Tue, 11 Aug 2026 09:15:07 +0200	[thread overview]
Message-ID: <9d596af3-be5f-4f02-aeaf-ae5d627475c5@kernel.org> (raw)
In-Reply-To: <20260809-submit-acx00-of-dynamic-v1-v5-4-bfa1f8518b28@gmail.com>

On 09/08/2026 22:28, James Hilliard wrote:
> The AC200 and AC300 contain compatible Fast Ethernet link PHYs which
> report the same Clause 22 identifier and use the same link-side register
> layout. Their package control paths differ: AC200 uses registers in its
> I2C MFD, while the AC300 control range is at a second Clause 22 address
> fixed at 16 plus the link address.
> 
> Describe both variants as Ethernet PHY packages. The package reg value is
> the link PHY base address and the child supplies the documented PHY ID,
> because the identification registers cannot be read until package setup
> has completed. The AC300 driver reaches its control range with the PHY
> package offset helpers. The AC200 package instead references its MFD.
> 
> Give fixed hardware variant-specific compatibles. Also provide an ACx00
> compatible for systems which can contain either package, with one packed
> NVMEM field containing calibration in bits 3 through 0, the AC300 selector
> in bit 8 and its low-calibration selector in bit 9. Such a description
> contains the potential resources for both backends; the driver consumes
> only those selected by the configuration field.
> 
> Describe the package clock, supply and optional xMII receive-clock
> inversion needed by some integrations. A fixed AC200 package may omit the
> NVMEM field and use its internal calibration copy. Limit AC300-capable link
> addresses to 0 through 7 so the control address remains in the documented
> range 16 through 23.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  .../bindings/net/x-powers,acx00-ephy-package.yaml  | 207 +++++++++++++++++++++
>  1 file changed, 207 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/x-powers,acx00-ephy-package.yaml b/Documentation/devicetree/bindings/net/x-powers,acx00-ephy-package.yaml
> new file mode 100644
> index 000000000000..ae0c5e980c39
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/x-powers,acx00-ephy-package.yaml
> @@ -0,0 +1,207 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/x-powers,acx00-ephy-package.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: X-Powers AC200 and AC300 Ethernet PHY packages
> +
> +maintainers:
> +  - James Hilliard <james.hilliard1@gmail.com>
> +
> +description:
> +  The AC200 and AC300 contain compatible Fast Ethernet PHY blocks which report
> +  the same Clause 22 PHY ID and use the same link-side register layout. The
> +  package control paths differ. AC200 control registers are part of an I2C MFD,
> +  while AC300 control registers occupy a second Clause 22 address fixed at 16
> +  plus the link PHY address.
> +
> +  Systems with a known package use the corresponding AC200 or AC300 compatible.
> +  Systems which can contain either package use the ACx00 compatible and a
> +  packed NVMEM configuration field to select the backend at runtime.
> +
> +  The link PHY cannot report its ID until the package control sequence has
> +  completed, so its child node supplies the documented PHY ID. The package and
> +  child use the same base address. The AC200 driver programs that address into
> +  the package, while the AC300 driver derives its control address from it.
> +
> +select:
> +  properties:
> +    compatible:
> +      enum:
> +        - x-powers,ac200-ephy-package
> +        - x-powers,ac300-ephy-package
> +        - x-powers,acx00-ephy-package
> +  required:
> +    - compatible

Why do you need the select?

> +
> +properties:
> +  compatible:
> +    enum:
> +      - x-powers,ac200-ephy-package
> +      - x-powers,ac300-ephy-package
> +      - x-powers,acx00-ephy-package
> +
> +  reg:
> +    maximum: 31
> +
> +  clocks:
> +    maxItems: 1
> +    description:
> +      AC300 input clock, running at 24, 25, or 27 MHz. The AC200 input clock
> +      belongs to the referenced AC200 MFD instead.

Drop last sentence. Just confusing - what is a referenced MFD? There is
no such thing in the bindings as MFD and the bindings cannot depend on
Linux subsystem.

> +
> +  vcc-supply:
> +    description:
> +      3.3 V package supply. This is connected to EPHY_VCC on AC200 and VCC1
> +      on AC300.
> +
> +  nvmem-cells:
> +    maxItems: 1
> +    description:
> +      Packed EPHY configuration field. Bits 3 through 0 contain the analog
> +      calibration code, bits 7 through 4 are reserved, bit 8 selects AC300
> +      when set and AC200 when clear, and bit 9 requests the AC300
> +      low-calibration tuning sequence. A fixed AC200 package may provide only
> +      the low calibration bits or omit the cell and use its internal eFuse
> +      copy instead.
> +
> +  nvmem-cell-names:
> +    const: configuration
> +
> +  x-powers,ac200:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: Reference to the AC200 MFD containing this Ethernet PHY

Confusing. "Containing" means this is part of the other one, but
phandles do not express that. Anyway, there is no such thing as MFD so
describe properly without using Linuxisms what do you need here. Then
say what for (purpose).


> +
> +  x-powers,xmii-rx-clock-inverted:
> +    type: boolean
> +    description:
> +      Invert the xMII receive clock inside the PHY. This is required by some
> +      SoC integrations, including the Allwinner H6 AC200 connection.
> +
> +patternProperties:
> +  ^ethernet-phy@[a-f0-9]+$:
> +    $ref: ethernet-phy.yaml#
> +    properties:
> +      compatible:
> +        const: ethernet-phy-id0044.1400
> +    required:
> +      - compatible
> +    unevaluatedProperties: false
> +
> +required:
> +  - compatible
> +  - vcc-supply
> +
> +dependentRequired:
> +  nvmem-cells: [ nvmem-cell-names ]

Only this is needed

> +  nvmem-cell-names: [ nvmem-cells ]

This is not.

> +
> +allOf:
> +  - $ref: ethernet-phy-package.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          const: x-powers,ac200-ephy-package
> +    then:
> +      properties:
> +        clocks: false
> +      required:
> +        - x-powers,ac200
> +  - if:
> +      properties:
> +        compatible:
> +          const: x-powers,ac300-ephy-package
> +    then:
> +      properties:
> +        reg:
> +          maximum: 7
> +        x-powers,ac200: false
> +      required:
> +        - clocks
> +        - nvmem-cells
> +        - nvmem-cell-names
> +  - if:
> +      properties:
> +        compatible:
> +          const: x-powers,acx00-ephy-package
> +    then:
> +      properties:
> +        reg:
> +          maximum: 7
> +      required:
> +        - clocks
> +        - nvmem-cells
> +        - nvmem-cell-names
> +        - x-powers,ac200
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    mdio {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        ethernet-phy-package@0 {
> +            compatible = "x-powers,acx00-ephy-package";
> +            reg = <0>;
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            clocks = <&pwm 5>;
> +            vcc-supply = <&reg_3v3>;
> +            nvmem-cells = <&ephy_configuration>;
> +            nvmem-cell-names = "configuration";
> +            x-powers,ac200 = <&ac200>;
> +
> +            ethernet-phy@0 {
> +                compatible = "ethernet-phy-id0044.1400";
> +                reg = <0>;
> +            };
> +        };
> +    };

One example is enough, they are all almost the same (difference in one
property - clocks - does not warrant a new example usually).


Best regards,
Krzysztof

  reply	other threads:[~2026-08-11  7:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09 20:28 [PATCH net-next v5 0/5] net: phy: add X-Powers AC200/AC300 EPHY support James Hilliard
2026-08-09 20:28 ` [PATCH net-next v5 1/5] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
2026-08-11  7:07   ` Krzysztof Kozlowski
2026-08-11  7:23     ` James Hilliard
2026-08-11  7:27       ` Krzysztof Kozlowski
2026-08-11 16:50       ` Andrew Lunn
2026-08-09 20:28 ` [PATCH net-next v5 2/5] mfd: syscon: Add managed registration for external regmaps James Hilliard
2026-08-09 20:28 ` [PATCH net-next v5 3/5] mfd: ac200: Add X-Powers AC200 support James Hilliard
2026-08-09 20:28 ` [PATCH net-next v5 4/5] dt-bindings: net: x-powers: add AC200/AC300 EPHY packages James Hilliard
2026-08-11  7:15   ` Krzysztof Kozlowski [this message]
2026-08-09 20:28 ` [PATCH net-next v5 5/5] net: phy: add X-Powers AC200/AC300 EPHY driver James Hilliard

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=9d596af3-be5f-4f02-aeaf-ae5d627475c5@kernel.org \
    --to=krzk@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=james.hilliard1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mfd@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /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