Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Marangi" <ansuelsmth@gmail.com>, devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v22 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS
Date: Wed, 18 Nov 2026 12:42:52 +0000	[thread overview]
Message-ID: <sashiko-outbox-220932@kernel.org> (raw)
In-Reply-To: <20261117123956.11981-14-ansuelsmth@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] dt-bindings: net: pcs: airoha,scu conflicts with SCU generic
  PHY binding
- [Low] dt-bindings: net: pcs: unwieldy per-compatible conditionals in
  airoha,pcs.yaml
--

commit a852142e10dc6efd0e13f0e36a05eb4c25e78d50
Author: Christian Marangi <ansuelsmth@gmail.com>

dt-bindings: net: pcs: Document support for Airoha Ethernet PCS

This commit adds the Device Tree binding schema for the Airoha AN7581
Ethernet, PON, PCIe, and USB PCS and SerDes blocks.

> diff --git a/Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml b/Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml
> new file mode 100644
> index 0000000000000..9c1d116c1b016
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/pcs/airoha,pcs.yaml
[ ... ]
> +properties:
> +  compatible:
> +    enum:
> +      - airoha,an7581-pcs-eth
> +      - airoha,an7581-pcs-pon
> +      - airoha,an7581-pcs-pcie
> +      - airoha,an7581-pcs-usb
> +
> +  reg:
> +    minItems: 6
> +    maxItems: 15
> +
> +  reg-names:
> +    minItems: 6
> +    maxItems: 15
> +
> +  airoha,scu:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: phandle to the SCU node required to configure
> +      the serdes line to the correct interface mode.
> +
> +  phys:
> +    maxItems: 1
> +
> +  "#pcs-cells": true
> +
> +required:
> +  - compatible
> +  - reg
> +  - reg-names
> +  - "#pcs-cells"
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - airoha,an7581-pcs-eth
> +              - airoha,an7581-pcs-pon

[Severity: Low]
Should this binding be split into separate schema documents instead of
combining all four compatibles here?

Because the eth/pon, pcie, and usb variants do not share a common register
layout (requiring 8, 15, or 6 reg entries respectively), #pcs-cells count, or
required properties (airoha,scu vs phys), the top-level properties block only
sets loose bounds while three large per-compatible if-then blocks redefine
almost every property in the file.

[ ... ]

> +examples:
> +  - |
> +    #include <dt-bindings/phy/phy.h>
> +
> +    pcs@1fa08000 {
> +      compatible = "airoha,an7581-pcs-pon";
[ ... ]
> +      airoha,scu = <&scuclk>;
> +      #pcs-cells = <0>;
> +    };
[ ... ]
> +    pcs@1fa04000 {
> +      compatible = "airoha,an7581-pcs-pcie";
> +      reg = <0x1fa04000 0x1000>,
[ ... ]
> +            <0x1fa5a000 0x1000>,
> +            <0x1fa5b000 0x1000>,
> +            <0x1fa5c000 0x1000>;
> +      reg-names = "pcs_mac0", "hsgmii_an0", "hsgmii_pcs0",
> +                  "multi_sgmii0", "usxgmii0",
> +                  "hsgmii_rate_adp0",
> +                  "pcs_mac1", "hsgmii_an1", "hsgmii_pcs1",
> +                  "multi_sgmii1", "usxgmii1",
> +                  "hsgmii_rate_adp1",
> +                  "pcs_ana", "pcs_pma0", "pcs_pma1";
> +
> +      airoha,scu = <&scuclk>;
> +      #pcs-cells = <1>;
> +    };

[Severity: Medium]
Does the airoha,scu property duplicate and conflict with the existing generic
PHY provider on the AN7581 SCU node?

In Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml and
drivers/clk/clk-en7523.c (en7581_serdes_phy_set_mode()), the scuclk node
(airoha,en7581-scu) is not a syscon and already exposes SerDes interface mode
selection via #phy-cells = <1>. Requiring airoha,scu = <&scuclk> while
setting phys: false on the eth, pon, and pcie variants bypasses the existing
SCU PHY provider and causes syscon_regmap_lookup_by_phandle() on airoha,scu
to fail with -EINVAL when given &scuclk. If Chip SCU registers are needed
instead, existing Airoha bindings such as
Documentation/devicetree/bindings/thermal/airoha,en7581-thermal.yaml use
airoha,chip-scu pointing to &chip_scu.

In addition, pcs_ana (0x1fa5a000), pcs_pma0 (0x1fa5b000), and pcs_pma1
(0x1fa5c000) in the airoha,an7581-pcs-pcie example claim the same MMIO ranges
as csr-2l, pma0, and pma1 of phy@1fa5a000 (airoha,en7581-pcie-phy) in
arch/arm64/boot/dts/airoha/en7581.dtsi.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117123956.11981-1-ansuelsmth@gmail.com?part=13

  reply	other threads:[~2026-11-18 12:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 12:39 [PATCH net-next v22 00/15] net: pcs: Introduce support for fwnode PCS Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 01/15] net: phylink: make PCS phylink instance access RCU protected Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 02/15] net: phylink: keep and use MAC supported_interfaces in phylink struct Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 03/15] net: phylink: introduce internal phylink PCS handling Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 04/15] net: pcs: implement Firmware node support for PCS driver Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 05/15] net: phylink: save phylink instance fwnode on phylink_create Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 06/15] net: phylink: make phylink_validate state locked Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 07/15] net: phylink: add capabilities helpers and track modified advertising Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 08/15] net: phylink: support PCS provider release Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 09/15] net: phylink: support late PCS provider attach Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 10/15] net: Document PCS subsystem Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 11/15] MAINTAINERS: add myself as PCS subsystem maintainer Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 12/15] net: phylink: add .pcs_link_down PCS OP Christian Marangi
2026-11-17 12:39 ` [PATCH net-next v22 13/15] dt-bindings: net: pcs: Document support for Airoha Ethernet PCS Christian Marangi
2026-11-18 12:42   ` sashiko-bot [this message]
2026-11-17 12:39 ` [PATCH net-next v22 14/15] net: pcs: airoha: add PCS driver for Airoha AN7581 SoC Christian Marangi
2026-11-18 12:42   ` sashiko-bot
2026-11-17 12:39 ` [PATCH net-next v22 15/15] net: airoha: add phylink support Christian Marangi
2026-11-17 12:43 ` [PATCH net-next v22 00/15] net: pcs: Introduce support for fwnode PCS netdev-bot+sinfo
2026-11-17 12:47   ` Christian Marangi

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=sashiko-outbox-220932@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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