From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 744C8C75E for ; Wed, 24 Jun 2015 05:27:27 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 23 Jun 2015 20:27:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,669,1427785200"; d="scan'208";a="593660543" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 23 Jun 2015 20:27:26 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t5O3RNHC020717; Wed, 24 Jun 2015 11:27:23 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t5O3RKfq012209; Wed, 24 Jun 2015 11:27:22 +0800 Received: (from wenzhuol@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5O3RKrP012205; Wed, 24 Jun 2015 11:27:20 +0800 From: Wenzhuo Lu To: dev@dpdk.org Date: Wed, 24 Jun 2015 11:26:12 +0800 Message-Id: <1435116386-12010-24-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com> References: <1435116386-12010-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [PATCH 23/37] ixgbe/base: update EEE/FEC support for device X550EM_X_KR X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2015 03:27:28 -0000 EEE(Energy Efficient Ethernet) is not supported on the initial revision of IXGBE_DEV_ID_X550EM_X_KR. We determine the revision by reading a fuse register. Also, the requirements for FEC(Forward Error Correction) have changed slightly. Now, we don't change the "request" bit at all. When EEE is enabled, we advertise that we are capable. When EEE is disabled, we do not advertise that we are capable. This change makes us consistent with the power-on defaults that are in the NVM. Signed-off-by: Wenzhuo Lu --- drivers/net/ixgbe/base/ixgbe_type.h | 6 ++++-- drivers/net/ixgbe/base/ixgbe_x550.c | 16 ++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h index 6eb3421..d6ec699 100644 --- a/drivers/net/ixgbe/base/ixgbe_type.h +++ b/drivers/net/ixgbe/base/ixgbe_type.h @@ -3837,8 +3837,10 @@ struct ixgbe_hw { #define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF -#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) -#define IXGBE_FUSES0_300MHZ (1 << 5) + +#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) +#define IXGBE_FUSES0_300MHZ (1 << 5) +#define IXGBE_FUSES0_REV1 (1 << 6) #define IXGBE_KRM_PORT_CAR_GEN_CTRL(P) ((P == 0) ? (0x4010) : (0x8010)) #define IXGBE_KRM_LINK_CTRL_1(P) ((P == 0) ? (0x420C) : (0x820C)) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index c9b1465..7c7829c 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -669,6 +669,7 @@ s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee) u16 autoneg_eee_reg; u32 link_reg; s32 status; + u32 fuse; DEBUGFUNC("ixgbe_setup_eee_X550"); @@ -689,6 +690,11 @@ s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee) hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_EEE_ADVT, IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_eee_reg); } else if (hw->device_id == IXGBE_DEV_ID_X550EM_X_KR) { + /* Not supported on first revision. */ + fuse = IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)); + if (!(fuse & IXGBE_FUSES0_REV1)) + return IXGBE_SUCCESS; + status = ixgbe_read_iosf_sb_reg_x550(hw, IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), IXGBE_SB_IOSF_TARGET_KR_PHY, &link_reg); @@ -698,9 +704,8 @@ s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee) link_reg |= IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KR | IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KX; - /* Must disable FEC when EEE is enabled. */ - link_reg &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ | - IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC); + /* Don't advertise FEC capability when EEE enabled. */ + link_reg &= ~IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC; status = ixgbe_write_iosf_sb_reg_x550(hw, IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), @@ -732,9 +737,8 @@ s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee) link_reg &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KR | IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KX); - /* Enable FEC when EEE is disabled. */ - link_reg |= (IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ | - IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC); + /* Advertise FEC capability when EEE is disabled. */ + link_reg |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC; status = ixgbe_write_iosf_sb_reg_x550(hw, IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), -- 1.9.3