ixgbe: correct CS4223/7 PHY identification
authorEmil Tantilov <emil.s.tantilov@intel.com>
Wed, 17 May 2017 22:17:41 +0000 (15:17 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 31 May 2017 11:48:19 +0000 (04:48 -0700)
Previous method was unreliable. Use a different register to
differentiate between the SKUs.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index 5aa2c3cf7aecfa59de40a0eafd1f8e6b2a557bc7..b0cac961df3bf3235155a11684d633299f83e179 100644 (file)
@@ -84,8 +84,9 @@
 #define IXGBE_CS4227_GLOBAL_ID_LSB             0
 #define IXGBE_CS4227_GLOBAL_ID_MSB             1
 #define IXGBE_CS4227_SCRATCH                   2
-#define IXGBE_CS4223_PHY_ID                    0x7003  /* Quad port */
-#define IXGBE_CS4227_PHY_ID                    0x3003  /* Dual port */
+#define IXGBE_CS4227_EFUSE_PDF_SKU             0x19F
+#define IXGBE_CS4223_SKU_ID                    0x0010  /* Quad port */
+#define IXGBE_CS4227_SKU_ID                    0x0014  /* Dual port */
 #define IXGBE_CS4227_RESET_PENDING             0x1357
 #define IXGBE_CS4227_RESET_COMPLETE            0x5AA5
 #define IXGBE_CS4227_RETRIES                   15
index 50aaa2bd3c818458b1d7982c079e901c246cfb4d..32b35efde2df015b4d5b79b00c88a109bb422dde 100644 (file)
@@ -1807,16 +1807,16 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
        if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE)
                return IXGBE_ERR_PHY_ADDR_INVALID;
 
-       /* Get external PHY device id */
-       ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_GLOBAL_ID_MSB,
-                                 IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
+       /* Get external PHY SKU id */
+       ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
+                                      IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
        if (ret_val)
                return ret_val;
 
        /* When configuring quad port CS4223, the MAC instance is part
         * of the slice offset.
         */
-       if (reg_phy_ext == IXGBE_CS4223_PHY_ID)
+       if (reg_phy_ext == IXGBE_CS4223_SKU_ID)
                slice_offset = (hw->bus.lan_id +
                                (hw->bus.instance_id << 1)) << 12;
        else