diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-17 22:46:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-17 22:46:46 -0500 |
commit | d1138cf035ad5a8dc0796b213bd078a2fb92eb7c (patch) | |
tree | 72a4640fe87720ebfc118f2b3c7f140f5d19d6b7 /drivers/net/e1000/e1000_hw.c | |
parent | 15578eeb6cd4b74492f26e60624aa1a9a52ddd7b (diff) | |
parent | 77783a78ded96a56e3a1a0c03bbe87c56896fe6e (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 53 |
1 files changed, 42 insertions, 11 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 136fc031e4ad..2437d362ff63 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -318,6 +318,8 @@ e1000_set_mac_type(struct e1000_hw *hw) | |||
318 | case E1000_DEV_ID_82546GB_FIBER: | 318 | case E1000_DEV_ID_82546GB_FIBER: |
319 | case E1000_DEV_ID_82546GB_SERDES: | 319 | case E1000_DEV_ID_82546GB_SERDES: |
320 | case E1000_DEV_ID_82546GB_PCIE: | 320 | case E1000_DEV_ID_82546GB_PCIE: |
321 | case E1000_DEV_ID_82546GB_QUAD_COPPER: | ||
322 | case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: | ||
321 | hw->mac_type = e1000_82546_rev_3; | 323 | hw->mac_type = e1000_82546_rev_3; |
322 | break; | 324 | break; |
323 | case E1000_DEV_ID_82541EI: | 325 | case E1000_DEV_ID_82541EI: |
@@ -639,6 +641,7 @@ e1000_init_hw(struct e1000_hw *hw) | |||
639 | uint16_t cmd_mmrbc; | 641 | uint16_t cmd_mmrbc; |
640 | uint16_t stat_mmrbc; | 642 | uint16_t stat_mmrbc; |
641 | uint32_t mta_size; | 643 | uint32_t mta_size; |
644 | uint32_t ctrl_ext; | ||
642 | 645 | ||
643 | DEBUGFUNC("e1000_init_hw"); | 646 | DEBUGFUNC("e1000_init_hw"); |
644 | 647 | ||
@@ -735,7 +738,6 @@ e1000_init_hw(struct e1000_hw *hw) | |||
735 | break; | 738 | break; |
736 | case e1000_82571: | 739 | case e1000_82571: |
737 | case e1000_82572: | 740 | case e1000_82572: |
738 | ctrl |= (1 << 22); | ||
739 | case e1000_82573: | 741 | case e1000_82573: |
740 | ctrl |= E1000_TXDCTL_COUNT_DESC; | 742 | ctrl |= E1000_TXDCTL_COUNT_DESC; |
741 | break; | 743 | break; |
@@ -775,6 +777,15 @@ e1000_init_hw(struct e1000_hw *hw) | |||
775 | */ | 777 | */ |
776 | e1000_clear_hw_cntrs(hw); | 778 | e1000_clear_hw_cntrs(hw); |
777 | 779 | ||
780 | if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER || | ||
781 | hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) { | ||
782 | ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); | ||
783 | /* Relaxed ordering must be disabled to avoid a parity | ||
784 | * error crash in a PCI slot. */ | ||
785 | ctrl_ext |= E1000_CTRL_EXT_RO_DIS; | ||
786 | E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); | ||
787 | } | ||
788 | |||
778 | return ret_val; | 789 | return ret_val; |
779 | } | 790 | } |
780 | 791 | ||
@@ -838,6 +849,11 @@ e1000_setup_link(struct e1000_hw *hw) | |||
838 | 849 | ||
839 | DEBUGFUNC("e1000_setup_link"); | 850 | DEBUGFUNC("e1000_setup_link"); |
840 | 851 | ||
852 | /* In the case of the phy reset being blocked, we already have a link. | ||
853 | * We do not have to set it up again. */ | ||
854 | if (e1000_check_phy_reset_block(hw)) | ||
855 | return E1000_SUCCESS; | ||
856 | |||
841 | /* Read and store word 0x0F of the EEPROM. This word contains bits | 857 | /* Read and store word 0x0F of the EEPROM. This word contains bits |
842 | * that determine the hardware's default PAUSE (flow control) mode, | 858 | * that determine the hardware's default PAUSE (flow control) mode, |
843 | * a bit that determines whether the HW defaults to enabling or | 859 | * a bit that determines whether the HW defaults to enabling or |
@@ -1929,14 +1945,19 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
1929 | void | 1945 | void |
1930 | e1000_config_collision_dist(struct e1000_hw *hw) | 1946 | e1000_config_collision_dist(struct e1000_hw *hw) |
1931 | { | 1947 | { |
1932 | uint32_t tctl; | 1948 | uint32_t tctl, coll_dist; |
1933 | 1949 | ||
1934 | DEBUGFUNC("e1000_config_collision_dist"); | 1950 | DEBUGFUNC("e1000_config_collision_dist"); |
1935 | 1951 | ||
1952 | if (hw->mac_type < e1000_82543) | ||
1953 | coll_dist = E1000_COLLISION_DISTANCE_82542; | ||
1954 | else | ||
1955 | coll_dist = E1000_COLLISION_DISTANCE; | ||
1956 | |||
1936 | tctl = E1000_READ_REG(hw, TCTL); | 1957 | tctl = E1000_READ_REG(hw, TCTL); |
1937 | 1958 | ||
1938 | tctl &= ~E1000_TCTL_COLD; | 1959 | tctl &= ~E1000_TCTL_COLD; |
1939 | tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT; | 1960 | tctl |= coll_dist << E1000_COLD_SHIFT; |
1940 | 1961 | ||
1941 | E1000_WRITE_REG(hw, TCTL, tctl); | 1962 | E1000_WRITE_REG(hw, TCTL, tctl); |
1942 | E1000_WRITE_FLUSH(hw); | 1963 | E1000_WRITE_FLUSH(hw); |
@@ -2982,6 +3003,8 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
2982 | 3003 | ||
2983 | if (hw->mac_type < e1000_82571) | 3004 | if (hw->mac_type < e1000_82571) |
2984 | msec_delay(10); | 3005 | msec_delay(10); |
3006 | else | ||
3007 | udelay(100); | ||
2985 | 3008 | ||
2986 | E1000_WRITE_REG(hw, CTRL, ctrl); | 3009 | E1000_WRITE_REG(hw, CTRL, ctrl); |
2987 | E1000_WRITE_FLUSH(hw); | 3010 | E1000_WRITE_FLUSH(hw); |
@@ -3881,14 +3904,16 @@ e1000_read_eeprom(struct e1000_hw *hw, | |||
3881 | return -E1000_ERR_EEPROM; | 3904 | return -E1000_ERR_EEPROM; |
3882 | } | 3905 | } |
3883 | 3906 | ||
3884 | /* FLASH reads without acquiring the semaphore are safe in 82573-based | 3907 | /* FLASH reads without acquiring the semaphore are safe */ |
3885 | * controllers. | 3908 | if (e1000_is_onboard_nvm_eeprom(hw) == TRUE && |
3886 | */ | 3909 | hw->eeprom.use_eerd == FALSE) { |
3887 | if ((e1000_is_onboard_nvm_eeprom(hw) == TRUE) || | 3910 | switch (hw->mac_type) { |
3888 | (hw->mac_type != e1000_82573)) { | 3911 | default: |
3889 | /* Prepare the EEPROM for reading */ | 3912 | /* Prepare the EEPROM for reading */ |
3890 | if(e1000_acquire_eeprom(hw) != E1000_SUCCESS) | 3913 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) |
3891 | return -E1000_ERR_EEPROM; | 3914 | return -E1000_ERR_EEPROM; |
3915 | break; | ||
3916 | } | ||
3892 | } | 3917 | } |
3893 | 3918 | ||
3894 | if(eeprom->use_eerd == TRUE) { | 3919 | if(eeprom->use_eerd == TRUE) { |
@@ -6720,6 +6745,12 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw) | |||
6720 | break; | 6745 | break; |
6721 | } | 6746 | } |
6722 | 6747 | ||
6748 | /* PHY configuration from NVM just starts after EECD_AUTO_RD sets to high. | ||
6749 | * Need to wait for PHY configuration completion before accessing NVM | ||
6750 | * and PHY. */ | ||
6751 | if (hw->mac_type == e1000_82573) | ||
6752 | msec_delay(25); | ||
6753 | |||
6723 | return E1000_SUCCESS; | 6754 | return E1000_SUCCESS; |
6724 | } | 6755 | } |
6725 | 6756 | ||