[PATCH v6 7/8] net: add MV88E61xx DSA driver

Vladimir Oltean vladimir.oltean at nxp.com
Wed Oct 26 21:33:00 CEST 2022


Sorry for the late reply.

On Thu, Oct 13, 2022 at 11:09:32AM -0700, Tim Harvey wrote:
> The SERDES configuration on the 88E6352/88E6240/88E6176/88E6172 (which
> I have documentation for) is not in port specific registers so I think
> I should move that to the probe function for the switch.

It's not in port specific registers for this switch family, because
there's a single SERDES port. What you could do is you could do the
SERDES initialization once per (this) switch in the per-port procedure,
if the current port is a SERDES port according to the C_MODE. This would
have to be done anyway for other switches. Anyway, what you did in v7
works too, you can leave it like that and others can refactor if needed
(I think; I didn't look in too much detail yet).

> > > +static int mv88e6xxx_port_enable(struct udevice *dev, int port, struct phy_device *phy)
> > > +{
> > > +     struct dsa_pdata *dsa_pdata = dev_get_uclass_plat(dev);
> > > +     struct mv88e6xxx_priv *priv = dev_get_priv(dev);
> > > +     int val, ret;
> > > +
> > > +     dev_dbg(dev, "%s P%d phy:0x%08x %s\n", __func__, port,
> > > +             phy->phy_id, phy_string_for_interface(phy->interface));
> > > +
> > > +     /*
> > > +      * Enable energy-detect sensing on PHY, used to determine when a PHY
> > > +      * port is physically connected
> > > +      */
> > > +     if (port != dsa_pdata->cpu_port) {
> >
> > Can you test based on phy->interface == PHY_INTERFACE_MODE_INTERNAL?
> > Support may come later for cascade ports, and those are ports without an
> > internal PHY which are not CPU ports.
> 
> In my config there are no ports with interface ==
> PHY_INTERFACE_MODE_INTERNAL so I'm not sure what you mean here. What
> situations does that come up in?

Ugh. Again the nasty Linux dt-binding legacy for this switch....

So normally, an Ethernet port has a phy-handle/fixed-link, and a phy-mode.
For a port connected to an internal PHY, you should have phy-handle = <&phy>
(which you do), and phy-mode = "internal" (which you don't). Linux
supports skipping both the phy-handle and the phy-mode.

Sorry for not realizing this in time. This is again a thing so that
U-Boot can know that you're operating on a port with an internal PHY,
rather than hardcoding this based on the assumption that the SERDES port
is the CPU port, and everything else has internal PHY (which assumes
RGMII does not exist).


More information about the U-Boot mailing list