Re: [v3 2/2] dsa: mv88e6xxx: make serdes SGMII/Fiber output amplitude configurable

Vladimir Oltean
2021-12-08T17:20:55Z

On Wed, Dec 08, 2021 at 06:10:09PM +0100, Marek Behún wrote:
> > > Yes, the pair
> > > serdes-tx-amplitude-millivolt
> > > serdes-tx-amplitude-millivolt-names
> > > is the best.
> > >
> > > If the second is not defined, the first should contain only one value,
> > > and that is used as default.
> > >
> > > If multiple values are defined, but "default" is not, the driver should
> > > set default value as the default value of the corresponding register.
> > >
> > > The only remaining question is this: I need to implement this also for
> > > comphy driver. In this case, the properties should be defined in the
> > > comphy node, not in the MAC node. But the comphy also supports PCIe,
> > > USB3 and SATA modes. We don't have strings for them. So this will need
> > > to be extended in the future.
> > >
> > > But for now this proposal seems most legit. I think the properties
> > > should be defined in common PHY bindings, and other bindings should
> > > refer to them via $ref.
> >
> > I wouldn't $ref the tx-amplitude-millivolt-names from the phy-mode,
> > because (a) not all phy-mode values are valid (think of parallel interfaces
> > like rgmii) and (b) because sata, pcie, usb are also valid SERDES
> > protocols as you point out. With the risk of a bit of duplication, I
> > think I'd keep the SERDES protocol names a separate thing for the YAML
> > validator.
>
> Not what I meant. What I meant was that the tx-amplitude-millivolt*
> properties should be defined in binding for common PHY (not network PHY)
> Documentation/devicetree/bindings/phy/phy-bindings.txt,
> and then the mv88e6xxx binding should refer it's
> tx-amplitude-millivolt* properties from there.
>
> And the definition in common PHY binding should list all modes in an
> enum, containing all network SerDes modes, plus the other modes like
> PCIe, USB3, DisplayPort, LVDS, SATA, ...

Sorry, I misunderstood what you meant by "common PHY bindings", thanks
for clarifying. Yes, Documentation/devicetree/bindings/phy/phy-bindings.txt
seems like the place, after being converted to YAML.