提交 e5461112 编写于 作者: A Akeem G. Abodunrin 提交者: Jeff Kirsher

igb: Support to enable EEE on all eee_supported devices

Current implementation enables EEE on only i350 device. This patch enables
EEE on all eee_supported devices. Also, configured LPI clock to keep
running before EEE is enabled on i210 and i211 devices.
Signed-off-by: NAkeem G. Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: NJeff Pieper  <jeffrey.e.pieper@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 ae1c07a6
...@@ -2223,11 +2223,10 @@ static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw) ...@@ -2223,11 +2223,10 @@ static s32 igb_update_nvm_checksum_i350(struct e1000_hw *hw)
s32 igb_set_eee_i350(struct e1000_hw *hw) s32 igb_set_eee_i350(struct e1000_hw *hw)
{ {
s32 ret_val = 0; s32 ret_val = 0;
u32 ipcnfg, eeer, ctrl_ext; u32 ipcnfg, eeer;
ctrl_ext = rd32(E1000_CTRL_EXT); if ((hw->mac.type < e1000_i350) ||
if ((hw->mac.type != e1000_i350) || (hw->phy.media_type != e1000_media_type_copper))
(ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK))
goto out; goto out;
ipcnfg = rd32(E1000_IPCNFG); ipcnfg = rd32(E1000_IPCNFG);
eeer = rd32(E1000_EEER); eeer = rd32(E1000_EEER);
...@@ -2240,6 +2239,14 @@ s32 igb_set_eee_i350(struct e1000_hw *hw) ...@@ -2240,6 +2239,14 @@ s32 igb_set_eee_i350(struct e1000_hw *hw)
E1000_EEER_RX_LPI_EN | E1000_EEER_RX_LPI_EN |
E1000_EEER_LPI_FC); E1000_EEER_LPI_FC);
/* keep the LPI clock running before EEE is enabled */
if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
u32 eee_su;
eee_su = rd32(E1000_EEE_SU);
eee_su &= ~E1000_EEE_SU_LPI_CLK_STP;
wr32(E1000_EEE_SU, eee_su);
}
} else { } else {
ipcnfg &= ~(E1000_IPCNFG_EEE_1G_AN | ipcnfg &= ~(E1000_IPCNFG_EEE_1G_AN |
E1000_IPCNFG_EEE_100M_AN); E1000_IPCNFG_EEE_100M_AN);
...@@ -2249,6 +2256,8 @@ s32 igb_set_eee_i350(struct e1000_hw *hw) ...@@ -2249,6 +2256,8 @@ s32 igb_set_eee_i350(struct e1000_hw *hw)
} }
wr32(E1000_IPCNFG, ipcnfg); wr32(E1000_IPCNFG, ipcnfg);
wr32(E1000_EEER, eeer); wr32(E1000_EEER, eeer);
rd32(E1000_IPCNFG);
rd32(E1000_EEER);
out: out:
return ret_val; return ret_val;
......
...@@ -857,8 +857,9 @@ ...@@ -857,8 +857,9 @@
#define E1000_IPCNFG_EEE_100M_AN 0x00000004 /* EEE Enable 100M AN */ #define E1000_IPCNFG_EEE_100M_AN 0x00000004 /* EEE Enable 100M AN */
#define E1000_EEER_TX_LPI_EN 0x00010000 /* EEE Tx LPI Enable */ #define E1000_EEER_TX_LPI_EN 0x00010000 /* EEE Tx LPI Enable */
#define E1000_EEER_RX_LPI_EN 0x00020000 /* EEE Rx LPI Enable */ #define E1000_EEER_RX_LPI_EN 0x00020000 /* EEE Rx LPI Enable */
#define E1000_EEER_FRC_AN 0x10000000 /* Enable EEE in loopback */ #define E1000_EEER_FRC_AN 0x10000000 /* Enable EEE in loopback */
#define E1000_EEER_LPI_FC 0x00040000 /* EEE Enable on FC */ #define E1000_EEER_LPI_FC 0x00040000 /* EEE Enable on FC */
#define E1000_EEE_SU_LPI_CLK_STP 0X00800000 /* EEE LPI Clock Stop */
/* SerDes Control */ /* SerDes Control */
#define E1000_GEN_CTL_READY 0x80000000 #define E1000_GEN_CTL_READY 0x80000000
......
...@@ -349,6 +349,7 @@ ...@@ -349,6 +349,7 @@
/* Energy Efficient Ethernet "EEE" register */ /* Energy Efficient Ethernet "EEE" register */
#define E1000_IPCNFG 0x0E38 /* Internal PHY Configuration */ #define E1000_IPCNFG 0x0E38 /* Internal PHY Configuration */
#define E1000_EEER 0x0E30 /* Energy Efficient Ethernet */ #define E1000_EEER 0x0E30 /* Energy Efficient Ethernet */
#define E1000_EEE_SU 0X0E34 /* EEE Setup */
/* Thermal Sensor Register */ /* Thermal Sensor Register */
#define E1000_THSTAT 0x08110 /* Thermal Sensor Status */ #define E1000_THSTAT 0x08110 /* Thermal Sensor Status */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册