diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2008-08-26 21:37:06 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-03 10:08:13 -0400 |
commit | 4662e82b2cb41c60826e50474dd86dd5c6372b0c (patch) | |
tree | 75a99d62d28ad8ff5d9557f4665bae177218bb2a /drivers/net/e1000e/phy.c | |
parent | f4187b56e1f8a05dd110875d5094b21b51ebd79b (diff) |
e1000e: add support for new 82574L part
This new part has the same feature set as previous parts with the addition
of MSI-X support.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/e1000e/phy.c')
-rw-r--r-- | drivers/net/e1000e/phy.c | 109 |
1 files changed, 108 insertions, 1 deletions
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 16724f84d5ce..6cd333ae61d0 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -476,7 +476,9 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw) | |||
476 | if (ret_val) | 476 | if (ret_val) |
477 | return ret_val; | 477 | return ret_val; |
478 | 478 | ||
479 | if ((phy->type == e1000_phy_m88) && (phy->revision < 4)) { | 479 | if ((phy->type == e1000_phy_m88) && |
480 | (phy->revision < E1000_REVISION_4) && | ||
481 | (phy->id != BME1000_E_PHY_ID_R2)) { | ||
480 | /* | 482 | /* |
481 | * Force TX_CLK in the Extended PHY Specific Control Register | 483 | * Force TX_CLK in the Extended PHY Specific Control Register |
482 | * to 25MHz clock. | 484 | * to 25MHz clock. |
@@ -504,6 +506,18 @@ s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw) | |||
504 | return ret_val; | 506 | return ret_val; |
505 | } | 507 | } |
506 | 508 | ||
509 | if ((phy->type == e1000_phy_bm) && (phy->id == BME1000_E_PHY_ID_R2)) { | ||
510 | /* Set PHY page 0, register 29 to 0x0003 */ | ||
511 | ret_val = e1e_wphy(hw, 29, 0x0003); | ||
512 | if (ret_val) | ||
513 | return ret_val; | ||
514 | |||
515 | /* Set PHY page 0, register 30 to 0x0000 */ | ||
516 | ret_val = e1e_wphy(hw, 30, 0x0000); | ||
517 | if (ret_val) | ||
518 | return ret_val; | ||
519 | } | ||
520 | |||
507 | /* Commit the changes. */ | 521 | /* Commit the changes. */ |
508 | ret_val = e1000e_commit_phy(hw); | 522 | ret_val = e1000e_commit_phy(hw); |
509 | if (ret_val) | 523 | if (ret_val) |
@@ -2054,6 +2068,99 @@ out: | |||
2054 | } | 2068 | } |
2055 | 2069 | ||
2056 | /** | 2070 | /** |
2071 | * e1000e_read_phy_reg_bm2 - Read BM PHY register | ||
2072 | * @hw: pointer to the HW structure | ||
2073 | * @offset: register offset to be read | ||
2074 | * @data: pointer to the read data | ||
2075 | * | ||
2076 | * Acquires semaphore, if necessary, then reads the PHY register at offset | ||
2077 | * and storing the retrieved information in data. Release any acquired | ||
2078 | * semaphores before exiting. | ||
2079 | **/ | ||
2080 | s32 e1000e_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data) | ||
2081 | { | ||
2082 | s32 ret_val; | ||
2083 | u16 page = (u16)(offset >> IGP_PAGE_SHIFT); | ||
2084 | |||
2085 | /* Page 800 works differently than the rest so it has its own func */ | ||
2086 | if (page == BM_WUC_PAGE) { | ||
2087 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data, | ||
2088 | true); | ||
2089 | return ret_val; | ||
2090 | } | ||
2091 | |||
2092 | ret_val = hw->phy.ops.acquire_phy(hw); | ||
2093 | if (ret_val) | ||
2094 | return ret_val; | ||
2095 | |||
2096 | hw->phy.addr = 1; | ||
2097 | |||
2098 | if (offset > MAX_PHY_MULTI_PAGE_REG) { | ||
2099 | |||
2100 | /* Page is shifted left, PHY expects (page x 32) */ | ||
2101 | ret_val = e1000e_write_phy_reg_mdic(hw, BM_PHY_PAGE_SELECT, | ||
2102 | page); | ||
2103 | |||
2104 | if (ret_val) { | ||
2105 | hw->phy.ops.release_phy(hw); | ||
2106 | return ret_val; | ||
2107 | } | ||
2108 | } | ||
2109 | |||
2110 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, | ||
2111 | data); | ||
2112 | hw->phy.ops.release_phy(hw); | ||
2113 | |||
2114 | return ret_val; | ||
2115 | } | ||
2116 | |||
2117 | /** | ||
2118 | * e1000e_write_phy_reg_bm2 - Write BM PHY register | ||
2119 | * @hw: pointer to the HW structure | ||
2120 | * @offset: register offset to write to | ||
2121 | * @data: data to write at register offset | ||
2122 | * | ||
2123 | * Acquires semaphore, if necessary, then writes the data to PHY register | ||
2124 | * at the offset. Release any acquired semaphores before exiting. | ||
2125 | **/ | ||
2126 | s32 e1000e_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data) | ||
2127 | { | ||
2128 | s32 ret_val; | ||
2129 | u16 page = (u16)(offset >> IGP_PAGE_SHIFT); | ||
2130 | |||
2131 | /* Page 800 works differently than the rest so it has its own func */ | ||
2132 | if (page == BM_WUC_PAGE) { | ||
2133 | ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data, | ||
2134 | false); | ||
2135 | return ret_val; | ||
2136 | } | ||
2137 | |||
2138 | ret_val = hw->phy.ops.acquire_phy(hw); | ||
2139 | if (ret_val) | ||
2140 | return ret_val; | ||
2141 | |||
2142 | hw->phy.addr = 1; | ||
2143 | |||
2144 | if (offset > MAX_PHY_MULTI_PAGE_REG) { | ||
2145 | /* Page is shifted left, PHY expects (page x 32) */ | ||
2146 | ret_val = e1000e_write_phy_reg_mdic(hw, BM_PHY_PAGE_SELECT, | ||
2147 | page); | ||
2148 | |||
2149 | if (ret_val) { | ||
2150 | hw->phy.ops.release_phy(hw); | ||
2151 | return ret_val; | ||
2152 | } | ||
2153 | } | ||
2154 | |||
2155 | ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, | ||
2156 | data); | ||
2157 | |||
2158 | hw->phy.ops.release_phy(hw); | ||
2159 | |||
2160 | return ret_val; | ||
2161 | } | ||
2162 | |||
2163 | /** | ||
2057 | * e1000_access_phy_wakeup_reg_bm - Read BM PHY wakeup register | 2164 | * e1000_access_phy_wakeup_reg_bm - Read BM PHY wakeup register |
2058 | * @hw: pointer to the HW structure | 2165 | * @hw: pointer to the HW structure |
2059 | * @offset: register offset to be read or written | 2166 | * @offset: register offset to be read or written |