diff options
Diffstat (limited to 'drivers/net/e1000e/ich8lan.c')
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 253 |
1 files changed, 242 insertions, 11 deletions
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 9e38452a738c..523b9716a543 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -43,7 +43,9 @@ | |||
43 | * 82567LM-2 Gigabit Network Connection | 43 | * 82567LM-2 Gigabit Network Connection |
44 | * 82567LF-2 Gigabit Network Connection | 44 | * 82567LF-2 Gigabit Network Connection |
45 | * 82567V-2 Gigabit Network Connection | 45 | * 82567V-2 Gigabit Network Connection |
46 | * 82562GT-3 10/100 Network Connection | 46 | * 82567LF-3 Gigabit Network Connection |
47 | * 82567LM-3 Gigabit Network Connection | ||
48 | * 82567LM-4 Gigabit Network Connection | ||
47 | */ | 49 | */ |
48 | 50 | ||
49 | #include <linux/netdevice.h> | 51 | #include <linux/netdevice.h> |
@@ -58,6 +60,7 @@ | |||
58 | #define ICH_FLASH_HSFCTL 0x0006 | 60 | #define ICH_FLASH_HSFCTL 0x0006 |
59 | #define ICH_FLASH_FADDR 0x0008 | 61 | #define ICH_FLASH_FADDR 0x0008 |
60 | #define ICH_FLASH_FDATA0 0x0010 | 62 | #define ICH_FLASH_FDATA0 0x0010 |
63 | #define ICH_FLASH_PR0 0x0074 | ||
61 | 64 | ||
62 | #define ICH_FLASH_READ_COMMAND_TIMEOUT 500 | 65 | #define ICH_FLASH_READ_COMMAND_TIMEOUT 500 |
63 | #define ICH_FLASH_WRITE_COMMAND_TIMEOUT 500 | 66 | #define ICH_FLASH_WRITE_COMMAND_TIMEOUT 500 |
@@ -150,6 +153,19 @@ union ich8_hws_flash_regacc { | |||
150 | u16 regval; | 153 | u16 regval; |
151 | }; | 154 | }; |
152 | 155 | ||
156 | /* ICH Flash Protected Region */ | ||
157 | union ich8_flash_protected_range { | ||
158 | struct ich8_pr { | ||
159 | u32 base:13; /* 0:12 Protected Range Base */ | ||
160 | u32 reserved1:2; /* 13:14 Reserved */ | ||
161 | u32 rpe:1; /* 15 Read Protection Enable */ | ||
162 | u32 limit:13; /* 16:28 Protected Range Limit */ | ||
163 | u32 reserved2:2; /* 29:30 Reserved */ | ||
164 | u32 wpe:1; /* 31 Write Protection Enable */ | ||
165 | } range; | ||
166 | u32 regval; | ||
167 | }; | ||
168 | |||
153 | static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw); | 169 | static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw); |
154 | static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw); | 170 | static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw); |
155 | static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw); | 171 | static void e1000_initialize_hw_bits_ich8lan(struct e1000_hw *hw); |
@@ -157,12 +173,15 @@ static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw); | |||
157 | static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank); | 173 | static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank); |
158 | static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw, | 174 | static s32 e1000_retry_write_flash_byte_ich8lan(struct e1000_hw *hw, |
159 | u32 offset, u8 byte); | 175 | u32 offset, u8 byte); |
176 | static s32 e1000_read_flash_byte_ich8lan(struct e1000_hw *hw, u32 offset, | ||
177 | u8 *data); | ||
160 | static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, | 178 | static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, |
161 | u16 *data); | 179 | u16 *data); |
162 | static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, | 180 | static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, |
163 | u8 size, u16 *data); | 181 | u8 size, u16 *data); |
164 | static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw); | 182 | static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw); |
165 | static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw); | 183 | static s32 e1000_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw); |
184 | static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw); | ||
166 | 185 | ||
167 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) | 186 | static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) |
168 | { | 187 | { |
@@ -366,6 +385,9 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) | |||
366 | return 0; | 385 | return 0; |
367 | } | 386 | } |
368 | 387 | ||
388 | static DEFINE_MUTEX(nvm_mutex); | ||
389 | static pid_t nvm_owner = -1; | ||
390 | |||
369 | /** | 391 | /** |
370 | * e1000_acquire_swflag_ich8lan - Acquire software control flag | 392 | * e1000_acquire_swflag_ich8lan - Acquire software control flag |
371 | * @hw: pointer to the HW structure | 393 | * @hw: pointer to the HW structure |
@@ -379,6 +401,15 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
379 | u32 extcnf_ctrl; | 401 | u32 extcnf_ctrl; |
380 | u32 timeout = PHY_CFG_TIMEOUT; | 402 | u32 timeout = PHY_CFG_TIMEOUT; |
381 | 403 | ||
404 | might_sleep(); | ||
405 | |||
406 | if (!mutex_trylock(&nvm_mutex)) { | ||
407 | WARN(1, KERN_ERR "e1000e mutex contention. Owned by pid %d\n", | ||
408 | nvm_owner); | ||
409 | mutex_lock(&nvm_mutex); | ||
410 | } | ||
411 | nvm_owner = current->pid; | ||
412 | |||
382 | while (timeout) { | 413 | while (timeout) { |
383 | extcnf_ctrl = er32(EXTCNF_CTRL); | 414 | extcnf_ctrl = er32(EXTCNF_CTRL); |
384 | extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG; | 415 | extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG; |
@@ -393,6 +424,10 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
393 | 424 | ||
394 | if (!timeout) { | 425 | if (!timeout) { |
395 | hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); | 426 | hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); |
427 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; | ||
428 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
429 | nvm_owner = -1; | ||
430 | mutex_unlock(&nvm_mutex); | ||
396 | return -E1000_ERR_CONFIG; | 431 | return -E1000_ERR_CONFIG; |
397 | } | 432 | } |
398 | 433 | ||
@@ -414,6 +449,25 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) | |||
414 | extcnf_ctrl = er32(EXTCNF_CTRL); | 449 | extcnf_ctrl = er32(EXTCNF_CTRL); |
415 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; | 450 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; |
416 | ew32(EXTCNF_CTRL, extcnf_ctrl); | 451 | ew32(EXTCNF_CTRL, extcnf_ctrl); |
452 | |||
453 | nvm_owner = -1; | ||
454 | mutex_unlock(&nvm_mutex); | ||
455 | } | ||
456 | |||
457 | /** | ||
458 | * e1000_check_mng_mode_ich8lan - Checks management mode | ||
459 | * @hw: pointer to the HW structure | ||
460 | * | ||
461 | * This checks if the adapter has manageability enabled. | ||
462 | * This is a function pointer entry point only called by read/write | ||
463 | * routines for the PHY and NVM parts. | ||
464 | **/ | ||
465 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw) | ||
466 | { | ||
467 | u32 fwsm = er32(FWSM); | ||
468 | |||
469 | return (fwsm & E1000_FWSM_MODE_MASK) == | ||
470 | (E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT); | ||
417 | } | 471 | } |
418 | 472 | ||
419 | /** | 473 | /** |
@@ -897,6 +951,56 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active) | |||
897 | } | 951 | } |
898 | 952 | ||
899 | /** | 953 | /** |
954 | * e1000_valid_nvm_bank_detect_ich8lan - finds out the valid bank 0 or 1 | ||
955 | * @hw: pointer to the HW structure | ||
956 | * @bank: pointer to the variable that returns the active bank | ||
957 | * | ||
958 | * Reads signature byte from the NVM using the flash access registers. | ||
959 | **/ | ||
960 | static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank) | ||
961 | { | ||
962 | struct e1000_nvm_info *nvm = &hw->nvm; | ||
963 | /* flash bank size is in words */ | ||
964 | u32 bank1_offset = nvm->flash_bank_size * sizeof(u16); | ||
965 | u32 act_offset = E1000_ICH_NVM_SIG_WORD * 2 + 1; | ||
966 | u8 bank_high_byte = 0; | ||
967 | |||
968 | if (hw->mac.type != e1000_ich10lan) { | ||
969 | if (er32(EECD) & E1000_EECD_SEC1VAL) | ||
970 | *bank = 1; | ||
971 | else | ||
972 | *bank = 0; | ||
973 | } else { | ||
974 | /* | ||
975 | * Make sure the signature for bank 0 is valid, | ||
976 | * if not check for bank1 | ||
977 | */ | ||
978 | e1000_read_flash_byte_ich8lan(hw, act_offset, &bank_high_byte); | ||
979 | if ((bank_high_byte & 0xC0) == 0x80) { | ||
980 | *bank = 0; | ||
981 | } else { | ||
982 | /* | ||
983 | * find if segment 1 is valid by verifying | ||
984 | * bit 15:14 = 10b in word 0x13 | ||
985 | */ | ||
986 | e1000_read_flash_byte_ich8lan(hw, | ||
987 | act_offset + bank1_offset, | ||
988 | &bank_high_byte); | ||
989 | |||
990 | /* bank1 has a valid signature equivalent to SEC1V */ | ||
991 | if ((bank_high_byte & 0xC0) == 0x80) { | ||
992 | *bank = 1; | ||
993 | } else { | ||
994 | hw_dbg(hw, "ERROR: EEPROM not present\n"); | ||
995 | return -E1000_ERR_NVM; | ||
996 | } | ||
997 | } | ||
998 | } | ||
999 | |||
1000 | return 0; | ||
1001 | } | ||
1002 | |||
1003 | /** | ||
900 | * e1000_read_nvm_ich8lan - Read word(s) from the NVM | 1004 | * e1000_read_nvm_ich8lan - Read word(s) from the NVM |
901 | * @hw: pointer to the HW structure | 1005 | * @hw: pointer to the HW structure |
902 | * @offset: The offset (in bytes) of the word(s) to read. | 1006 | * @offset: The offset (in bytes) of the word(s) to read. |
@@ -912,6 +1016,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, | |||
912 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | 1016 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; |
913 | u32 act_offset; | 1017 | u32 act_offset; |
914 | s32 ret_val; | 1018 | s32 ret_val; |
1019 | u32 bank = 0; | ||
915 | u16 i, word; | 1020 | u16 i, word; |
916 | 1021 | ||
917 | if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) || | 1022 | if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) || |
@@ -924,10 +1029,11 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, | |||
924 | if (ret_val) | 1029 | if (ret_val) |
925 | return ret_val; | 1030 | return ret_val; |
926 | 1031 | ||
927 | /* Start with the bank offset, then add the relative offset. */ | 1032 | ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank); |
928 | act_offset = (er32(EECD) & E1000_EECD_SEC1VAL) | 1033 | if (ret_val) |
929 | ? nvm->flash_bank_size | 1034 | return ret_val; |
930 | : 0; | 1035 | |
1036 | act_offset = (bank) ? nvm->flash_bank_size : 0; | ||
931 | act_offset += offset; | 1037 | act_offset += offset; |
932 | 1038 | ||
933 | for (i = 0; i < words; i++) { | 1039 | for (i = 0; i < words; i++) { |
@@ -1075,6 +1181,29 @@ static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, | |||
1075 | } | 1181 | } |
1076 | 1182 | ||
1077 | /** | 1183 | /** |
1184 | * e1000_read_flash_byte_ich8lan - Read byte from flash | ||
1185 | * @hw: pointer to the HW structure | ||
1186 | * @offset: The offset of the byte to read. | ||
1187 | * @data: Pointer to a byte to store the value read. | ||
1188 | * | ||
1189 | * Reads a single byte from the NVM using the flash access registers. | ||
1190 | **/ | ||
1191 | static s32 e1000_read_flash_byte_ich8lan(struct e1000_hw *hw, u32 offset, | ||
1192 | u8 *data) | ||
1193 | { | ||
1194 | s32 ret_val; | ||
1195 | u16 word = 0; | ||
1196 | |||
1197 | ret_val = e1000_read_flash_data_ich8lan(hw, offset, 1, &word); | ||
1198 | if (ret_val) | ||
1199 | return ret_val; | ||
1200 | |||
1201 | *data = (u8)word; | ||
1202 | |||
1203 | return 0; | ||
1204 | } | ||
1205 | |||
1206 | /** | ||
1078 | * e1000_read_flash_data_ich8lan - Read byte or word from NVM | 1207 | * e1000_read_flash_data_ich8lan - Read byte or word from NVM |
1079 | * @hw: pointer to the HW structure | 1208 | * @hw: pointer to the HW structure |
1080 | * @offset: The offset (in bytes) of the byte or word to read. | 1209 | * @offset: The offset (in bytes) of the byte or word to read. |
@@ -1205,7 +1334,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1205 | { | 1334 | { |
1206 | struct e1000_nvm_info *nvm = &hw->nvm; | 1335 | struct e1000_nvm_info *nvm = &hw->nvm; |
1207 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | 1336 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; |
1208 | u32 i, act_offset, new_bank_offset, old_bank_offset; | 1337 | u32 i, act_offset, new_bank_offset, old_bank_offset, bank; |
1209 | s32 ret_val; | 1338 | s32 ret_val; |
1210 | u16 data; | 1339 | u16 data; |
1211 | 1340 | ||
@@ -1225,7 +1354,11 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1225 | * write to bank 0 etc. We also need to erase the segment that | 1354 | * write to bank 0 etc. We also need to erase the segment that |
1226 | * is going to be written | 1355 | * is going to be written |
1227 | */ | 1356 | */ |
1228 | if (!(er32(EECD) & E1000_EECD_SEC1VAL)) { | 1357 | ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank); |
1358 | if (ret_val) | ||
1359 | return ret_val; | ||
1360 | |||
1361 | if (bank == 0) { | ||
1229 | new_bank_offset = nvm->flash_bank_size; | 1362 | new_bank_offset = nvm->flash_bank_size; |
1230 | old_bank_offset = 0; | 1363 | old_bank_offset = 0; |
1231 | e1000_erase_flash_bank_ich8lan(hw, 1); | 1364 | e1000_erase_flash_bank_ich8lan(hw, 1); |
@@ -1284,6 +1417,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1284 | * programming failed. | 1417 | * programming failed. |
1285 | */ | 1418 | */ |
1286 | if (ret_val) { | 1419 | if (ret_val) { |
1420 | /* Possibly read-only, see e1000e_write_protect_nvm_ich8lan() */ | ||
1287 | hw_dbg(hw, "Flash commit failed.\n"); | 1421 | hw_dbg(hw, "Flash commit failed.\n"); |
1288 | e1000_release_swflag_ich8lan(hw); | 1422 | e1000_release_swflag_ich8lan(hw); |
1289 | return ret_val; | 1423 | return ret_val; |
@@ -1374,6 +1508,49 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw) | |||
1374 | } | 1508 | } |
1375 | 1509 | ||
1376 | /** | 1510 | /** |
1511 | * e1000e_write_protect_nvm_ich8lan - Make the NVM read-only | ||
1512 | * @hw: pointer to the HW structure | ||
1513 | * | ||
1514 | * To prevent malicious write/erase of the NVM, set it to be read-only | ||
1515 | * so that the hardware ignores all write/erase cycles of the NVM via | ||
1516 | * the flash control registers. The shadow-ram copy of the NVM will | ||
1517 | * still be updated, however any updates to this copy will not stick | ||
1518 | * across driver reloads. | ||
1519 | **/ | ||
1520 | void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw) | ||
1521 | { | ||
1522 | union ich8_flash_protected_range pr0; | ||
1523 | union ich8_hws_flash_status hsfsts; | ||
1524 | u32 gfpreg; | ||
1525 | s32 ret_val; | ||
1526 | |||
1527 | ret_val = e1000_acquire_swflag_ich8lan(hw); | ||
1528 | if (ret_val) | ||
1529 | return; | ||
1530 | |||
1531 | gfpreg = er32flash(ICH_FLASH_GFPREG); | ||
1532 | |||
1533 | /* Write-protect GbE Sector of NVM */ | ||
1534 | pr0.regval = er32flash(ICH_FLASH_PR0); | ||
1535 | pr0.range.base = gfpreg & FLASH_GFPREG_BASE_MASK; | ||
1536 | pr0.range.limit = ((gfpreg >> 16) & FLASH_GFPREG_BASE_MASK); | ||
1537 | pr0.range.wpe = true; | ||
1538 | ew32flash(ICH_FLASH_PR0, pr0.regval); | ||
1539 | |||
1540 | /* | ||
1541 | * Lock down a subset of GbE Flash Control Registers, e.g. | ||
1542 | * PR0 to prevent the write-protection from being lifted. | ||
1543 | * Once FLOCKDN is set, the registers protected by it cannot | ||
1544 | * be written until FLOCKDN is cleared by a hardware reset. | ||
1545 | */ | ||
1546 | hsfsts.regval = er16flash(ICH_FLASH_HSFSTS); | ||
1547 | hsfsts.hsf_status.flockdn = true; | ||
1548 | ew32flash(ICH_FLASH_HSFSTS, hsfsts.regval); | ||
1549 | |||
1550 | e1000_release_swflag_ich8lan(hw); | ||
1551 | } | ||
1552 | |||
1553 | /** | ||
1377 | * e1000_write_flash_data_ich8lan - Writes bytes to the NVM | 1554 | * e1000_write_flash_data_ich8lan - Writes bytes to the NVM |
1378 | * @hw: pointer to the HW structure | 1555 | * @hw: pointer to the HW structure |
1379 | * @offset: The offset (in bytes) of the byte/word to read. | 1556 | * @offset: The offset (in bytes) of the byte/word to read. |
@@ -1720,6 +1897,9 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) | |||
1720 | ew32(CTRL, (ctrl | E1000_CTRL_RST)); | 1897 | ew32(CTRL, (ctrl | E1000_CTRL_RST)); |
1721 | msleep(20); | 1898 | msleep(20); |
1722 | 1899 | ||
1900 | /* release the swflag because it is not reset by hardware reset */ | ||
1901 | e1000_release_swflag_ich8lan(hw); | ||
1902 | |||
1723 | ret_val = e1000e_get_auto_rd_done(hw); | 1903 | ret_val = e1000e_get_auto_rd_done(hw); |
1724 | if (ret_val) { | 1904 | if (ret_val) { |
1725 | /* | 1905 | /* |
@@ -2189,13 +2369,14 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) | |||
2189 | * 'LPLU Enabled' and 'Gig Disable' to force link speed negotiation | 2369 | * 'LPLU Enabled' and 'Gig Disable' to force link speed negotiation |
2190 | * to a lower speed. | 2370 | * to a lower speed. |
2191 | * | 2371 | * |
2192 | * Should only be called for ICH9 devices. | 2372 | * Should only be called for ICH9 and ICH10 devices. |
2193 | **/ | 2373 | **/ |
2194 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) | 2374 | void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw) |
2195 | { | 2375 | { |
2196 | u32 phy_ctrl; | 2376 | u32 phy_ctrl; |
2197 | 2377 | ||
2198 | if (hw->mac.type == e1000_ich9lan) { | 2378 | if ((hw->mac.type == e1000_ich10lan) || |
2379 | (hw->mac.type == e1000_ich9lan)) { | ||
2199 | phy_ctrl = er32(PHY_CTRL); | 2380 | phy_ctrl = er32(PHY_CTRL); |
2200 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | | 2381 | phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU | |
2201 | E1000_PHY_CTRL_GBE_DISABLE; | 2382 | E1000_PHY_CTRL_GBE_DISABLE; |
@@ -2253,6 +2434,39 @@ static s32 e1000_led_off_ich8lan(struct e1000_hw *hw) | |||
2253 | } | 2434 | } |
2254 | 2435 | ||
2255 | /** | 2436 | /** |
2437 | * e1000_get_cfg_done_ich8lan - Read config done bit | ||
2438 | * @hw: pointer to the HW structure | ||
2439 | * | ||
2440 | * Read the management control register for the config done bit for | ||
2441 | * completion status. NOTE: silicon which is EEPROM-less will fail trying | ||
2442 | * to read the config done bit, so an error is *ONLY* logged and returns | ||
2443 | * E1000_SUCCESS. If we were to return with error, EEPROM-less silicon | ||
2444 | * would not be able to be reset or change link. | ||
2445 | **/ | ||
2446 | static s32 e1000_get_cfg_done_ich8lan(struct e1000_hw *hw) | ||
2447 | { | ||
2448 | u32 bank = 0; | ||
2449 | |||
2450 | e1000e_get_cfg_done(hw); | ||
2451 | |||
2452 | /* If EEPROM is not marked present, init the IGP 3 PHY manually */ | ||
2453 | if (hw->mac.type != e1000_ich10lan) { | ||
2454 | if (((er32(EECD) & E1000_EECD_PRES) == 0) && | ||
2455 | (hw->phy.type == e1000_phy_igp_3)) { | ||
2456 | e1000e_phy_init_script_igp3(hw); | ||
2457 | } | ||
2458 | } else { | ||
2459 | if (e1000_valid_nvm_bank_detect_ich8lan(hw, &bank)) { | ||
2460 | /* Maybe we should do a basic PHY config */ | ||
2461 | hw_dbg(hw, "EEPROM not present\n"); | ||
2462 | return -E1000_ERR_CONFIG; | ||
2463 | } | ||
2464 | } | ||
2465 | |||
2466 | return 0; | ||
2467 | } | ||
2468 | |||
2469 | /** | ||
2256 | * e1000_clear_hw_cntrs_ich8lan - Clear statistical counters | 2470 | * e1000_clear_hw_cntrs_ich8lan - Clear statistical counters |
2257 | * @hw: pointer to the HW structure | 2471 | * @hw: pointer to the HW structure |
2258 | * | 2472 | * |
@@ -2282,7 +2496,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | |||
2282 | } | 2496 | } |
2283 | 2497 | ||
2284 | static struct e1000_mac_operations ich8_mac_ops = { | 2498 | static struct e1000_mac_operations ich8_mac_ops = { |
2285 | .mng_mode_enab = E1000_ICH_MNG_IAMT_MODE << E1000_FWSM_MODE_SHIFT, | 2499 | .check_mng_mode = e1000_check_mng_mode_ich8lan, |
2286 | .check_for_link = e1000e_check_for_copper_link, | 2500 | .check_for_link = e1000e_check_for_copper_link, |
2287 | .cleanup_led = e1000_cleanup_led_ich8lan, | 2501 | .cleanup_led = e1000_cleanup_led_ich8lan, |
2288 | .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan, | 2502 | .clear_hw_cntrs = e1000_clear_hw_cntrs_ich8lan, |
@@ -2302,7 +2516,7 @@ static struct e1000_phy_operations ich8_phy_ops = { | |||
2302 | .check_reset_block = e1000_check_reset_block_ich8lan, | 2516 | .check_reset_block = e1000_check_reset_block_ich8lan, |
2303 | .commit_phy = NULL, | 2517 | .commit_phy = NULL, |
2304 | .force_speed_duplex = e1000_phy_force_speed_duplex_ich8lan, | 2518 | .force_speed_duplex = e1000_phy_force_speed_duplex_ich8lan, |
2305 | .get_cfg_done = e1000e_get_cfg_done, | 2519 | .get_cfg_done = e1000_get_cfg_done_ich8lan, |
2306 | .get_cable_length = e1000e_get_cable_length_igp_2, | 2520 | .get_cable_length = e1000e_get_cable_length_igp_2, |
2307 | .get_phy_info = e1000_get_phy_info_ich8lan, | 2521 | .get_phy_info = e1000_get_phy_info_ich8lan, |
2308 | .read_phy_reg = e1000e_read_phy_reg_igp, | 2522 | .read_phy_reg = e1000e_read_phy_reg_igp, |
@@ -2357,3 +2571,20 @@ struct e1000_info e1000_ich9_info = { | |||
2357 | .nvm_ops = &ich8_nvm_ops, | 2571 | .nvm_ops = &ich8_nvm_ops, |
2358 | }; | 2572 | }; |
2359 | 2573 | ||
2574 | struct e1000_info e1000_ich10_info = { | ||
2575 | .mac = e1000_ich10lan, | ||
2576 | .flags = FLAG_HAS_JUMBO_FRAMES | ||
2577 | | FLAG_IS_ICH | ||
2578 | | FLAG_HAS_WOL | ||
2579 | | FLAG_RX_CSUM_ENABLED | ||
2580 | | FLAG_HAS_CTRLEXT_ON_LOAD | ||
2581 | | FLAG_HAS_AMT | ||
2582 | | FLAG_HAS_ERT | ||
2583 | | FLAG_HAS_FLASH | ||
2584 | | FLAG_APME_IN_WUC, | ||
2585 | .pba = 10, | ||
2586 | .get_variants = e1000_get_variants_ich8lan, | ||
2587 | .mac_ops = &ich8_mac_ops, | ||
2588 | .phy_ops = &ich8_phy_ops, | ||
2589 | .nvm_ops = &ich8_nvm_ops, | ||
2590 | }; | ||