diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2010-06-16 09:27:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-19 01:12:16 -0400 |
commit | d3738bb8203acf8552c3ec8b3447133fc0938ddd (patch) | |
tree | c466411e6dce52ca422ad524ace68301c6b0d169 /drivers/net/e1000e/ich8lan.c | |
parent | eb7700dc0344564b0b9857d1f5e331a0dd629e92 (diff) |
e1000e: initial support for 82579 LOMs
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/ich8lan.c')
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 328 |
1 files changed, 311 insertions, 17 deletions
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 7e2f98c24f96..8274499b7df6 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -52,6 +52,8 @@ | |||
52 | * 82577LC Gigabit Network Connection | 52 | * 82577LC Gigabit Network Connection |
53 | * 82578DM Gigabit Network Connection | 53 | * 82578DM Gigabit Network Connection |
54 | * 82578DC Gigabit Network Connection | 54 | * 82578DC Gigabit Network Connection |
55 | * 82579LM Gigabit Network Connection | ||
56 | * 82579V Gigabit Network Connection | ||
55 | */ | 57 | */ |
56 | 58 | ||
57 | #include "e1000.h" | 59 | #include "e1000.h" |
@@ -126,6 +128,9 @@ | |||
126 | #define HV_SMB_ADDR_PEC_EN 0x0200 | 128 | #define HV_SMB_ADDR_PEC_EN 0x0200 |
127 | #define HV_SMB_ADDR_VALID 0x0080 | 129 | #define HV_SMB_ADDR_VALID 0x0080 |
128 | 130 | ||
131 | /* PHY Power Management Control */ | ||
132 | #define HV_PM_CTRL PHY_REG(770, 17) | ||
133 | |||
129 | /* Strapping Option Register - RO */ | 134 | /* Strapping Option Register - RO */ |
130 | #define E1000_STRAP 0x0000C | 135 | #define E1000_STRAP 0x0000C |
131 | #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000 | 136 | #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000 |
@@ -279,13 +284,13 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
279 | phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; | 284 | phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; |
280 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; | 285 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
281 | 286 | ||
287 | /* | ||
288 | * The MAC-PHY interconnect may still be in SMBus mode | ||
289 | * after Sx->S0. If the manageability engine (ME) is | ||
290 | * disabled, then toggle the LANPHYPC Value bit to force | ||
291 | * the interconnect to PCIe mode. | ||
292 | */ | ||
282 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | 293 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { |
283 | /* | ||
284 | * The MAC-PHY interconnect may still be in SMBus mode | ||
285 | * after Sx->S0. Toggle the LANPHYPC Value bit to force | ||
286 | * the interconnect to PCIe mode, but only if there is no | ||
287 | * firmware present otherwise firmware will have done it. | ||
288 | */ | ||
289 | ctrl = er32(CTRL); | 294 | ctrl = er32(CTRL); |
290 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; | 295 | ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; |
291 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; | 296 | ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; |
@@ -326,6 +331,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
326 | 331 | ||
327 | switch (phy->type) { | 332 | switch (phy->type) { |
328 | case e1000_phy_82577: | 333 | case e1000_phy_82577: |
334 | case e1000_phy_82579: | ||
329 | phy->ops.check_polarity = e1000_check_polarity_82577; | 335 | phy->ops.check_polarity = e1000_check_polarity_82577; |
330 | phy->ops.force_speed_duplex = | 336 | phy->ops.force_speed_duplex = |
331 | e1000_phy_force_speed_duplex_82577; | 337 | e1000_phy_force_speed_duplex_82577; |
@@ -530,6 +536,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
530 | mac->ops.led_off = e1000_led_off_ich8lan; | 536 | mac->ops.led_off = e1000_led_off_ich8lan; |
531 | break; | 537 | break; |
532 | case e1000_pchlan: | 538 | case e1000_pchlan: |
539 | case e1000_pch2lan: | ||
533 | /* check management mode */ | 540 | /* check management mode */ |
534 | mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; | 541 | mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; |
535 | /* ID LED init */ | 542 | /* ID LED init */ |
@@ -550,6 +557,14 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_adapter *adapter) | |||
550 | if (mac->type == e1000_ich8lan) | 557 | if (mac->type == e1000_ich8lan) |
551 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); | 558 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); |
552 | 559 | ||
560 | /* Disable PHY configuration by hardware, config by software */ | ||
561 | if (mac->type == e1000_pch2lan) { | ||
562 | u32 extcnf_ctrl = er32(EXTCNF_CTRL); | ||
563 | |||
564 | extcnf_ctrl |= E1000_EXTCNF_CTRL_GATE_PHY_CFG; | ||
565 | ew32(EXTCNF_CTRL, extcnf_ctrl); | ||
566 | } | ||
567 | |||
553 | return 0; | 568 | return 0; |
554 | } | 569 | } |
555 | 570 | ||
@@ -653,10 +668,19 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) | |||
653 | if (rc) | 668 | if (rc) |
654 | return rc; | 669 | return rc; |
655 | 670 | ||
656 | if (hw->mac.type == e1000_pchlan) | 671 | switch (hw->mac.type) { |
657 | rc = e1000_init_phy_params_pchlan(hw); | 672 | case e1000_ich8lan: |
658 | else | 673 | case e1000_ich9lan: |
674 | case e1000_ich10lan: | ||
659 | rc = e1000_init_phy_params_ich8lan(hw); | 675 | rc = e1000_init_phy_params_ich8lan(hw); |
676 | break; | ||
677 | case e1000_pchlan: | ||
678 | case e1000_pch2lan: | ||
679 | rc = e1000_init_phy_params_pchlan(hw); | ||
680 | break; | ||
681 | default: | ||
682 | break; | ||
683 | } | ||
660 | if (rc) | 684 | if (rc) |
661 | return rc; | 685 | return rc; |
662 | 686 | ||
@@ -861,6 +885,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
861 | } | 885 | } |
862 | /* Fall-thru */ | 886 | /* Fall-thru */ |
863 | case e1000_pchlan: | 887 | case e1000_pchlan: |
888 | case e1000_pch2lan: | ||
864 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; | 889 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; |
865 | break; | 890 | break; |
866 | default: | 891 | default: |
@@ -880,8 +905,10 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
880 | * extended configuration before SW configuration | 905 | * extended configuration before SW configuration |
881 | */ | 906 | */ |
882 | data = er32(EXTCNF_CTRL); | 907 | data = er32(EXTCNF_CTRL); |
883 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) | 908 | if (!(hw->mac.type == e1000_pch2lan)) { |
884 | goto out; | 909 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) |
910 | goto out; | ||
911 | } | ||
885 | 912 | ||
886 | cnf_size = er32(EXTCNF_SIZE); | 913 | cnf_size = er32(EXTCNF_SIZE); |
887 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; | 914 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; |
@@ -893,7 +920,8 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
893 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | 920 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; |
894 | 921 | ||
895 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | 922 | if (!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && |
896 | (hw->mac.type == e1000_pchlan)) { | 923 | ((hw->mac.type == e1000_pchlan) || |
924 | (hw->mac.type == e1000_pch2lan))) { | ||
897 | /* | 925 | /* |
898 | * HW configures the SMBus address and LEDs when the | 926 | * HW configures the SMBus address and LEDs when the |
899 | * OEM and LCD Write Enable bits are set in the NVM. | 927 | * OEM and LCD Write Enable bits are set in the NVM. |
@@ -1100,16 +1128,18 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1100 | u32 mac_reg; | 1128 | u32 mac_reg; |
1101 | u16 oem_reg; | 1129 | u16 oem_reg; |
1102 | 1130 | ||
1103 | if (hw->mac.type != e1000_pchlan) | 1131 | if ((hw->mac.type != e1000_pch2lan) && (hw->mac.type != e1000_pchlan)) |
1104 | return ret_val; | 1132 | return ret_val; |
1105 | 1133 | ||
1106 | ret_val = hw->phy.ops.acquire(hw); | 1134 | ret_val = hw->phy.ops.acquire(hw); |
1107 | if (ret_val) | 1135 | if (ret_val) |
1108 | return ret_val; | 1136 | return ret_val; |
1109 | 1137 | ||
1110 | mac_reg = er32(EXTCNF_CTRL); | 1138 | if (!(hw->mac.type == e1000_pch2lan)) { |
1111 | if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) | 1139 | mac_reg = er32(EXTCNF_CTRL); |
1112 | goto out; | 1140 | if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) |
1141 | goto out; | ||
1142 | } | ||
1113 | 1143 | ||
1114 | mac_reg = er32(FEXTNVM); | 1144 | mac_reg = er32(FEXTNVM); |
1115 | if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M)) | 1145 | if (!(mac_reg & E1000_FEXTNVM_SW_CONFIG_ICH8M)) |
@@ -1250,6 +1280,243 @@ out: | |||
1250 | } | 1280 | } |
1251 | 1281 | ||
1252 | /** | 1282 | /** |
1283 | * e1000_copy_rx_addrs_to_phy_ich8lan - Copy Rx addresses from MAC to PHY | ||
1284 | * @hw: pointer to the HW structure | ||
1285 | **/ | ||
1286 | void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw) | ||
1287 | { | ||
1288 | u32 mac_reg; | ||
1289 | u16 i; | ||
1290 | |||
1291 | /* Copy both RAL/H (rar_entry_count) and SHRAL/H (+4) to PHY */ | ||
1292 | for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) { | ||
1293 | mac_reg = er32(RAL(i)); | ||
1294 | e1e_wphy(hw, BM_RAR_L(i), (u16)(mac_reg & 0xFFFF)); | ||
1295 | e1e_wphy(hw, BM_RAR_M(i), (u16)((mac_reg >> 16) & 0xFFFF)); | ||
1296 | mac_reg = er32(RAH(i)); | ||
1297 | e1e_wphy(hw, BM_RAR_H(i), (u16)(mac_reg & 0xFFFF)); | ||
1298 | e1e_wphy(hw, BM_RAR_CTRL(i), (u16)((mac_reg >> 16) & 0x8000)); | ||
1299 | } | ||
1300 | } | ||
1301 | |||
1302 | static u32 e1000_calc_rx_da_crc(u8 mac[]) | ||
1303 | { | ||
1304 | u32 poly = 0xEDB88320; /* Polynomial for 802.3 CRC calculation */ | ||
1305 | u32 i, j, mask, crc; | ||
1306 | |||
1307 | crc = 0xffffffff; | ||
1308 | for (i = 0; i < 6; i++) { | ||
1309 | crc = crc ^ mac[i]; | ||
1310 | for (j = 8; j > 0; j--) { | ||
1311 | mask = (crc & 1) * (-1); | ||
1312 | crc = (crc >> 1) ^ (poly & mask); | ||
1313 | } | ||
1314 | } | ||
1315 | return ~crc; | ||
1316 | } | ||
1317 | |||
1318 | /** | ||
1319 | * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation | ||
1320 | * with 82579 PHY | ||
1321 | * @hw: pointer to the HW structure | ||
1322 | * @enable: flag to enable/disable workaround when enabling/disabling jumbos | ||
1323 | **/ | ||
1324 | s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | ||
1325 | { | ||
1326 | s32 ret_val = 0; | ||
1327 | u16 phy_reg, data; | ||
1328 | u32 mac_reg; | ||
1329 | u16 i; | ||
1330 | |||
1331 | if (hw->mac.type != e1000_pch2lan) | ||
1332 | goto out; | ||
1333 | |||
1334 | /* disable Rx path while enabling/disabling workaround */ | ||
1335 | e1e_rphy(hw, PHY_REG(769, 20), &phy_reg); | ||
1336 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), phy_reg | (1 << 14)); | ||
1337 | if (ret_val) | ||
1338 | goto out; | ||
1339 | |||
1340 | if (enable) { | ||
1341 | /* | ||
1342 | * Write Rx addresses (rar_entry_count for RAL/H, +4 for | ||
1343 | * SHRAL/H) and initial CRC values to the MAC | ||
1344 | */ | ||
1345 | for (i = 0; i < (hw->mac.rar_entry_count + 4); i++) { | ||
1346 | u8 mac_addr[ETH_ALEN] = {0}; | ||
1347 | u32 addr_high, addr_low; | ||
1348 | |||
1349 | addr_high = er32(RAH(i)); | ||
1350 | if (!(addr_high & E1000_RAH_AV)) | ||
1351 | continue; | ||
1352 | addr_low = er32(RAL(i)); | ||
1353 | mac_addr[0] = (addr_low & 0xFF); | ||
1354 | mac_addr[1] = ((addr_low >> 8) & 0xFF); | ||
1355 | mac_addr[2] = ((addr_low >> 16) & 0xFF); | ||
1356 | mac_addr[3] = ((addr_low >> 24) & 0xFF); | ||
1357 | mac_addr[4] = (addr_high & 0xFF); | ||
1358 | mac_addr[5] = ((addr_high >> 8) & 0xFF); | ||
1359 | |||
1360 | ew32(PCH_RAICC(i), | ||
1361 | e1000_calc_rx_da_crc(mac_addr)); | ||
1362 | } | ||
1363 | |||
1364 | /* Write Rx addresses to the PHY */ | ||
1365 | e1000_copy_rx_addrs_to_phy_ich8lan(hw); | ||
1366 | |||
1367 | /* Enable jumbo frame workaround in the MAC */ | ||
1368 | mac_reg = er32(FFLT_DBG); | ||
1369 | mac_reg &= ~(1 << 14); | ||
1370 | mac_reg |= (7 << 15); | ||
1371 | ew32(FFLT_DBG, mac_reg); | ||
1372 | |||
1373 | mac_reg = er32(RCTL); | ||
1374 | mac_reg |= E1000_RCTL_SECRC; | ||
1375 | ew32(RCTL, mac_reg); | ||
1376 | |||
1377 | ret_val = e1000e_read_kmrn_reg(hw, | ||
1378 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | ||
1379 | &data); | ||
1380 | if (ret_val) | ||
1381 | goto out; | ||
1382 | ret_val = e1000e_write_kmrn_reg(hw, | ||
1383 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | ||
1384 | data | (1 << 0)); | ||
1385 | if (ret_val) | ||
1386 | goto out; | ||
1387 | ret_val = e1000e_read_kmrn_reg(hw, | ||
1388 | E1000_KMRNCTRLSTA_HD_CTRL, | ||
1389 | &data); | ||
1390 | if (ret_val) | ||
1391 | goto out; | ||
1392 | data &= ~(0xF << 8); | ||
1393 | data |= (0xB << 8); | ||
1394 | ret_val = e1000e_write_kmrn_reg(hw, | ||
1395 | E1000_KMRNCTRLSTA_HD_CTRL, | ||
1396 | data); | ||
1397 | if (ret_val) | ||
1398 | goto out; | ||
1399 | |||
1400 | /* Enable jumbo frame workaround in the PHY */ | ||
1401 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
1402 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
1403 | if (ret_val) | ||
1404 | goto out; | ||
1405 | e1e_rphy(hw, PHY_REG(769, 23), &data); | ||
1406 | data &= ~(0x7F << 5); | ||
1407 | data |= (0x37 << 5); | ||
1408 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); | ||
1409 | if (ret_val) | ||
1410 | goto out; | ||
1411 | e1e_rphy(hw, PHY_REG(769, 16), &data); | ||
1412 | data &= ~(1 << 13); | ||
1413 | data |= (1 << 12); | ||
1414 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | ||
1415 | if (ret_val) | ||
1416 | goto out; | ||
1417 | e1e_rphy(hw, PHY_REG(776, 20), &data); | ||
1418 | data &= ~(0x3FF << 2); | ||
1419 | data |= (0x1A << 2); | ||
1420 | ret_val = e1e_wphy(hw, PHY_REG(776, 20), data); | ||
1421 | if (ret_val) | ||
1422 | goto out; | ||
1423 | ret_val = e1e_wphy(hw, PHY_REG(776, 23), 0xFE00); | ||
1424 | if (ret_val) | ||
1425 | goto out; | ||
1426 | e1e_rphy(hw, HV_PM_CTRL, &data); | ||
1427 | ret_val = e1e_wphy(hw, HV_PM_CTRL, data | (1 << 10)); | ||
1428 | if (ret_val) | ||
1429 | goto out; | ||
1430 | } else { | ||
1431 | /* Write MAC register values back to h/w defaults */ | ||
1432 | mac_reg = er32(FFLT_DBG); | ||
1433 | mac_reg &= ~(0xF << 14); | ||
1434 | ew32(FFLT_DBG, mac_reg); | ||
1435 | |||
1436 | mac_reg = er32(RCTL); | ||
1437 | mac_reg &= ~E1000_RCTL_SECRC; | ||
1438 | ew32(FFLT_DBG, mac_reg); | ||
1439 | |||
1440 | ret_val = e1000e_read_kmrn_reg(hw, | ||
1441 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | ||
1442 | &data); | ||
1443 | if (ret_val) | ||
1444 | goto out; | ||
1445 | ret_val = e1000e_write_kmrn_reg(hw, | ||
1446 | E1000_KMRNCTRLSTA_CTRL_OFFSET, | ||
1447 | data & ~(1 << 0)); | ||
1448 | if (ret_val) | ||
1449 | goto out; | ||
1450 | ret_val = e1000e_read_kmrn_reg(hw, | ||
1451 | E1000_KMRNCTRLSTA_HD_CTRL, | ||
1452 | &data); | ||
1453 | if (ret_val) | ||
1454 | goto out; | ||
1455 | data &= ~(0xF << 8); | ||
1456 | data |= (0xB << 8); | ||
1457 | ret_val = e1000e_write_kmrn_reg(hw, | ||
1458 | E1000_KMRNCTRLSTA_HD_CTRL, | ||
1459 | data); | ||
1460 | if (ret_val) | ||
1461 | goto out; | ||
1462 | |||
1463 | /* Write PHY register values back to h/w defaults */ | ||
1464 | e1e_rphy(hw, PHY_REG(769, 20), &data); | ||
1465 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), data & ~(1 << 14)); | ||
1466 | if (ret_val) | ||
1467 | goto out; | ||
1468 | e1e_rphy(hw, PHY_REG(769, 23), &data); | ||
1469 | data &= ~(0x7F << 5); | ||
1470 | ret_val = e1e_wphy(hw, PHY_REG(769, 23), data); | ||
1471 | if (ret_val) | ||
1472 | goto out; | ||
1473 | e1e_rphy(hw, PHY_REG(769, 16), &data); | ||
1474 | data &= ~(1 << 12); | ||
1475 | data |= (1 << 13); | ||
1476 | ret_val = e1e_wphy(hw, PHY_REG(769, 16), data); | ||
1477 | if (ret_val) | ||
1478 | goto out; | ||
1479 | e1e_rphy(hw, PHY_REG(776, 20), &data); | ||
1480 | data &= ~(0x3FF << 2); | ||
1481 | data |= (0x8 << 2); | ||
1482 | ret_val = e1e_wphy(hw, PHY_REG(776, 20), data); | ||
1483 | if (ret_val) | ||
1484 | goto out; | ||
1485 | ret_val = e1e_wphy(hw, PHY_REG(776, 23), 0x7E00); | ||
1486 | if (ret_val) | ||
1487 | goto out; | ||
1488 | e1e_rphy(hw, HV_PM_CTRL, &data); | ||
1489 | ret_val = e1e_wphy(hw, HV_PM_CTRL, data & ~(1 << 10)); | ||
1490 | if (ret_val) | ||
1491 | goto out; | ||
1492 | } | ||
1493 | |||
1494 | /* re-enable Rx path after enabling/disabling workaround */ | ||
1495 | ret_val = e1e_wphy(hw, PHY_REG(769, 20), phy_reg & ~(1 << 14)); | ||
1496 | |||
1497 | out: | ||
1498 | return ret_val; | ||
1499 | } | ||
1500 | |||
1501 | /** | ||
1502 | * e1000_lv_phy_workarounds_ich8lan - A series of Phy workarounds to be | ||
1503 | * done after every PHY reset. | ||
1504 | **/ | ||
1505 | static s32 e1000_lv_phy_workarounds_ich8lan(struct e1000_hw *hw) | ||
1506 | { | ||
1507 | s32 ret_val = 0; | ||
1508 | |||
1509 | if (hw->mac.type != e1000_pch2lan) | ||
1510 | goto out; | ||
1511 | |||
1512 | /* Set MDIO slow mode before any other MDIO access */ | ||
1513 | ret_val = e1000_set_mdio_slow_mode_hv(hw); | ||
1514 | |||
1515 | out: | ||
1516 | return ret_val; | ||
1517 | } | ||
1518 | |||
1519 | /** | ||
1253 | * e1000_lan_init_done_ich8lan - Check for PHY config completion | 1520 | * e1000_lan_init_done_ich8lan - Check for PHY config completion |
1254 | * @hw: pointer to the HW structure | 1521 | * @hw: pointer to the HW structure |
1255 | * | 1522 | * |
@@ -1300,12 +1567,17 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) | |||
1300 | if (ret_val) | 1567 | if (ret_val) |
1301 | goto out; | 1568 | goto out; |
1302 | break; | 1569 | break; |
1570 | case e1000_pch2lan: | ||
1571 | ret_val = e1000_lv_phy_workarounds_ich8lan(hw); | ||
1572 | if (ret_val) | ||
1573 | goto out; | ||
1574 | break; | ||
1303 | default: | 1575 | default: |
1304 | break; | 1576 | break; |
1305 | } | 1577 | } |
1306 | 1578 | ||
1307 | /* Dummy read to clear the phy wakeup bit after lcd reset */ | 1579 | /* Dummy read to clear the phy wakeup bit after lcd reset */ |
1308 | if (hw->mac.type == e1000_pchlan) | 1580 | if (hw->mac.type >= e1000_pchlan) |
1309 | e1e_rphy(hw, BM_WUC, ®); | 1581 | e1e_rphy(hw, BM_WUC, ®); |
1310 | 1582 | ||
1311 | /* Configure the LCD with the extended configuration region in NVM */ | 1583 | /* Configure the LCD with the extended configuration region in NVM */ |
@@ -2829,6 +3101,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw) | |||
2829 | 3101 | ||
2830 | ew32(FCTTV, hw->fc.pause_time); | 3102 | ew32(FCTTV, hw->fc.pause_time); |
2831 | if ((hw->phy.type == e1000_phy_82578) || | 3103 | if ((hw->phy.type == e1000_phy_82578) || |
3104 | (hw->phy.type == e1000_phy_82579) || | ||
2832 | (hw->phy.type == e1000_phy_82577)) { | 3105 | (hw->phy.type == e1000_phy_82577)) { |
2833 | ew32(FCRTV_PCH, hw->fc.refresh_time); | 3106 | ew32(FCRTV_PCH, hw->fc.refresh_time); |
2834 | 3107 | ||
@@ -2892,6 +3165,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw) | |||
2892 | return ret_val; | 3165 | return ret_val; |
2893 | break; | 3166 | break; |
2894 | case e1000_phy_82577: | 3167 | case e1000_phy_82577: |
3168 | case e1000_phy_82579: | ||
2895 | ret_val = e1000_copper_link_setup_82577(hw); | 3169 | ret_val = e1000_copper_link_setup_82577(hw); |
2896 | if (ret_val) | 3170 | if (ret_val) |
2897 | return ret_val; | 3171 | return ret_val; |
@@ -3399,6 +3673,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | |||
3399 | 3673 | ||
3400 | /* Clear PHY statistics registers */ | 3674 | /* Clear PHY statistics registers */ |
3401 | if ((hw->phy.type == e1000_phy_82578) || | 3675 | if ((hw->phy.type == e1000_phy_82578) || |
3676 | (hw->phy.type == e1000_phy_82579) || | ||
3402 | (hw->phy.type == e1000_phy_82577)) { | 3677 | (hw->phy.type == e1000_phy_82577)) { |
3403 | hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data); | 3678 | hw->phy.ops.read_reg(hw, HV_SCC_UPPER, &phy_data); |
3404 | hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data); | 3679 | hw->phy.ops.read_reg(hw, HV_SCC_LOWER, &phy_data); |
@@ -3534,3 +3809,22 @@ struct e1000_info e1000_pch_info = { | |||
3534 | .phy_ops = &ich8_phy_ops, | 3809 | .phy_ops = &ich8_phy_ops, |
3535 | .nvm_ops = &ich8_nvm_ops, | 3810 | .nvm_ops = &ich8_nvm_ops, |
3536 | }; | 3811 | }; |
3812 | |||
3813 | struct e1000_info e1000_pch2_info = { | ||
3814 | .mac = e1000_pch2lan, | ||
3815 | .flags = FLAG_IS_ICH | ||
3816 | | FLAG_HAS_WOL | ||
3817 | | FLAG_RX_CSUM_ENABLED | ||
3818 | | FLAG_HAS_CTRLEXT_ON_LOAD | ||
3819 | | FLAG_HAS_AMT | ||
3820 | | FLAG_HAS_FLASH | ||
3821 | | FLAG_HAS_JUMBO_FRAMES | ||
3822 | | FLAG_APME_IN_WUC, | ||
3823 | .flags2 = FLAG2_HAS_PHY_STATS, | ||
3824 | .pba = 18, | ||
3825 | .max_hw_frame_size = DEFAULT_JUMBO, | ||
3826 | .get_variants = e1000_get_variants_ich8lan, | ||
3827 | .mac_ops = &ich8_mac_ops, | ||
3828 | .phy_ops = &ich8_phy_ops, | ||
3829 | .nvm_ops = &ich8_nvm_ops, | ||
3830 | }; | ||