aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorCarolyn Wyborny <carolyn.wyborny@intel.com>2011-05-24 02:52:51 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-07-11 21:43:00 -0400
commit2c670b5bd794ef93c81bf8797b7d6393c8453fc6 (patch)
tree909c57569fa2bdc049c049760dda8e713d603250 /drivers
parent4297f99b846942c6068f4ec80585c05ac94e612e (diff)
igb: Add support of SerDes Forced mode for certain hardware
This patch changes the serdes link code to support a forced mode for some hardware, based on bit set in EEPROM. Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/igb/e1000_82575.c19
-rw-r--r--drivers/net/igb/e1000_82575.h2
-rw-r--r--drivers/net/igb/e1000_defines.h5
3 files changed, 22 insertions, 4 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 7b7e1571fa5e..c0857bdfb03a 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -1156,10 +1156,13 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
1156{ 1156{
1157 u32 ctrl_ext, ctrl_reg, reg; 1157 u32 ctrl_ext, ctrl_reg, reg;
1158 bool pcs_autoneg; 1158 bool pcs_autoneg;
1159 s32 ret_val = E1000_SUCCESS;
1160 u16 data;
1159 1161
1160 if ((hw->phy.media_type != e1000_media_type_internal_serdes) && 1162 if ((hw->phy.media_type != e1000_media_type_internal_serdes) &&
1161 !igb_sgmii_active_82575(hw)) 1163 !igb_sgmii_active_82575(hw))
1162 return 0; 1164 return ret_val;
1165
1163 1166
1164 /* 1167 /*
1165 * On the 82575, SerDes loopback mode persists until it is 1168 * On the 82575, SerDes loopback mode persists until it is
@@ -1203,6 +1206,18 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
1203 /* disable PCS autoneg and support parallel detect only */ 1206 /* disable PCS autoneg and support parallel detect only */
1204 pcs_autoneg = false; 1207 pcs_autoneg = false;
1205 default: 1208 default:
1209 if (hw->mac.type == e1000_82575 ||
1210 hw->mac.type == e1000_82576) {
1211 ret_val = hw->nvm.ops.read(hw, NVM_COMPAT, 1, &data);
1212 if (ret_val) {
1213 printk(KERN_DEBUG "NVM Read Error\n\n");
1214 return ret_val;
1215 }
1216
1217 if (data & E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT)
1218 pcs_autoneg = false;
1219 }
1220
1206 /* 1221 /*
1207 * non-SGMII modes only supports a speed of 1000/Full for the 1222 * non-SGMII modes only supports a speed of 1000/Full for the
1208 * link so it is best to just force the MAC and let the pcs 1223 * link so it is best to just force the MAC and let the pcs
@@ -1250,7 +1265,7 @@ static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw)
1250 if (!igb_sgmii_active_82575(hw)) 1265 if (!igb_sgmii_active_82575(hw))
1251 igb_force_mac_fc(hw); 1266 igb_force_mac_fc(hw);
1252 1267
1253 return 0; 1268 return ret_val;
1254} 1269}
1255 1270
1256/** 1271/**
diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
index fd28d62470e1..786e110011a3 100644
--- a/drivers/net/igb/e1000_82575.h
+++ b/drivers/net/igb/e1000_82575.h
@@ -243,6 +243,8 @@ struct e1000_adv_tx_context_desc {
243#define E1000_DTXCTL_MDP_EN 0x0020 243#define E1000_DTXCTL_MDP_EN 0x0020
244#define E1000_DTXCTL_SPOOF_INT 0x0040 244#define E1000_DTXCTL_SPOOF_INT 0x0040
245 245
246#define E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT (1 << 14)
247
246#define ALL_QUEUES 0xFFFF 248#define ALL_QUEUES 0xFFFF
247 249
248/* RX packet buffer size defines */ 250/* RX packet buffer size defines */
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index 446eb5cb25e1..2cd4082c86ca 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -437,6 +437,7 @@
437#define E1000_RAH_POOL_1 0x00040000 437#define E1000_RAH_POOL_1 0x00040000
438 438
439/* Error Codes */ 439/* Error Codes */
440#define E1000_SUCCESS 0
440#define E1000_ERR_NVM 1 441#define E1000_ERR_NVM 1
441#define E1000_ERR_PHY 2 442#define E1000_ERR_PHY 2
442#define E1000_ERR_CONFIG 3 443#define E1000_ERR_CONFIG 3
@@ -587,8 +588,8 @@
587#define E1000_NVM_POLL_READ 0 /* Flag for polling for read complete */ 588#define E1000_NVM_POLL_READ 0 /* Flag for polling for read complete */
588 589
589/* NVM Word Offsets */ 590/* NVM Word Offsets */
590#define NVM_ID_LED_SETTINGS 0x0004 591#define NVM_COMPAT 0x0003
591/* For SERDES output amplitude adjustment. */ 592#define NVM_ID_LED_SETTINGS 0x0004 /* SERDES output amplitude */
592#define NVM_INIT_CONTROL2_REG 0x000F 593#define NVM_INIT_CONTROL2_REG 0x000F
593#define NVM_INIT_CONTROL3_PORT_B 0x0014 594#define NVM_INIT_CONTROL3_PORT_B 0x0014
594#define NVM_INIT_CONTROL3_PORT_A 0x0024 595#define NVM_INIT_CONTROL3_PORT_A 0x0024