e1000e: config PHY via software after resets
Subsystems (2)
PATCH 1/2 e1000e: config PHY via software after resets
From: Bruce Allan <[email protected]>
On PCH-based (82577/82578) and some ICH8-based parts (82566) there is an issue with the hardware automatically configuring the PHY with contents from the EEPROM after the PHY is reset, so do the configuration by the driver instead. This was already similarly done for some 82566 parts in e1000_phy_hw_reset_ich8lan() but needs to be done after other resets, so move the PHY configuration code to its own function and call after all PHY resets.
---
drivers/net/e1000e/defines.h | 1 drivers/net/e1000e/ich8lan.c | 295 +++++++++++++++++++++++++++++++----------- 2 files changed, 218 insertions(+), 78 deletions(-)
drivers/net/e1000e/defines.h +1 -0
@@ -347,6 +347,7 @@/* Extended Configuration Control and Size */ #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020#define E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE 0x00000001 +#define E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE 0x00000008#define E1000_EXTCNF_CTRL_SWFLAG 0x00000020#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK 0x00FF0000#define E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_SHIFT 16
drivers/net/e1000e/ich8lan.c +217 -78
342 lines not on this page · raw message
PATCH 2/2 e1000e: rework disable K1 at 1000Mbps for 82577/82578
From: Bruce Allan <[email protected]>
This patch reworks a previous workaround (commit 7d3cabbcc) for an issue in hardware where noise on the interconnect between the MAC and PHY could be generated by a lower power mode (K1) at 1000Mbps resulting in bad packets. Disable K1 while at 1000 Mbps but keep it enabled for 10/100Mbps and when the cable is disconnected. The original version of this workaround was found to be incomplete.
---
drivers/net/e1000e/defines.h | 1 drivers/net/e1000e/e1000.h | 14 +++ drivers/net/e1000e/hw.h | 1 drivers/net/e1000e/ich8lan.c | 187 ++++++++++++++++++++++++++++++++++++++---- drivers/net/e1000e/phy.c | 15 +-- 5 files changed, 190 insertions(+), 28 deletions(-)
drivers/net/e1000e/defines.h +1 -0
@@ -76,6 +76,7 @@/* Extended Device Control */ #define E1000_CTRL_EXT_SDP7_DATA 0x00000080/* Value of SW Definable Pin 7 */ #define E1000_CTRL_EXT_EE_RST 0x00002000/* Reinitialize from EEPROM */ +#define E1000_CTRL_EXT_SPD_BYPS 0x00008000/* Speed Select Bypass */ #define E1000_CTRL_EXT_RO_DIS 0x00020000/* Relaxed Ordering disable */ #define E1000_CTRL_EXT_DMA_DYN_CLK_EN 0x00080000/* DMA Dynamic Clock Gating */ #define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
drivers/net/e1000e/e1000.h +14 -0
@@ -141,6 +141,20 @@ struct e1000_info;#define HV_TNCRS_UPPER PHY_REG(778, 29)/* Transmit with no CRS */ #define HV_TNCRS_LOWER PHY_REG(778, 30) +/* BM PHY Copper Specific Status */ +#define BM_CS_STATUS 17 +#define BM_CS_STATUS_LINK_UP 0x0400 +#define BM_CS_STATUS_RESOLVED 0x0800 +#define BM_CS_STATUS_SPEED_MASK 0xC000 +#define BM_CS_STATUS_SPEED_1000 0x8000 + +/* 82577 Mobile Phy Status Register */ +#define HV_M_STATUS 26 +#define HV_M_STATUS_AUTONEG_COMPLETE 0x1000 +#define HV_M_STATUS_SPEED_MASK 0x0300 +#define HV_M_STATUS_SPEED_1000 0x0200 +#define HV_M_STATUS_LINK_UP 0x0040 +enum e1000_boards { board_82571, board_82572,
drivers/net/e1000e/hw.h +1 -0
@@ -903,6 +903,7 @@ struct e1000_shadow_ram {struct e1000_dev_spec_ich8lan {bool kmrn_lock_loss_workaround_enabled;struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS ]; +bool nvm_k1_enabled; };struct e1000_hw {
drivers/net/e1000e/ich8lan.c +170 -17
244 lines not on this page · raw message
drivers/net/e1000e/phy.c +4 -11
@@ -95,13 +95,6 @@ static const u16 e1000_igp_2_cable_length_table[] =/* BM PHY Copper Specific Control 1 */ #define BM_CS_CTRL1 16 -/* BM PHY Copper Specific Status */ -#define BM_CS_STATUS 17 -#define BM_CS_STATUS_LINK_UP 0x0400 -#define BM_CS_STATUS_RESOLVED 0x0800 -#define BM_CS_STATUS_SPEED_MASK 0xC000 -#define BM_CS_STATUS_SPEED_1000 0x8000 -#define HV_MUX_DATA_CTRL PHY_REG(776, 16)#define HV_MUX_DATA_CTRL_GEN_TO_MAC 0x0400#define HV_MUX_DATA_CTRL_FORCE_SPEED 0x0004
@@ -563,7 +556,7 @@ s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data) }/** -* e1000_read_kmrn_reg_locked - Read kumeran register +* e1000e_read_kmrn_reg_locked - Read kumeran register * @hw: pointer to the HW structure * @offset: register offset to be read * @data: pointer to the read data
@@ -572,7 +565,7 @@ s32 e1000e_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)* information retrieved is stored in data. * Assumes semaphore already acquired. **/ -s32 e1000_read_kmrn_reg_locked (struct e1000_hw *hw,u32 offset,u16 *data) +s32 e1000e_read_kmrn_reg_locked (struct e1000_hw *hw,u32 offset,u16 *data) {return __e1000_read_kmrn_reg (hw, offset, data, true); }
@@ -631,7 +624,7 @@ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data) }/** -* e1000_write_kmrn_reg_locked - Write kumeran register +* e1000e_write_kmrn_reg_locked - Write kumeran register * @hw: pointer to the HW structure * @offset: register offset to write to * @data: data to write at register offset
@@ -639,7 +632,7 @@ s32 e1000e_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)* Write the data to PHY register at the offset using the kumeran interface. * Assumes semaphore already acquired. **/ -s32 e1000_write_kmrn_reg_locked (struct e1000_hw *hw,u32 offset,u16 data) +s32 e1000e_write_kmrn_reg_locked (struct e1000_hw *hw,u32 offset,u16 data) {return __e1000_write_kmrn_reg (hw, offset, data, true); }
Re: [net-2.6 PATCH 2/2] e1000e: rework disable K1 at 1000Mbps for 82577/82578
From: Jeff Kirsher <[email protected]>
Date: Thu, 29 Oct 2009 16:46:05 -0700
Quoted 11 lines
From: Bruce Allan <[email protected]>
This patch reworks a previous workaround (commit
7d3cabbcc) for an issue in hardware where noise on the interconnect between the MAC and PHY could be generated by a lower power mode (K1) at 1000Mbps resulting in bad packets. Disable K1 while at 1000 Mbps but keep it enabled for 10/100Mbps and when the cable is disconnected. The original version of this workaround was found to be incomplete.Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
From: Jeff Kirsher <[email protected]>
Date: Thu, 29 Oct 2009 16:45:45 -0700
Quoted 10 lines
From: Bruce Allan <[email protected]>
On PCH-based (82577/82578) and some ICH8-based parts (82566) there is an issue with the hardware automatically configuring the PHY with contents from the EEPROM after the PHY is reset, so do the configuration by the driver instead. This was already similarly done for some 82566 parts in
e1000_phy_hw_reset_ich8lan()but needs to be done after other resets, so move the PHY configuration code to its own function and call after all PHY resets.
Quoted 2 lines
Signed-off-by Bruce Allan <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.