回覆: [PATCH net-next v6 2/7] dt-bindings: net: ftgmac100: Add AST2700 compatible
From: Jacky Chou
Date: Mon Nov 16 2026 - 23:34:58 EST
Hi Andrew,
Thank you for your reply.
> > > + - if:
> > > + properties:
> > > + compatible:
> > > + contains:
> > > + const: aspeed,ast2700-mac
> > > + then:
> > > + required:
> > > + - phy-mode
> >
> > [Severity: Medium]
> > Is phy-mode really mandatory for every AST2700 MAC node? The binding
> > also documents the use-ncsi boolean. That mode runs the NC-SI stack
> > over RMII instead of talking to an MDIO PHY. The first example in this
> > file sets use-ncsi and has no phy-mode property, and that is a valid
> > setup on the earlier Aspeed parts.
>
> This seems like a valid point. Maybe make it conditional like the code, either
> phy-mode, or use-ncsi. Both or neither is invalid.
>
Agreed, thanks for catching this. I went back through
ftgmac100_probe_dt() and confirmed the use-ncsi path never reaches
the phy-mode check at all -- it returns via ftgmac100_probe_ncsi()
before ftgmac100_mii_probe() (where the AST2700 phy-mode requirement
lives) is ever called. So requiring phy-mode unconditionally for
every AST2700 node was indeed wrong, and the first example in this
file (use-ncsi, no phy-mode) was correct as written.
I'll change the binding to require exactly one of the two instead of
phy-mode alone:
- if:
properties:
compatible:
contains:
const: aspeed,ast2700-mac
then:
oneOf:
- required:
- phy-mode
- required:
- use-ncsi
oneOf here means exactly one of phy-mode/use-ncsi must be present --
both or neither will fail validation, matching what you described.
I'll fold this into the binding patch for next version.
Thanks,
Jacky