diff options
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 67 |
1 files changed, 48 insertions, 19 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index a267c5235fc0..136fc031e4ad 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -563,11 +563,13 @@ e1000_reset_hw(struct e1000_hw *hw) | |||
563 | msec_delay(20); | 563 | msec_delay(20); |
564 | break; | 564 | break; |
565 | case e1000_82573: | 565 | case e1000_82573: |
566 | udelay(10); | 566 | if (e1000_is_onboard_nvm_eeprom(hw) == FALSE) { |
567 | ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); | 567 | udelay(10); |
568 | ctrl_ext |= E1000_CTRL_EXT_EE_RST; | 568 | ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); |
569 | E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); | 569 | ctrl_ext |= E1000_CTRL_EXT_EE_RST; |
570 | E1000_WRITE_FLUSH(hw); | 570 | E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); |
571 | E1000_WRITE_FLUSH(hw); | ||
572 | } | ||
571 | /* fall through */ | 573 | /* fall through */ |
572 | case e1000_82571: | 574 | case e1000_82571: |
573 | case e1000_82572: | 575 | case e1000_82572: |
@@ -844,19 +846,27 @@ e1000_setup_link(struct e1000_hw *hw) | |||
844 | * control setting, then the variable hw->fc will | 846 | * control setting, then the variable hw->fc will |
845 | * be initialized based on a value in the EEPROM. | 847 | * be initialized based on a value in the EEPROM. |
846 | */ | 848 | */ |
847 | if(e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, 1, &eeprom_data)) { | 849 | if (hw->fc == e1000_fc_default) { |
848 | DEBUGOUT("EEPROM Read Error\n"); | 850 | switch (hw->mac_type) { |
849 | return -E1000_ERR_EEPROM; | 851 | case e1000_82573: |
850 | } | ||
851 | |||
852 | if(hw->fc == e1000_fc_default) { | ||
853 | if((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) | ||
854 | hw->fc = e1000_fc_none; | ||
855 | else if((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == | ||
856 | EEPROM_WORD0F_ASM_DIR) | ||
857 | hw->fc = e1000_fc_tx_pause; | ||
858 | else | ||
859 | hw->fc = e1000_fc_full; | 852 | hw->fc = e1000_fc_full; |
853 | break; | ||
854 | default: | ||
855 | ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, | ||
856 | 1, &eeprom_data); | ||
857 | if (ret_val) { | ||
858 | DEBUGOUT("EEPROM Read Error\n"); | ||
859 | return -E1000_ERR_EEPROM; | ||
860 | } | ||
861 | if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == 0) | ||
862 | hw->fc = e1000_fc_none; | ||
863 | else if ((eeprom_data & EEPROM_WORD0F_PAUSE_MASK) == | ||
864 | EEPROM_WORD0F_ASM_DIR) | ||
865 | hw->fc = e1000_fc_tx_pause; | ||
866 | else | ||
867 | hw->fc = e1000_fc_full; | ||
868 | break; | ||
869 | } | ||
860 | } | 870 | } |
861 | 871 | ||
862 | /* We want to save off the original Flow Control configuration just | 872 | /* We want to save off the original Flow Control configuration just |
@@ -2962,13 +2972,22 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
2962 | if(hw->mac_type > e1000_82543) { | 2972 | if(hw->mac_type > e1000_82543) { |
2963 | /* Read the device control register and assert the E1000_CTRL_PHY_RST | 2973 | /* Read the device control register and assert the E1000_CTRL_PHY_RST |
2964 | * bit. Then, take it out of reset. | 2974 | * bit. Then, take it out of reset. |
2975 | * For pre-e1000_82571 hardware, we delay for 10ms between the assert | ||
2976 | * and deassert. For e1000_82571 hardware and later, we instead delay | ||
2977 | * for 10ms after the deassertion. | ||
2965 | */ | 2978 | */ |
2966 | ctrl = E1000_READ_REG(hw, CTRL); | 2979 | ctrl = E1000_READ_REG(hw, CTRL); |
2967 | E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST); | 2980 | E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST); |
2968 | E1000_WRITE_FLUSH(hw); | 2981 | E1000_WRITE_FLUSH(hw); |
2969 | msec_delay(10); | 2982 | |
2983 | if (hw->mac_type < e1000_82571) | ||
2984 | msec_delay(10); | ||
2985 | |||
2970 | E1000_WRITE_REG(hw, CTRL, ctrl); | 2986 | E1000_WRITE_REG(hw, CTRL, ctrl); |
2971 | E1000_WRITE_FLUSH(hw); | 2987 | E1000_WRITE_FLUSH(hw); |
2988 | |||
2989 | if (hw->mac_type >= e1000_82571) | ||
2990 | msec_delay(10); | ||
2972 | } else { | 2991 | } else { |
2973 | /* Read the Extended Device Control Register, assert the PHY_RESET_DIR | 2992 | /* Read the Extended Device Control Register, assert the PHY_RESET_DIR |
2974 | * bit to put the PHY into reset. Then, take it out of reset. | 2993 | * bit to put the PHY into reset. Then, take it out of reset. |
@@ -5278,11 +5297,15 @@ e1000_get_bus_info(struct e1000_hw *hw) | |||
5278 | hw->bus_speed = e1000_bus_speed_unknown; | 5297 | hw->bus_speed = e1000_bus_speed_unknown; |
5279 | hw->bus_width = e1000_bus_width_unknown; | 5298 | hw->bus_width = e1000_bus_width_unknown; |
5280 | break; | 5299 | break; |
5281 | case e1000_82571: | ||
5282 | case e1000_82572: | 5300 | case e1000_82572: |
5283 | case e1000_82573: | 5301 | case e1000_82573: |
5284 | hw->bus_type = e1000_bus_type_pci_express; | 5302 | hw->bus_type = e1000_bus_type_pci_express; |
5285 | hw->bus_speed = e1000_bus_speed_2500; | 5303 | hw->bus_speed = e1000_bus_speed_2500; |
5304 | hw->bus_width = e1000_bus_width_pciex_1; | ||
5305 | break; | ||
5306 | case e1000_82571: | ||
5307 | hw->bus_type = e1000_bus_type_pci_express; | ||
5308 | hw->bus_speed = e1000_bus_speed_2500; | ||
5286 | hw->bus_width = e1000_bus_width_pciex_4; | 5309 | hw->bus_width = e1000_bus_width_pciex_4; |
5287 | break; | 5310 | break; |
5288 | default: | 5311 | default: |
@@ -6650,6 +6673,12 @@ e1000_get_auto_rd_done(struct e1000_hw *hw) | |||
6650 | break; | 6673 | break; |
6651 | } | 6674 | } |
6652 | 6675 | ||
6676 | /* PHY configuration from NVM just starts after EECD_AUTO_RD sets to high. | ||
6677 | * Need to wait for PHY configuration completion before accessing NVM | ||
6678 | * and PHY. */ | ||
6679 | if (hw->mac_type == e1000_82573) | ||
6680 | msec_delay(25); | ||
6681 | |||
6653 | return E1000_SUCCESS; | 6682 | return E1000_SUCCESS; |
6654 | } | 6683 | } |
6655 | 6684 | ||