[PATCH 5/9] net: dsa: felix: configure the in-band autoneg property based on OF node info

Vladimir Oltean vladimir.oltean at nxp.com
Wed Sep 29 14:21:23 CEST 2021


Hi Ramon,

On Tue, Sep 28, 2021 at 04:34:58PM +0300, Ramon Fried wrote:
> On Tue, Sep 28, 2021 at 2:48 AM Vladimir Oltean <vladimir.oltean at nxp.com> wrote:
> >
> > Instead of trying to guess which operating modes need in-band
> > negotiation to be active and which ones don't, parse the available
> > information from the device tree. That will be correct in the cases we
> > can already guess, and more.
> >
> > Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
> > ---
> >  drivers/net/mscc_eswitch/felix_switch.c | 10 ++++------
> >  1 file changed, 4 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/mscc_eswitch/felix_switch.c b/drivers/net/mscc_eswitch/felix_switch.c
> > index 6aa79784460d..1df7d03fc40c 100644
> > --- a/drivers/net/mscc_eswitch/felix_switch.c
> > +++ b/drivers/net/mscc_eswitch/felix_switch.c
> > @@ -16,6 +16,7 @@
> >   */
> >
> >  #include <dm/device_compat.h>
> > +#include <dm/of_extra.h>
> >  #include <linux/delay.h>
> >  #include <net/dsa.h>
> >  #include <asm/io.h>
> > @@ -210,17 +211,14 @@ static int felix_init_sxgmii(struct mii_dev *imdio, int pidx)
> >  static void felix_start_pcs(struct udevice *dev, int port,
> >                             struct phy_device *phy, struct mii_dev *imdio)
> >  {
> > -       bool autoneg = true;
> > -
> > -       if (phy->phy_id == PHY_FIXED_ID ||
> > -           phy->interface == PHY_INTERFACE_MODE_SGMII_2500)

Thanks a lot for the quick review and for merging a large portion of the changes.

This patch now conflicts with commit 7c2d5d1642cb ("net: freescale:
replace usage of phy-mode = "sgmii-2500" with "2500base-x""), because
the phy->interface is now PHY_INTERFACE_MODE_2500BASEX.

Would you like me to resend this series so that it applies cleanly?
There is also one other change I would like to make in the sja1105
driver, and I will also try to split it up in two, to avoid breaking the
100KB email limit which triggers mailing list moderation warnings.

> > -               autoneg = false;
> > +       ofnode node = dsa_port_get_ofnode(dev, port);
> > +       bool inband_an = ofnode_eth_uses_inband_aneg(node);
> >
> >         switch (phy->interface) {
> >         case PHY_INTERFACE_MODE_SGMII:
> >         case PHY_INTERFACE_MODE_SGMII_2500:
> >         case PHY_INTERFACE_MODE_QSGMII:
> > -               felix_init_sgmii(imdio, port, autoneg);
> > +               felix_init_sgmii(imdio, port, inband_an);
> >                 break;
> >         case PHY_INTERFACE_MODE_XGMII:
> >         case PHY_INTERFACE_MODE_XFI:
> > --
> > 2.25.1
> >
> Reviewed-by: Ramon Fried <rfried.dev at gmail.com>


More information about the U-Boot mailing list