]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ixgbe: Update NW_MNG_IF_SEL support for X553
authorTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 7 Jun 2017 21:36:19 +0000 (14:36 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 13 Oct 2017 02:43:49 +0000 (19:43 -0700)
The MAC register NW_MNG_IF_SEL fields have been redefined for
X553. These changes impact the iXFI driver code flow. Since iXFI is
only supported in X552, add MAC checks for iXFI flows.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26785078
(cherry picked from commit 48301cf22fa7d70db3ae777e374edfd4119fc826)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c

index 124b3dc52d560560598a01284445c78380304346..6a8008029e47e6af914e72e48db2ef28e7069f38 100644 (file)
@@ -387,7 +387,7 @@ u32 ixgbe_read_reg(struct ixgbe_hw *hw, u32 reg)
        if (ixgbe_removed(reg_addr))
                return IXGBE_FAILED_READ_REG;
        if (unlikely(hw->phy.nw_mng_if_sel &
-                    IXGBE_NW_MNG_IF_SEL_ENABLE_10_100M)) {
+                    IXGBE_NW_MNG_IF_SEL_SGMII_ENABLE)) {
                struct ixgbe_adapter *adapter;
                int i;
 
index bda573890ac2aef5912a9bfda4499cd58c0af70c..dbcf5ae777c15a5d89c09d5ed816309c81db5590 100644 (file)
@@ -3771,8 +3771,8 @@ struct ixgbe_info {
 #define IXGBE_NW_MNG_IF_SEL_PHY_SPEED_1G       BIT(19)
 #define IXGBE_NW_MNG_IF_SEL_PHY_SPEED_2_5G     BIT(20)
 #define IXGBE_NW_MNG_IF_SEL_PHY_SPEED_10G      BIT(21)
-#define IXGBE_NW_MNG_IF_SEL_ENABLE_10_100M     BIT(23)
-#define IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE       BIT(24)
+#define IXGBE_NW_MNG_IF_SEL_SGMII_ENABLE       BIT(25)
+#define IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE       BIT(24) /* X552 only */
 #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT 3
 #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD       \
                                (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT)
index aa34e0b131bb374838aeedb56782dbb8dcd91bc7..95adbda36235b4d27537d0bb2aed38f16e7463d7 100644 (file)
@@ -1555,9 +1555,14 @@ static s32 ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw)
  **/
 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
 {
+       struct ixgbe_mac_info *mac = &hw->mac;
        s32 status;
        u32 reg_val;
 
+       /* iXFI is only supported with X552 */
+       if (mac->type != ixgbe_mac_X550EM_x)
+               return IXGBE_ERR_LINK_SETUP;
+
        /* Disable AN and force speed to 10G Serial. */
        status = ixgbe_read_iosf_sb_reg_x550(hw,
                                        IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
@@ -1874,8 +1879,10 @@ static s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
        else
                force_speed = IXGBE_LINK_SPEED_1GB_FULL;
 
-       /* If internal link mode is XFI, then setup XFI internal link. */
-       if (!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
+       /* If X552 and internal link mode is XFI, then setup XFI internal link.
+        */
+       if (hw->mac.type == ixgbe_mac_X550EM_x &&
+           !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
                status = ixgbe_setup_ixfi_x550em(hw, &force_speed);
 
                if (status)
@@ -2628,7 +2635,8 @@ static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
        if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
                return IXGBE_ERR_CONFIG;
 
-       if (hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE) {
+       if (!(hw->mac.type == ixgbe_mac_X550EM_x &&
+             !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) {
                speed = IXGBE_LINK_SPEED_10GB_FULL |
                        IXGBE_LINK_SPEED_1GB_FULL;
                return ixgbe_setup_kr_speed_x550em(hw, speed);