]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers: net: phy: aquantia: drop XGMII as a valid system interface proto
authorAlex Marginean <alexandru.marginean@nxp.com>
Wed, 4 Dec 2019 13:32:15 +0000 (15:32 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Mon, 9 Mar 2020 23:11:24 +0000 (18:11 -0500)
Use either USXGMII or XFI in aquantia_set_proto and drop XGMII as a valid
protocol configuration.  The PHY doesn't support it, it's just used as an
alias for one of the other two protocols.

Signed-off-by: Florin Chiculita <florinlaurentiu.chiculita@nxp.com>
Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/aquantia.c

index c4bd4430017763ffb658e492752e1e2f03a2142e..25d30a65e7942bf5264f8d379d2e80de81958481 100644 (file)
@@ -306,30 +306,29 @@ struct {
                                           AQUANTIA_VND1_GSTART_RATE_1G},
        [PHY_INTERFACE_MODE_SGMII_2500] = {0x144, AQUANTIA_VND1_GSYSCFG_2_5G,
                                           AQUANTIA_VND1_GSTART_RATE_2_5G},
-       [PHY_INTERFACE_MODE_XGMII] =      {0x100, AQUANTIA_VND1_GSYSCFG_10G,
-                                          AQUANTIA_VND1_GSTART_RATE_10G},
        [PHY_INTERFACE_MODE_XFI] =        {0x100, AQUANTIA_VND1_GSYSCFG_10G,
                                           AQUANTIA_VND1_GSTART_RATE_10G},
        [PHY_INTERFACE_MODE_USXGMII] =    {0x080, AQUANTIA_VND1_GSYSCFG_10G,
                                           AQUANTIA_VND1_GSTART_RATE_10G},
 };
 
-static int aquantia_set_proto(struct phy_device *phydev)
+static int aquantia_set_proto(struct phy_device *phydev,
+                             phy_interface_t interface)
 {
        int i;
 
-       if (!aquantia_syscfg[phydev->interface].cnt)
+       if (!aquantia_syscfg[interface].cnt)
                return 0;
 
        /* set the default rate to enable the SI link */
        phy_write(phydev, MDIO_MMD_VEND1, AQUANTIA_VND1_GSTART_RATE,
-                 aquantia_syscfg[phydev->interface].start_rate);
+                 aquantia_syscfg[interface].start_rate);
 
        /* set selected protocol for all relevant line side link speeds */
-       for (i = 0; i <= aquantia_syscfg[phydev->interface].cnt; i++)
+       for (i = 0; i <= aquantia_syscfg[interface].cnt; i++)
                phy_write(phydev, MDIO_MMD_VEND1,
                          AQUANTIA_VND1_GSYSCFG_BASE + i,
-                         aquantia_syscfg[phydev->interface].syscfg);
+                         aquantia_syscfg[interface].syscfg);
        return 0;
 }
 
@@ -444,6 +443,8 @@ int aquantia_config(struct phy_device *phydev)
         * on FW config
         */
        if (interface == PHY_INTERFACE_MODE_XGMII) {
+               debug("use XFI or USXGMII SI protos, XGMII is not valid\n");
+
                reg_val1 = phy_read(phydev, MDIO_MMD_PHYXS,
                                    AQUANTIA_SYSTEM_INTERFACE_SR);
                if ((reg_val1 & AQUANTIA_SI_IN_USE_MASK) == AQUANTIA_SI_USXGMII)
@@ -466,7 +467,7 @@ int aquantia_config(struct phy_device *phydev)
                mdelay(10);
 
                /* configure protocol based on phydev->interface */
-               aquantia_set_proto(phydev);
+               aquantia_set_proto(phydev, interface);
                /* apply custom configuration based on DT */
                aquantia_dts_config(phydev);