diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2009-09-25 08:20:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-26 23:15:58 -0400 |
commit | 8f601b2d565fdf24e34d90c617cd4b777faad68f (patch) | |
tree | 80af51b1bbdf17cf8f1897f096e4e911407897be | |
parent | 120a5d0d588c9a4d47574fcfdab8454817c8586c (diff) |
e1000: drop unused functionality for eeprom write/read
eerd and eewr don't exist on pre PCIe devices
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 121 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.h | 2 |
2 files changed, 3 insertions, 120 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 6aba88304407..50114cd2df96 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -49,11 +49,6 @@ static s32 e1000_id_led_init(struct e1000_hw *hw); | |||
49 | static void e1000_init_rx_addrs(struct e1000_hw *hw); | 49 | static void e1000_init_rx_addrs(struct e1000_hw *hw); |
50 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, | 50 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, |
51 | struct e1000_phy_info *phy_info); | 51 | struct e1000_phy_info *phy_info); |
52 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, | ||
53 | u16 *data); | ||
54 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, | ||
55 | u16 *data); | ||
56 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd); | ||
57 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, | 52 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, |
58 | struct e1000_phy_info *phy_info); | 53 | struct e1000_phy_info *phy_info); |
59 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active); | 54 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active); |
@@ -3339,8 +3334,6 @@ s32 e1000_init_eeprom_params(struct e1000_hw *hw) | |||
3339 | eeprom->opcode_bits = 3; | 3334 | eeprom->opcode_bits = 3; |
3340 | eeprom->address_bits = 6; | 3335 | eeprom->address_bits = 6; |
3341 | eeprom->delay_usec = 50; | 3336 | eeprom->delay_usec = 50; |
3342 | eeprom->use_eerd = false; | ||
3343 | eeprom->use_eewr = false; | ||
3344 | break; | 3337 | break; |
3345 | case e1000_82540: | 3338 | case e1000_82540: |
3346 | case e1000_82545: | 3339 | case e1000_82545: |
@@ -3357,8 +3350,6 @@ s32 e1000_init_eeprom_params(struct e1000_hw *hw) | |||
3357 | eeprom->word_size = 64; | 3350 | eeprom->word_size = 64; |
3358 | eeprom->address_bits = 6; | 3351 | eeprom->address_bits = 6; |
3359 | } | 3352 | } |
3360 | eeprom->use_eerd = false; | ||
3361 | eeprom->use_eewr = false; | ||
3362 | break; | 3353 | break; |
3363 | case e1000_82541: | 3354 | case e1000_82541: |
3364 | case e1000_82541_rev_2: | 3355 | case e1000_82541_rev_2: |
@@ -3387,8 +3378,6 @@ s32 e1000_init_eeprom_params(struct e1000_hw *hw) | |||
3387 | eeprom->address_bits = 6; | 3378 | eeprom->address_bits = 6; |
3388 | } | 3379 | } |
3389 | } | 3380 | } |
3390 | eeprom->use_eerd = false; | ||
3391 | eeprom->use_eewr = false; | ||
3392 | break; | 3381 | break; |
3393 | default: | 3382 | default: |
3394 | break; | 3383 | break; |
@@ -3773,15 +3762,9 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, | |||
3773 | * directly. In this case, we need to acquire the EEPROM so that | 3762 | * directly. In this case, we need to acquire the EEPROM so that |
3774 | * FW or other port software does not interrupt. | 3763 | * FW or other port software does not interrupt. |
3775 | */ | 3764 | */ |
3776 | if (!hw->eeprom.use_eerd) { | 3765 | /* Prepare the EEPROM for bit-bang reading */ |
3777 | /* Prepare the EEPROM for bit-bang reading */ | 3766 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) |
3778 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) | 3767 | return -E1000_ERR_EEPROM; |
3779 | return -E1000_ERR_EEPROM; | ||
3780 | } | ||
3781 | |||
3782 | /* Eerd register EEPROM access requires no eeprom aquire/release */ | ||
3783 | if (eeprom->use_eerd) | ||
3784 | return e1000_read_eeprom_eerd(hw, offset, words, data); | ||
3785 | 3768 | ||
3786 | /* Set up the SPI or Microwire EEPROM for bit-bang reading. We have | 3769 | /* Set up the SPI or Microwire EEPROM for bit-bang reading. We have |
3787 | * acquired the EEPROM at this point, so any returns should release it */ | 3770 | * acquired the EEPROM at this point, so any returns should release it */ |
@@ -3837,101 +3820,6 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, | |||
3837 | } | 3820 | } |
3838 | 3821 | ||
3839 | /** | 3822 | /** |
3840 | * Reads a 16 bit word from the EEPROM using the EERD register. | ||
3841 | * | ||
3842 | * @hw: Struct containing variables accessed by shared code | ||
3843 | * offset - offset of word in the EEPROM to read | ||
3844 | * data - word read from the EEPROM | ||
3845 | * words - number of words to read | ||
3846 | */ | ||
3847 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, | ||
3848 | u16 *data) | ||
3849 | { | ||
3850 | u32 i, eerd = 0; | ||
3851 | s32 error = 0; | ||
3852 | |||
3853 | for (i = 0; i < words; i++) { | ||
3854 | eerd = ((offset + i) << E1000_EEPROM_RW_ADDR_SHIFT) + | ||
3855 | E1000_EEPROM_RW_REG_START; | ||
3856 | |||
3857 | ew32(EERD, eerd); | ||
3858 | error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_READ); | ||
3859 | |||
3860 | if (error) { | ||
3861 | break; | ||
3862 | } | ||
3863 | data[i] = (er32(EERD) >> E1000_EEPROM_RW_REG_DATA); | ||
3864 | |||
3865 | } | ||
3866 | |||
3867 | return error; | ||
3868 | } | ||
3869 | |||
3870 | /** | ||
3871 | * Writes a 16 bit word from the EEPROM using the EEWR register. | ||
3872 | * | ||
3873 | * @hw: Struct containing variables accessed by shared code | ||
3874 | * offset - offset of word in the EEPROM to read | ||
3875 | * data - word read from the EEPROM | ||
3876 | * words - number of words to read | ||
3877 | */ | ||
3878 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, | ||
3879 | u16 *data) | ||
3880 | { | ||
3881 | u32 register_value = 0; | ||
3882 | u32 i = 0; | ||
3883 | s32 error = 0; | ||
3884 | |||
3885 | for (i = 0; i < words; i++) { | ||
3886 | register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) | | ||
3887 | ((offset + i) << E1000_EEPROM_RW_ADDR_SHIFT) | | ||
3888 | E1000_EEPROM_RW_REG_START; | ||
3889 | |||
3890 | error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE); | ||
3891 | if (error) { | ||
3892 | break; | ||
3893 | } | ||
3894 | |||
3895 | ew32(EEWR, register_value); | ||
3896 | |||
3897 | error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE); | ||
3898 | |||
3899 | if (error) { | ||
3900 | break; | ||
3901 | } | ||
3902 | } | ||
3903 | |||
3904 | return error; | ||
3905 | } | ||
3906 | |||
3907 | /** | ||
3908 | * Polls the status bit (bit 1) of the EERD to determine when the read is done. | ||
3909 | * | ||
3910 | * @hw: Struct containing variables accessed by shared code | ||
3911 | */ | ||
3912 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) | ||
3913 | { | ||
3914 | u32 attempts = 100000; | ||
3915 | u32 i, reg = 0; | ||
3916 | s32 done = E1000_ERR_EEPROM; | ||
3917 | |||
3918 | for (i = 0; i < attempts; i++) { | ||
3919 | if (eerd == E1000_EEPROM_POLL_READ) | ||
3920 | reg = er32(EERD); | ||
3921 | else | ||
3922 | reg = er32(EEWR); | ||
3923 | |||
3924 | if (reg & E1000_EEPROM_RW_REG_DONE) { | ||
3925 | done = E1000_SUCCESS; | ||
3926 | break; | ||
3927 | } | ||
3928 | udelay(5); | ||
3929 | } | ||
3930 | |||
3931 | return done; | ||
3932 | } | ||
3933 | |||
3934 | /** | ||
3935 | * e1000_validate_eeprom_checksum - Verifies that the EEPROM has a valid checksum | 3823 | * e1000_validate_eeprom_checksum - Verifies that the EEPROM has a valid checksum |
3936 | * @hw: Struct containing variables accessed by shared code | 3824 | * @hw: Struct containing variables accessed by shared code |
3937 | * | 3825 | * |
@@ -4031,9 +3919,6 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, | |||
4031 | return -E1000_ERR_EEPROM; | 3919 | return -E1000_ERR_EEPROM; |
4032 | } | 3920 | } |
4033 | 3921 | ||
4034 | if (eeprom->use_eewr) | ||
4035 | return e1000_write_eeprom_eewr(hw, offset, words, data); | ||
4036 | |||
4037 | /* Prepare the EEPROM for writing */ | 3922 | /* Prepare the EEPROM for writing */ |
4038 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) | 3923 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) |
4039 | return -E1000_ERR_EEPROM; | 3924 | return -E1000_ERR_EEPROM; |
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h index 4bfdf323b589..2e42341ca1dd 100644 --- a/drivers/net/e1000/e1000_hw.h +++ b/drivers/net/e1000/e1000_hw.h | |||
@@ -256,8 +256,6 @@ struct e1000_eeprom_info { | |||
256 | u16 address_bits; | 256 | u16 address_bits; |
257 | u16 delay_usec; | 257 | u16 delay_usec; |
258 | u16 page_size; | 258 | u16 page_size; |
259 | bool use_eerd; | ||
260 | bool use_eewr; | ||
261 | }; | 259 | }; |
262 | 260 | ||
263 | /* Flex ASF Information */ | 261 | /* Flex ASF Information */ |