Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/676454/?format=api
{ "id": 676454, "url": "http://patchwork.ozlabs.org/api/patches/676454/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1475105746-43737-1-git-send-email-donald.c.skidmore@intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1475105746-43737-1-git-send-email-donald.c.skidmore@intel.com>", "list_archive_url": null, "date": "2016-09-28T23:35:46", "name": "ixgbe: Add X553 FW ALEF support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "ebce329b5b08a594f35d97c69d0cc41aed0c88f4", "submitter": { "id": 4487, "url": "http://patchwork.ozlabs.org/api/people/4487/?format=api", "name": "Skidmore, Donald C", "email": "donald.c.skidmore@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1475105746-43737-1-git-send-email-donald.c.skidmore@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/676454/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/676454/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3skt0W1V63z9sRZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 29 Sep 2016 08:38:51 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8E5BC32919;\n\tWed, 28 Sep 2016 22:38:49 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id Mubu5jwDzZT9; Wed, 28 Sep 2016 22:38:40 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0F206328D0;\n\tWed, 28 Sep 2016 22:38:40 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 221DB1CF839\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 28 Sep 2016 22:38:39 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 1E5EA85233\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 28 Sep 2016 22:38:39 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id PmyIc3aK4vyN for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 28 Sep 2016 22:38:36 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 8C39F8A66D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 28 Sep 2016 22:38:36 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP; 28 Sep 2016 15:38:36 -0700", "from dcskidmo-m40.jf.intel.com ([134.134.3.25])\n\tby fmsmga001.fm.intel.com with ESMTP; 28 Sep 2016 15:38:12 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.30,412,1470726000\"; d=\"scan'208\";\n\ta=\"1047178669\"", "From": "Donald C Skidmore <donald.c.skidmore@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 28 Sep 2016 19:35:46 -0400", "Message-Id": "<1475105746-43737-1-git-send-email-donald.c.skidmore@intel.com>", "X-Mailer": "git-send-email 2.4.3", "Subject": "[Intel-wired-lan] [PATCH] ixgbe: Add X553 FW ALEF support", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "This patch add X553 FW ALEF support for B0. ALEF is the new unified\nFW. This contains updated register defines for ALEF speed\nconfiguration. Likewise it also removes the AN_CNTL_8 usage from\nthe native SFI flow as it is no longer supported by FW.\n\nSigned-off-by: Don Skidmore <donald.c.skidmore@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 16 ++\n drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 241 +++++++++++++++++++-------\n 2 files changed, 192 insertions(+), 65 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\nindex 998708c..312bffb 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h\n@@ -3588,9 +3588,25 @@ struct ixgbe_info {\n #define IXGBE_KRM_DSP_TXFFE_STATE_5(P)\t((P) ? 0x8638 : 0x4638)\n #define IXGBE_KRM_RX_TRN_LINKUP_CTRL(P)\t((P) ? 0x8B00 : 0x4B00)\n #define IXGBE_KRM_PMD_DFX_BURNIN(P)\t((P) ? 0x8E00 : 0x4E00)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20(P)\t((P) ? 0x9054 : 0x5054)\n #define IXGBE_KRM_TX_COEFF_CTRL_1(P)\t((P) ? 0x9520 : 0x5520)\n #define IXGBE_KRM_RX_ANA_CTL(P)\t\t((P) ? 0x9A00 : 0x5A00)\n \n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_DA\t\t~(0x3 << 20)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_SR\t\tBIT(20)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_LR\t\t(0x2 << 20)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SGMII_EN\t\tBIT(25)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_AN37_EN\t\tBIT(26)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_AN_EN\t\tBIT(27)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_10M\t\t~(0x7 << 28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_100M\t\tBIT(28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_1G\t\t(0x2 << 28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_10G\t\t(0x3 << 28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_AN\t\t(0x4 << 28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_2_5G\t\t(0x7 << 28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_MASK\t\t(0x7 << 28)\n+#define IXGBE_KRM_PMD_FLX_MASK_ST20_FW_AN_RESTART\tBIT(31)\n+\n #define IXGBE_KRM_PORT_CAR_GEN_CTRL_NELB_32B\t\tBIT(9)\n #define IXGBE_KRM_PORT_CAR_GEN_CTRL_NELB_KRPCS\t\tBIT(11)\n \ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\nindex 3796482..905ccc7 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c\n@@ -1204,6 +1204,53 @@ static s32 ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw)\n \treturn status;\n }\n \n+/**\n+ * ixgbe_restart_an_internal_phy_x550em - restart autonegotiation for the\n+ * internal PHY\n+ * @hw: pointer to hardware structure\n+ **/\n+static s32 ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw)\n+{\n+\ts32 status;\n+\tu32 link_ctrl;\n+\n+\t/* Restart auto-negotiation. */\n+\tstatus = hw->mac.ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, &link_ctrl);\n+\n+\tif (status) {\n+\t\thw_dbg(hw, \"Auto-negotiation did not complete\\n\");\n+\t\treturn status;\n+\t}\n+\n+\tlink_ctrl |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;\n+\tstatus = hw->mac.ops.write_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, link_ctrl);\n+\n+\tif (hw->mac.type == ixgbe_mac_x550em_a) {\n+\t\tu32 flx_mask_st20;\n+\n+\t\t/* Indicate to FW that AN restart has been asserted */\n+\t\tstatus = hw->mac.ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, &flx_mask_st20);\n+\n+\t\tif (status) {\n+\t\t\thw_dbg(hw, \"Auto-negotiation did not complete\\n\");\n+\t\t\treturn status;\n+\t\t}\n+\n+\t\tflx_mask_st20 |= IXGBE_KRM_PMD_FLX_MASK_ST20_FW_AN_RESTART;\n+\t\tstatus = hw->mac.ops.write_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, flx_mask_st20);\n+\t}\n+\n+\treturn status;\n+}\n+\n /** ixgbe_setup_ixfi_x550em - Configure the KR PHY for iXFI mode.\n * @hw: pointer to hardware structure\n * @speed: the link speed to force\n@@ -1253,16 +1300,7 @@ static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)\n \t}\n \n \t/* Toggle port SW reset by AN reset. */\n-\tstatus = ixgbe_read_iosf_sb_reg_x550(hw,\n-\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n-\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, ®_val);\n-\tif (status)\n-\t\treturn status;\n-\n-\treg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;\n-\tstatus = ixgbe_write_iosf_sb_reg_x550(hw,\n-\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n-\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);\n+\tstatus = ixgbe_restart_an_internal_phy_x550em(hw);\n \n \treturn status;\n }\n@@ -1398,6 +1436,55 @@ i2c_err:\n }\n \n /**\n+ * ixgbe_setup_sfi_x550a - Configure the internal PHY for native SFI mode\n+ * @hw: pointer to hardware structure\n+ * @speed: the link speed to force\n+ *\n+ * Configures the integrated PHY for native SFI mode. Used to connect the\n+ * internal PHY directly to an SFP cage, without autonegotiation.\n+ **/\n+static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)\n+{\n+\tstruct ixgbe_mac_info *mac = &hw->mac;\n+\ts32 status;\n+\tu32 reg_val;\n+\n+\t/* Disable all AN and force speed to 10G Serial. */\n+\tstatus = mac->ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, ®_val);\n+\tif (status)\n+\t\treturn status;\n+\n+\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_AN_EN;\n+\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_AN37_EN;\n+\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_SGMII_EN;\n+\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_MASK;\n+\n+\t/* Select forced link speed for internal PHY. */\n+\tswitch (*speed) {\n+\tcase IXGBE_LINK_SPEED_10GB_FULL:\n+\t\treg_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_10G;\n+\t\tbreak;\n+\tcase IXGBE_LINK_SPEED_1GB_FULL:\n+\t\treg_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_1G;\n+\t\tbreak;\n+\tdefault:\n+\t\t/* Other link speeds are not supported by internal PHY. */\n+\t\treturn IXGBE_ERR_LINK_SETUP;\n+\t}\n+\n+\tstatus = mac->ops.write_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);\n+\n+\t/* Toggle port SW reset by AN reset. */\n+\tstatus = ixgbe_restart_an_internal_phy_x550em(hw);\n+\n+\treturn status;\n+}\n+\n+/**\n * ixgbe_setup_mac_link_sfp_n - Setup internal PHY for native SFP\n * @hw: pointer to hardware structure\n *\n@@ -1409,45 +1496,39 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed,\n {\n \tbool setup_linear = false;\n \tu32 reg_phy_int;\n-\ts32 rc;\n+\ts32 ret_val;\n \n \t/* Check if SFP module is supported and linear */\n-\trc = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);\n+\tret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);\n \n \t/* If no SFP module present, then return success. Return success since\n \t * SFP not present error is not excepted in the setup MAC link flow.\n \t */\n-\tif (rc == IXGBE_ERR_SFP_NOT_PRESENT)\n+\tif (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)\n \t\treturn 0;\n \n-\tif (!rc)\n-\t\treturn rc;\n+\tif (!ret_val)\n+\t\treturn ret_val;\n \n-\t/* Configure internal PHY for native SFI */\n-\trc = hw->mac.ops.read_iosf_sb_reg(hw,\n-\t\t\t\t\t IXGBE_KRM_AN_CNTL_8(hw->bus.lan_id),\n-\t\t\t\t\t IXGBE_SB_IOSF_TARGET_KR_PHY,\n-\t\t\t\t\t ®_phy_int);\n-\tif (rc)\n-\t\treturn rc;\n+\t/* Configure internal PHY for native SFI based on module type */\n+\tret_val = hw->mac.ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, ®_phy_int);\n+\tif (!ret_val)\n+\t\treturn ret_val;\n \n-\tif (setup_linear) {\n-\t\treg_phy_int &= ~IXGBE_KRM_AN_CNTL_8_LIMITING;\n-\t\treg_phy_int |= IXGBE_KRM_AN_CNTL_8_LINEAR;\n-\t} else {\n-\t\treg_phy_int |= IXGBE_KRM_AN_CNTL_8_LIMITING;\n-\t\treg_phy_int &= ~IXGBE_KRM_AN_CNTL_8_LINEAR;\n-\t}\n+\treg_phy_int &= IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_DA;\n+\tif (!setup_linear)\n+\t\treg_phy_int |= IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_SR;\n \n-\trc = hw->mac.ops.write_iosf_sb_reg(hw,\n-\t\t\t\t\t IXGBE_KRM_AN_CNTL_8(hw->bus.lan_id),\n-\t\t\t\t\t IXGBE_SB_IOSF_TARGET_KR_PHY,\n-\t\t\t\t\t reg_phy_int);\n-\tif (rc)\n-\t\treturn rc;\n+\tret_val = hw->mac.ops.write_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, reg_phy_int);\n+\tif (!ret_val)\n+\t\treturn ret_val;\n \n-\t/* Setup XFI/SFI internal link */\n-\treturn ixgbe_setup_ixfi_x550em(hw, &speed);\n+\t/* Setup SFI internal link. */\n+\treturn ixgbe_setup_sfi_x550a(hw, &speed);\n }\n \n /**\n@@ -1463,19 +1544,19 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,\n \tu32 reg_slice, slice_offset;\n \tbool setup_linear = false;\n \tu16 reg_phy_ext;\n-\ts32 rc;\n+\ts32 ret_val;\n \n \t/* Check if SFP module is supported and linear */\n-\trc = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);\n+\tret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);\n \n \t/* If no SFP module present, then return success. Return success since\n \t * SFP not present error is not excepted in the setup MAC link flow.\n \t */\n-\tif (rc == IXGBE_ERR_SFP_NOT_PRESENT)\n+\tif (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)\n \t\treturn 0;\n \n-\tif (!rc)\n-\t\treturn rc;\n+\tif (!ret_val)\n+\t\treturn ret_val;\n \n \t/* Configure internal PHY for KR/KX. */\n \tixgbe_setup_kr_speed_x550em(hw, speed);\n@@ -1484,10 +1565,10 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,\n \t\treturn IXGBE_ERR_PHY_ADDR_INVALID;\n \n \t/* Get external PHY device id */\n-\trc = hw->phy.ops.read_reg(hw, IXGBE_CS4227_GLOBAL_ID_MSB,\n+\tret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_GLOBAL_ID_MSB,\n \t\t\t\t IXGBE_MDIO_ZERO_DEV_TYPE, ®_phy_ext);\n-\tif (rc)\n-\t\treturn rc;\n+\tif (ret_val)\n+\t\treturn ret_val;\n \n \t/* When configuring quad port CS4223, the MAC instance is part\n \t * of the slice offset.\n@@ -1600,7 +1681,7 @@ ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed,\n \t\t __always_unused bool autoneg_wait_to_complete)\n {\n \tstruct ixgbe_mac_info *mac = &hw->mac;\n-\tu32 lval, sval;\n+\tu32 lval, sval, flx_val;\n \ts32 rc;\n \n \trc = mac->ops.read_iosf_sb_reg(hw,\n@@ -1634,11 +1715,31 @@ ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed,\n \tif (rc)\n \t\treturn rc;\n \n-\tlval |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;\n+\trc = mac->ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, &flx_val);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\trc = mac->ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, &flx_val);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\tflx_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_MASK;\n+\tflx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_1G;\n+\tflx_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_AN_EN;\n+\tflx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SGMII_EN;\n+\tflx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_AN37_EN;\n+\n \trc = mac->ops.write_iosf_sb_reg(hw,\n-\t\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n-\t\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, lval);\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, flx_val);\n+\tif (rc)\n+\t\treturn rc;\n \n+\trc = ixgbe_restart_an_internal_phy_x550em(hw);\n \treturn rc;\n }\n \n@@ -1661,6 +1762,10 @@ static void ixgbe_init_mac_link_ops_X550em_a(struct ixgbe_hw *hw)\n \tdefault:\n \t\tbreak;\n \t}\n+\n+\t/* Additional modification for X550em_a devices */\n+\tif (hw->mac.type == ixgbe_mac_x550em_a)\n+\t\tixgbe_init_mac_link_ops_X550em_a(hw);\n }\n \n /** ixgbe_init_mac_link_ops_X550em - init mac link function pointers\n@@ -1995,13 +2100,31 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,\n \tif (speed & IXGBE_LINK_SPEED_1GB_FULL)\n \t\treg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KX;\n \n-\t/* Restart auto-negotiation. */\n-\treg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;\n \tstatus = hw->mac.ops.write_iosf_sb_reg(hw,\n \t\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n \t\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);\n \n-\treturn status;\n+\tif (hw->mac.type == ixgbe_mac_x550em_a) {\n+\t\t/* Set lane mode to KR auto negotiation */\n+\t\tstatus = hw->mac.ops.read_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, ®_val);\n+\n+\t\tif (status)\n+\t\t\treturn status;\n+\n+\t\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_MASK;\n+\t\treg_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_AN;\n+\t\treg_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_AN_EN;\n+\t\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_AN37_EN;\n+\t\treg_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_SGMII_EN;\n+\n+\t\tstatus = hw->mac.ops.write_iosf_sb_reg(hw,\n+\t\t\t\tIXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),\n+\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, reg_val);\n+\t}\n+\n+\treturn ixgbe_restart_an_internal_phy_x550em(hw);\n }\n \n /** ixgbe_setup_kx4_x550em - Configure the KX4 PHY.\n@@ -2869,7 +2992,6 @@ static void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw,\n static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)\n {\n \ts32 status = 0;\n-\tu32 link_ctrl = 0;\n \tu32 an_cntl = 0;\n \n \t/* Validate the requested mode */\n@@ -2940,18 +3062,7 @@ static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)\n \t\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, an_cntl);\n \n \t/* Restart auto-negotiation. */\n-\tstatus = hw->mac.ops.read_iosf_sb_reg(hw,\n-\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n-\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, &link_ctrl);\n-\tif (status) {\n-\t\thw_dbg(hw, \"Auto-Negotiation did not complete\\n\");\n-\t\treturn status;\n-\t}\n-\n-\tlink_ctrl |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART;\n-\tstatus = hw->mac.ops.write_iosf_sb_reg(hw,\n-\t\t\t\tIXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),\n-\t\t\t\tIXGBE_SB_IOSF_TARGET_KR_PHY, link_ctrl);\n+\tstatus = ixgbe_restart_an_internal_phy_x550em(hw);\n \n \treturn status;\n }\n", "prefixes": [] }