diff options
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 734 |
1 files changed, 708 insertions, 26 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index beeec0fbbeac..523c2c9fc0ac 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -100,6 +100,8 @@ static void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset, | |||
100 | 100 | ||
101 | #define E1000_WRITE_REG_IO(a, reg, val) \ | 101 | #define E1000_WRITE_REG_IO(a, reg, val) \ |
102 | e1000_write_reg_io((a), E1000_##reg, val) | 102 | e1000_write_reg_io((a), E1000_##reg, val) |
103 | static int32_t e1000_configure_kmrn_for_10_100(struct e1000_hw *hw); | ||
104 | static int32_t e1000_configure_kmrn_for_1000(struct e1000_hw *hw); | ||
103 | 105 | ||
104 | /* IGP cable length table */ | 106 | /* IGP cable length table */ |
105 | static const | 107 | static const |
@@ -153,6 +155,11 @@ e1000_set_phy_type(struct e1000_hw *hw) | |||
153 | hw->phy_type = e1000_phy_igp; | 155 | hw->phy_type = e1000_phy_igp; |
154 | break; | 156 | break; |
155 | } | 157 | } |
158 | case GG82563_E_PHY_ID: | ||
159 | if (hw->mac_type == e1000_80003es2lan) { | ||
160 | hw->phy_type = e1000_phy_gg82563; | ||
161 | break; | ||
162 | } | ||
156 | /* Fall Through */ | 163 | /* Fall Through */ |
157 | default: | 164 | default: |
158 | /* Should never have loaded on this device */ | 165 | /* Should never have loaded on this device */ |
@@ -353,12 +360,19 @@ e1000_set_mac_type(struct e1000_hw *hw) | |||
353 | case E1000_DEV_ID_82573L: | 360 | case E1000_DEV_ID_82573L: |
354 | hw->mac_type = e1000_82573; | 361 | hw->mac_type = e1000_82573; |
355 | break; | 362 | break; |
363 | case E1000_DEV_ID_80003ES2LAN_COPPER_DPT: | ||
364 | case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: | ||
365 | hw->mac_type = e1000_80003es2lan; | ||
366 | break; | ||
356 | default: | 367 | default: |
357 | /* Should never have loaded on this device */ | 368 | /* Should never have loaded on this device */ |
358 | return -E1000_ERR_MAC_TYPE; | 369 | return -E1000_ERR_MAC_TYPE; |
359 | } | 370 | } |
360 | 371 | ||
361 | switch(hw->mac_type) { | 372 | switch(hw->mac_type) { |
373 | case e1000_80003es2lan: | ||
374 | hw->swfw_sync_present = TRUE; | ||
375 | /* fall through */ | ||
362 | case e1000_82571: | 376 | case e1000_82571: |
363 | case e1000_82572: | 377 | case e1000_82572: |
364 | case e1000_82573: | 378 | case e1000_82573: |
@@ -399,6 +413,7 @@ e1000_set_media_type(struct e1000_hw *hw) | |||
399 | case E1000_DEV_ID_82546GB_SERDES: | 413 | case E1000_DEV_ID_82546GB_SERDES: |
400 | case E1000_DEV_ID_82571EB_SERDES: | 414 | case E1000_DEV_ID_82571EB_SERDES: |
401 | case E1000_DEV_ID_82572EI_SERDES: | 415 | case E1000_DEV_ID_82572EI_SERDES: |
416 | case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: | ||
402 | hw->media_type = e1000_media_type_internal_serdes; | 417 | hw->media_type = e1000_media_type_internal_serdes; |
403 | break; | 418 | break; |
404 | default: | 419 | default: |
@@ -575,6 +590,7 @@ e1000_reset_hw(struct e1000_hw *hw) | |||
575 | /* fall through */ | 590 | /* fall through */ |
576 | case e1000_82571: | 591 | case e1000_82571: |
577 | case e1000_82572: | 592 | case e1000_82572: |
593 | case e1000_80003es2lan: | ||
578 | ret_val = e1000_get_auto_rd_done(hw); | 594 | ret_val = e1000_get_auto_rd_done(hw); |
579 | if(ret_val) | 595 | if(ret_val) |
580 | /* We don't want to continue accessing MAC registers. */ | 596 | /* We don't want to continue accessing MAC registers. */ |
@@ -641,6 +657,7 @@ e1000_init_hw(struct e1000_hw *hw) | |||
641 | uint16_t cmd_mmrbc; | 657 | uint16_t cmd_mmrbc; |
642 | uint16_t stat_mmrbc; | 658 | uint16_t stat_mmrbc; |
643 | uint32_t mta_size; | 659 | uint32_t mta_size; |
660 | uint32_t reg_data; | ||
644 | uint32_t ctrl_ext; | 661 | uint32_t ctrl_ext; |
645 | 662 | ||
646 | DEBUGFUNC("e1000_init_hw"); | 663 | DEBUGFUNC("e1000_init_hw"); |
@@ -739,6 +756,7 @@ e1000_init_hw(struct e1000_hw *hw) | |||
739 | case e1000_82571: | 756 | case e1000_82571: |
740 | case e1000_82572: | 757 | case e1000_82572: |
741 | case e1000_82573: | 758 | case e1000_82573: |
759 | case e1000_80003es2lan: | ||
742 | ctrl |= E1000_TXDCTL_COUNT_DESC; | 760 | ctrl |= E1000_TXDCTL_COUNT_DESC; |
743 | break; | 761 | break; |
744 | } | 762 | } |
@@ -752,12 +770,34 @@ e1000_init_hw(struct e1000_hw *hw) | |||
752 | switch (hw->mac_type) { | 770 | switch (hw->mac_type) { |
753 | default: | 771 | default: |
754 | break; | 772 | break; |
773 | case e1000_80003es2lan: | ||
774 | /* Enable retransmit on late collisions */ | ||
775 | reg_data = E1000_READ_REG(hw, TCTL); | ||
776 | reg_data |= E1000_TCTL_RTLC; | ||
777 | E1000_WRITE_REG(hw, TCTL, reg_data); | ||
778 | |||
779 | /* Configure Gigabit Carry Extend Padding */ | ||
780 | reg_data = E1000_READ_REG(hw, TCTL_EXT); | ||
781 | reg_data &= ~E1000_TCTL_EXT_GCEX_MASK; | ||
782 | reg_data |= DEFAULT_80003ES2LAN_TCTL_EXT_GCEX; | ||
783 | E1000_WRITE_REG(hw, TCTL_EXT, reg_data); | ||
784 | |||
785 | /* Configure Transmit Inter-Packet Gap */ | ||
786 | reg_data = E1000_READ_REG(hw, TIPG); | ||
787 | reg_data &= ~E1000_TIPG_IPGT_MASK; | ||
788 | reg_data |= DEFAULT_80003ES2LAN_TIPG_IPGT_1000; | ||
789 | E1000_WRITE_REG(hw, TIPG, reg_data); | ||
790 | |||
791 | reg_data = E1000_READ_REG_ARRAY(hw, FFLT, 0x0001); | ||
792 | reg_data &= ~0x00100000; | ||
793 | E1000_WRITE_REG_ARRAY(hw, FFLT, 0x0001, reg_data); | ||
794 | /* Fall through */ | ||
755 | case e1000_82571: | 795 | case e1000_82571: |
756 | case e1000_82572: | 796 | case e1000_82572: |
757 | ctrl = E1000_READ_REG(hw, TXDCTL1); | 797 | ctrl = E1000_READ_REG(hw, TXDCTL1); |
758 | ctrl &= ~E1000_TXDCTL_WTHRESH; | 798 | ctrl = (ctrl & ~E1000_TXDCTL_WTHRESH) | E1000_TXDCTL_FULL_TX_DESC_WB; |
759 | ctrl |= E1000_TXDCTL_COUNT_DESC | E1000_TXDCTL_FULL_TX_DESC_WB; | 799 | if(hw->mac_type >= e1000_82571) |
760 | ctrl |= (1 << 22); | 800 | ctrl |= E1000_TXDCTL_COUNT_DESC; |
761 | E1000_WRITE_REG(hw, TXDCTL1, ctrl); | 801 | E1000_WRITE_REG(hw, TXDCTL1, ctrl); |
762 | break; | 802 | break; |
763 | } | 803 | } |
@@ -906,7 +946,13 @@ e1000_setup_link(struct e1000_hw *hw) | |||
906 | * signal detection. So this should be done before e1000_setup_pcs_link() | 946 | * signal detection. So this should be done before e1000_setup_pcs_link() |
907 | * or e1000_phy_setup() is called. | 947 | * or e1000_phy_setup() is called. |
908 | */ | 948 | */ |
909 | if(hw->mac_type == e1000_82543) { | 949 | if (hw->mac_type == e1000_82543) { |
950 | ret_val = e1000_read_eeprom(hw, EEPROM_INIT_CONTROL2_REG, | ||
951 | 1, &eeprom_data); | ||
952 | if (ret_val) { | ||
953 | DEBUGOUT("EEPROM Read Error\n"); | ||
954 | return -E1000_ERR_EEPROM; | ||
955 | } | ||
910 | ctrl_ext = ((eeprom_data & EEPROM_WORD0F_SWPDIO_EXT) << | 956 | ctrl_ext = ((eeprom_data & EEPROM_WORD0F_SWPDIO_EXT) << |
911 | SWDPIO__EXT_SHIFT); | 957 | SWDPIO__EXT_SHIFT); |
912 | E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); | 958 | E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); |
@@ -1308,6 +1354,154 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw) | |||
1308 | return E1000_SUCCESS; | 1354 | return E1000_SUCCESS; |
1309 | } | 1355 | } |
1310 | 1356 | ||
1357 | /******************************************************************** | ||
1358 | * Copper link setup for e1000_phy_gg82563 series. | ||
1359 | * | ||
1360 | * hw - Struct containing variables accessed by shared code | ||
1361 | *********************************************************************/ | ||
1362 | static int32_t | ||
1363 | e1000_copper_link_ggp_setup(struct e1000_hw *hw) | ||
1364 | { | ||
1365 | int32_t ret_val; | ||
1366 | uint16_t phy_data; | ||
1367 | uint32_t reg_data; | ||
1368 | |||
1369 | DEBUGFUNC("e1000_copper_link_ggp_setup"); | ||
1370 | |||
1371 | if(!hw->phy_reset_disable) { | ||
1372 | |||
1373 | /* Enable CRS on TX for half-duplex operation. */ | ||
1374 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, | ||
1375 | &phy_data); | ||
1376 | if(ret_val) | ||
1377 | return ret_val; | ||
1378 | |||
1379 | phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; | ||
1380 | /* Use 25MHz for both link down and 1000BASE-T for Tx clock */ | ||
1381 | phy_data |= GG82563_MSCR_TX_CLK_1000MBPS_25MHZ; | ||
1382 | |||
1383 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, | ||
1384 | phy_data); | ||
1385 | if(ret_val) | ||
1386 | return ret_val; | ||
1387 | |||
1388 | /* Options: | ||
1389 | * MDI/MDI-X = 0 (default) | ||
1390 | * 0 - Auto for all speeds | ||
1391 | * 1 - MDI mode | ||
1392 | * 2 - MDI-X mode | ||
1393 | * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) | ||
1394 | */ | ||
1395 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_SPEC_CTRL, &phy_data); | ||
1396 | if(ret_val) | ||
1397 | return ret_val; | ||
1398 | |||
1399 | phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK; | ||
1400 | |||
1401 | switch (hw->mdix) { | ||
1402 | case 1: | ||
1403 | phy_data |= GG82563_PSCR_CROSSOVER_MODE_MDI; | ||
1404 | break; | ||
1405 | case 2: | ||
1406 | phy_data |= GG82563_PSCR_CROSSOVER_MODE_MDIX; | ||
1407 | break; | ||
1408 | case 0: | ||
1409 | default: | ||
1410 | phy_data |= GG82563_PSCR_CROSSOVER_MODE_AUTO; | ||
1411 | break; | ||
1412 | } | ||
1413 | |||
1414 | /* Options: | ||
1415 | * disable_polarity_correction = 0 (default) | ||
1416 | * Automatic Correction for Reversed Cable Polarity | ||
1417 | * 0 - Disabled | ||
1418 | * 1 - Enabled | ||
1419 | */ | ||
1420 | phy_data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE; | ||
1421 | if(hw->disable_polarity_correction == 1) | ||
1422 | phy_data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE; | ||
1423 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_SPEC_CTRL, phy_data); | ||
1424 | |||
1425 | if(ret_val) | ||
1426 | return ret_val; | ||
1427 | |||
1428 | /* SW Reset the PHY so all changes take effect */ | ||
1429 | ret_val = e1000_phy_reset(hw); | ||
1430 | if (ret_val) { | ||
1431 | DEBUGOUT("Error Resetting the PHY\n"); | ||
1432 | return ret_val; | ||
1433 | } | ||
1434 | } /* phy_reset_disable */ | ||
1435 | |||
1436 | if (hw->mac_type == e1000_80003es2lan) { | ||
1437 | /* Bypass RX and TX FIFO's */ | ||
1438 | ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_FIFO_CTRL, | ||
1439 | E1000_KUMCTRLSTA_FIFO_CTRL_RX_BYPASS | | ||
1440 | E1000_KUMCTRLSTA_FIFO_CTRL_TX_BYPASS); | ||
1441 | if (ret_val) | ||
1442 | return ret_val; | ||
1443 | |||
1444 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_SPEC_CTRL_2, &phy_data); | ||
1445 | if (ret_val) | ||
1446 | return ret_val; | ||
1447 | |||
1448 | phy_data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG; | ||
1449 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_SPEC_CTRL_2, phy_data); | ||
1450 | |||
1451 | if (ret_val) | ||
1452 | return ret_val; | ||
1453 | |||
1454 | reg_data = E1000_READ_REG(hw, CTRL_EXT); | ||
1455 | reg_data &= ~(E1000_CTRL_EXT_LINK_MODE_MASK); | ||
1456 | E1000_WRITE_REG(hw, CTRL_EXT, reg_data); | ||
1457 | |||
1458 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, | ||
1459 | &phy_data); | ||
1460 | if (ret_val) | ||
1461 | return ret_val; | ||
1462 | |||
1463 | /* Do not init these registers when the HW is in IAMT mode, since the | ||
1464 | * firmware will have already initialized them. We only initialize | ||
1465 | * them if the HW is not in IAMT mode. | ||
1466 | */ | ||
1467 | if (e1000_check_mng_mode(hw) == FALSE) { | ||
1468 | /* Enable Electrical Idle on the PHY */ | ||
1469 | phy_data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE; | ||
1470 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, | ||
1471 | phy_data); | ||
1472 | if (ret_val) | ||
1473 | return ret_val; | ||
1474 | |||
1475 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, | ||
1476 | &phy_data); | ||
1477 | if (ret_val) | ||
1478 | return ret_val; | ||
1479 | |||
1480 | /* Enable Pass False Carrier on the PHY */ | ||
1481 | phy_data |= GG82563_KMCR_PASS_FALSE_CARRIER; | ||
1482 | |||
1483 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, | ||
1484 | phy_data); | ||
1485 | if (ret_val) | ||
1486 | return ret_val; | ||
1487 | } | ||
1488 | |||
1489 | /* Workaround: Disable padding in Kumeran interface in the MAC | ||
1490 | * and in the PHY to avoid CRC errors. | ||
1491 | */ | ||
1492 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_INBAND_CTRL, | ||
1493 | &phy_data); | ||
1494 | if (ret_val) | ||
1495 | return ret_val; | ||
1496 | phy_data |= GG82563_ICR_DIS_PADDING; | ||
1497 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_INBAND_CTRL, | ||
1498 | phy_data); | ||
1499 | if (ret_val) | ||
1500 | return ret_val; | ||
1501 | } | ||
1502 | |||
1503 | return E1000_SUCCESS; | ||
1504 | } | ||
1311 | 1505 | ||
1312 | /******************************************************************** | 1506 | /******************************************************************** |
1313 | * Copper link setup for e1000_phy_m88 series. | 1507 | * Copper link setup for e1000_phy_m88 series. |
@@ -1518,6 +1712,7 @@ e1000_setup_copper_link(struct e1000_hw *hw) | |||
1518 | int32_t ret_val; | 1712 | int32_t ret_val; |
1519 | uint16_t i; | 1713 | uint16_t i; |
1520 | uint16_t phy_data; | 1714 | uint16_t phy_data; |
1715 | uint16_t reg_data; | ||
1521 | 1716 | ||
1522 | DEBUGFUNC("e1000_setup_copper_link"); | 1717 | DEBUGFUNC("e1000_setup_copper_link"); |
1523 | 1718 | ||
@@ -1526,6 +1721,22 @@ e1000_setup_copper_link(struct e1000_hw *hw) | |||
1526 | if(ret_val) | 1721 | if(ret_val) |
1527 | return ret_val; | 1722 | return ret_val; |
1528 | 1723 | ||
1724 | switch (hw->mac_type) { | ||
1725 | case e1000_80003es2lan: | ||
1726 | ret_val = e1000_read_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL, | ||
1727 | ®_data); | ||
1728 | if (ret_val) | ||
1729 | return ret_val; | ||
1730 | reg_data |= E1000_KUMCTRLSTA_INB_CTRL_DIS_PADDING; | ||
1731 | ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_INB_CTRL, | ||
1732 | reg_data); | ||
1733 | if (ret_val) | ||
1734 | return ret_val; | ||
1735 | break; | ||
1736 | default: | ||
1737 | break; | ||
1738 | } | ||
1739 | |||
1529 | if (hw->phy_type == e1000_phy_igp || | 1740 | if (hw->phy_type == e1000_phy_igp || |
1530 | hw->phy_type == e1000_phy_igp_2) { | 1741 | hw->phy_type == e1000_phy_igp_2) { |
1531 | ret_val = e1000_copper_link_igp_setup(hw); | 1742 | ret_val = e1000_copper_link_igp_setup(hw); |
@@ -1535,6 +1746,10 @@ e1000_setup_copper_link(struct e1000_hw *hw) | |||
1535 | ret_val = e1000_copper_link_mgp_setup(hw); | 1746 | ret_val = e1000_copper_link_mgp_setup(hw); |
1536 | if(ret_val) | 1747 | if(ret_val) |
1537 | return ret_val; | 1748 | return ret_val; |
1749 | } else if (hw->phy_type == e1000_phy_gg82563) { | ||
1750 | ret_val = e1000_copper_link_ggp_setup(hw); | ||
1751 | if(ret_val) | ||
1752 | return ret_val; | ||
1538 | } | 1753 | } |
1539 | 1754 | ||
1540 | if(hw->autoneg) { | 1755 | if(hw->autoneg) { |
@@ -1582,6 +1797,59 @@ e1000_setup_copper_link(struct e1000_hw *hw) | |||
1582 | } | 1797 | } |
1583 | 1798 | ||
1584 | /****************************************************************************** | 1799 | /****************************************************************************** |
1800 | * Configure the MAC-to-PHY interface for 10/100Mbps | ||
1801 | * | ||
1802 | * hw - Struct containing variables accessed by shared code | ||
1803 | ******************************************************************************/ | ||
1804 | static int32_t | ||
1805 | e1000_configure_kmrn_for_10_100(struct e1000_hw *hw) | ||
1806 | { | ||
1807 | int32_t ret_val = E1000_SUCCESS; | ||
1808 | uint32_t tipg; | ||
1809 | uint16_t reg_data; | ||
1810 | |||
1811 | DEBUGFUNC("e1000_configure_kmrn_for_10_100"); | ||
1812 | |||
1813 | reg_data = E1000_KUMCTRLSTA_HD_CTRL_10_100_DEFAULT; | ||
1814 | ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_HD_CTRL, | ||
1815 | reg_data); | ||
1816 | if (ret_val) | ||
1817 | return ret_val; | ||
1818 | |||
1819 | /* Configure Transmit Inter-Packet Gap */ | ||
1820 | tipg = E1000_READ_REG(hw, TIPG); | ||
1821 | tipg &= ~E1000_TIPG_IPGT_MASK; | ||
1822 | tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_10_100; | ||
1823 | E1000_WRITE_REG(hw, TIPG, tipg); | ||
1824 | |||
1825 | return ret_val; | ||
1826 | } | ||
1827 | |||
1828 | static int32_t | ||
1829 | e1000_configure_kmrn_for_1000(struct e1000_hw *hw) | ||
1830 | { | ||
1831 | int32_t ret_val = E1000_SUCCESS; | ||
1832 | uint16_t reg_data; | ||
1833 | uint32_t tipg; | ||
1834 | |||
1835 | DEBUGFUNC("e1000_configure_kmrn_for_1000"); | ||
1836 | |||
1837 | reg_data = E1000_KUMCTRLSTA_HD_CTRL_1000_DEFAULT; | ||
1838 | ret_val = e1000_write_kmrn_reg(hw, E1000_KUMCTRLSTA_OFFSET_HD_CTRL, | ||
1839 | reg_data); | ||
1840 | if (ret_val) | ||
1841 | return ret_val; | ||
1842 | |||
1843 | /* Configure Transmit Inter-Packet Gap */ | ||
1844 | tipg = E1000_READ_REG(hw, TIPG); | ||
1845 | tipg &= ~E1000_TIPG_IPGT_MASK; | ||
1846 | tipg |= DEFAULT_80003ES2LAN_TIPG_IPGT_1000; | ||
1847 | E1000_WRITE_REG(hw, TIPG, tipg); | ||
1848 | |||
1849 | return ret_val; | ||
1850 | } | ||
1851 | |||
1852 | /****************************************************************************** | ||
1585 | * Configures PHY autoneg and flow control advertisement settings | 1853 | * Configures PHY autoneg and flow control advertisement settings |
1586 | * | 1854 | * |
1587 | * hw - Struct containing variables accessed by shared code | 1855 | * hw - Struct containing variables accessed by shared code |
@@ -1802,7 +2070,8 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
1802 | /* Write the configured values back to the Device Control Reg. */ | 2070 | /* Write the configured values back to the Device Control Reg. */ |
1803 | E1000_WRITE_REG(hw, CTRL, ctrl); | 2071 | E1000_WRITE_REG(hw, CTRL, ctrl); |
1804 | 2072 | ||
1805 | if (hw->phy_type == e1000_phy_m88) { | 2073 | if ((hw->phy_type == e1000_phy_m88) || |
2074 | (hw->phy_type == e1000_phy_gg82563)) { | ||
1806 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); | 2075 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); |
1807 | if(ret_val) | 2076 | if(ret_val) |
1808 | return ret_val; | 2077 | return ret_val; |
@@ -1871,7 +2140,8 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
1871 | msec_delay(100); | 2140 | msec_delay(100); |
1872 | } | 2141 | } |
1873 | if((i == 0) && | 2142 | if((i == 0) && |
1874 | (hw->phy_type == e1000_phy_m88)) { | 2143 | ((hw->phy_type == e1000_phy_m88) || |
2144 | (hw->phy_type == e1000_phy_gg82563))) { | ||
1875 | /* We didn't get link. Reset the DSP and wait again for link. */ | 2145 | /* We didn't get link. Reset the DSP and wait again for link. */ |
1876 | ret_val = e1000_phy_reset_dsp(hw); | 2146 | ret_val = e1000_phy_reset_dsp(hw); |
1877 | if(ret_val) { | 2147 | if(ret_val) { |
@@ -1930,6 +2200,27 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
1930 | if(ret_val) | 2200 | if(ret_val) |
1931 | return ret_val; | 2201 | return ret_val; |
1932 | } | 2202 | } |
2203 | } else if (hw->phy_type == e1000_phy_gg82563) { | ||
2204 | /* The TX_CLK of the Extended PHY Specific Control Register defaults | ||
2205 | * to 2.5MHz on a reset. We need to re-force it back to 25MHz, if | ||
2206 | * we're not in a forced 10/duplex configuration. */ | ||
2207 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data); | ||
2208 | if (ret_val) | ||
2209 | return ret_val; | ||
2210 | |||
2211 | phy_data &= ~GG82563_MSCR_TX_CLK_MASK; | ||
2212 | if ((hw->forced_speed_duplex == e1000_10_full) || | ||
2213 | (hw->forced_speed_duplex == e1000_10_half)) | ||
2214 | phy_data |= GG82563_MSCR_TX_CLK_10MBPS_2_5MHZ; | ||
2215 | else | ||
2216 | phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25MHZ; | ||
2217 | |||
2218 | /* Also due to the reset, we need to enable CRS on Tx. */ | ||
2219 | phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; | ||
2220 | |||
2221 | ret_val = e1000_write_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data); | ||
2222 | if (ret_val) | ||
2223 | return ret_val; | ||
1933 | } | 2224 | } |
1934 | return E1000_SUCCESS; | 2225 | return E1000_SUCCESS; |
1935 | } | 2226 | } |
@@ -2592,6 +2883,16 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw, | |||
2592 | } | 2883 | } |
2593 | } | 2884 | } |
2594 | 2885 | ||
2886 | if ((hw->mac_type == e1000_80003es2lan) && | ||
2887 | (hw->media_type == e1000_media_type_copper)) { | ||
2888 | if (*speed == SPEED_1000) | ||
2889 | ret_val = e1000_configure_kmrn_for_1000(hw); | ||
2890 | else | ||
2891 | ret_val = e1000_configure_kmrn_for_10_100(hw); | ||
2892 | if (ret_val) | ||
2893 | return ret_val; | ||
2894 | } | ||
2895 | |||
2595 | return E1000_SUCCESS; | 2896 | return E1000_SUCCESS; |
2596 | } | 2897 | } |
2597 | 2898 | ||
@@ -2767,6 +3068,72 @@ e1000_shift_in_mdi_bits(struct e1000_hw *hw) | |||
2767 | return data; | 3068 | return data; |
2768 | } | 3069 | } |
2769 | 3070 | ||
3071 | int32_t | ||
3072 | e1000_swfw_sync_acquire(struct e1000_hw *hw, uint16_t mask) | ||
3073 | { | ||
3074 | uint32_t swfw_sync = 0; | ||
3075 | uint32_t swmask = mask; | ||
3076 | uint32_t fwmask = mask << 16; | ||
3077 | int32_t timeout = 200; | ||
3078 | |||
3079 | DEBUGFUNC("e1000_swfw_sync_acquire"); | ||
3080 | |||
3081 | if (!hw->swfw_sync_present) | ||
3082 | return e1000_get_hw_eeprom_semaphore(hw); | ||
3083 | |||
3084 | while(timeout) { | ||
3085 | if (e1000_get_hw_eeprom_semaphore(hw)) | ||
3086 | return -E1000_ERR_SWFW_SYNC; | ||
3087 | |||
3088 | swfw_sync = E1000_READ_REG(hw, SW_FW_SYNC); | ||
3089 | if (!(swfw_sync & (fwmask | swmask))) { | ||
3090 | break; | ||
3091 | } | ||
3092 | |||
3093 | /* firmware currently using resource (fwmask) */ | ||
3094 | /* or other software thread currently using resource (swmask) */ | ||
3095 | e1000_put_hw_eeprom_semaphore(hw); | ||
3096 | msec_delay_irq(5); | ||
3097 | timeout--; | ||
3098 | } | ||
3099 | |||
3100 | if (!timeout) { | ||
3101 | DEBUGOUT("Driver can't access resource, SW_FW_SYNC timeout.\n"); | ||
3102 | return -E1000_ERR_SWFW_SYNC; | ||
3103 | } | ||
3104 | |||
3105 | swfw_sync |= swmask; | ||
3106 | E1000_WRITE_REG(hw, SW_FW_SYNC, swfw_sync); | ||
3107 | |||
3108 | e1000_put_hw_eeprom_semaphore(hw); | ||
3109 | return E1000_SUCCESS; | ||
3110 | } | ||
3111 | |||
3112 | void | ||
3113 | e1000_swfw_sync_release(struct e1000_hw *hw, uint16_t mask) | ||
3114 | { | ||
3115 | uint32_t swfw_sync; | ||
3116 | uint32_t swmask = mask; | ||
3117 | |||
3118 | DEBUGFUNC("e1000_swfw_sync_release"); | ||
3119 | |||
3120 | if (!hw->swfw_sync_present) { | ||
3121 | e1000_put_hw_eeprom_semaphore(hw); | ||
3122 | return; | ||
3123 | } | ||
3124 | |||
3125 | /* if (e1000_get_hw_eeprom_semaphore(hw)) | ||
3126 | * return -E1000_ERR_SWFW_SYNC; */ | ||
3127 | while (e1000_get_hw_eeprom_semaphore(hw) != E1000_SUCCESS); | ||
3128 | /* empty */ | ||
3129 | |||
3130 | swfw_sync = E1000_READ_REG(hw, SW_FW_SYNC); | ||
3131 | swfw_sync &= ~swmask; | ||
3132 | E1000_WRITE_REG(hw, SW_FW_SYNC, swfw_sync); | ||
3133 | |||
3134 | e1000_put_hw_eeprom_semaphore(hw); | ||
3135 | } | ||
3136 | |||
2770 | /***************************************************************************** | 3137 | /***************************************************************************** |
2771 | * Reads the value from a PHY register, if the value is on a specific non zero | 3138 | * Reads the value from a PHY register, if the value is on a specific non zero |
2772 | * page, sets the page first. | 3139 | * page, sets the page first. |
@@ -2779,22 +3146,55 @@ e1000_read_phy_reg(struct e1000_hw *hw, | |||
2779 | uint16_t *phy_data) | 3146 | uint16_t *phy_data) |
2780 | { | 3147 | { |
2781 | uint32_t ret_val; | 3148 | uint32_t ret_val; |
3149 | uint16_t swfw; | ||
2782 | 3150 | ||
2783 | DEBUGFUNC("e1000_read_phy_reg"); | 3151 | DEBUGFUNC("e1000_read_phy_reg"); |
2784 | 3152 | ||
3153 | if ((hw->mac_type == e1000_80003es2lan) && | ||
3154 | (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) { | ||
3155 | swfw = E1000_SWFW_PHY1_SM; | ||
3156 | } else { | ||
3157 | swfw = E1000_SWFW_PHY0_SM; | ||
3158 | } | ||
3159 | if (e1000_swfw_sync_acquire(hw, swfw)) | ||
3160 | return -E1000_ERR_SWFW_SYNC; | ||
3161 | |||
2785 | if((hw->phy_type == e1000_phy_igp || | 3162 | if((hw->phy_type == e1000_phy_igp || |
2786 | hw->phy_type == e1000_phy_igp_2) && | 3163 | hw->phy_type == e1000_phy_igp_2) && |
2787 | (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { | 3164 | (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { |
2788 | ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, | 3165 | ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, |
2789 | (uint16_t)reg_addr); | 3166 | (uint16_t)reg_addr); |
2790 | if(ret_val) { | 3167 | if(ret_val) { |
3168 | e1000_swfw_sync_release(hw, swfw); | ||
2791 | return ret_val; | 3169 | return ret_val; |
2792 | } | 3170 | } |
3171 | } else if (hw->phy_type == e1000_phy_gg82563) { | ||
3172 | if (((reg_addr & MAX_PHY_REG_ADDRESS) > MAX_PHY_MULTI_PAGE_REG) || | ||
3173 | (hw->mac_type == e1000_80003es2lan)) { | ||
3174 | /* Select Configuration Page */ | ||
3175 | if ((reg_addr & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { | ||
3176 | ret_val = e1000_write_phy_reg_ex(hw, GG82563_PHY_PAGE_SELECT, | ||
3177 | (uint16_t)((uint16_t)reg_addr >> GG82563_PAGE_SHIFT)); | ||
3178 | } else { | ||
3179 | /* Use Alternative Page Select register to access | ||
3180 | * registers 30 and 31 | ||
3181 | */ | ||
3182 | ret_val = e1000_write_phy_reg_ex(hw, | ||
3183 | GG82563_PHY_PAGE_SELECT_ALT, | ||
3184 | (uint16_t)((uint16_t)reg_addr >> GG82563_PAGE_SHIFT)); | ||
3185 | } | ||
3186 | |||
3187 | if (ret_val) { | ||
3188 | e1000_swfw_sync_release(hw, swfw); | ||
3189 | return ret_val; | ||
3190 | } | ||
3191 | } | ||
2793 | } | 3192 | } |
2794 | 3193 | ||
2795 | ret_val = e1000_read_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr, | 3194 | ret_val = e1000_read_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr, |
2796 | phy_data); | 3195 | phy_data); |
2797 | 3196 | ||
3197 | e1000_swfw_sync_release(hw, swfw); | ||
2798 | return ret_val; | 3198 | return ret_val; |
2799 | } | 3199 | } |
2800 | 3200 | ||
@@ -2885,22 +3285,55 @@ e1000_write_phy_reg(struct e1000_hw *hw, | |||
2885 | uint16_t phy_data) | 3285 | uint16_t phy_data) |
2886 | { | 3286 | { |
2887 | uint32_t ret_val; | 3287 | uint32_t ret_val; |
3288 | uint16_t swfw; | ||
2888 | 3289 | ||
2889 | DEBUGFUNC("e1000_write_phy_reg"); | 3290 | DEBUGFUNC("e1000_write_phy_reg"); |
2890 | 3291 | ||
3292 | if ((hw->mac_type == e1000_80003es2lan) && | ||
3293 | (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) { | ||
3294 | swfw = E1000_SWFW_PHY1_SM; | ||
3295 | } else { | ||
3296 | swfw = E1000_SWFW_PHY0_SM; | ||
3297 | } | ||
3298 | if (e1000_swfw_sync_acquire(hw, swfw)) | ||
3299 | return -E1000_ERR_SWFW_SYNC; | ||
3300 | |||
2891 | if((hw->phy_type == e1000_phy_igp || | 3301 | if((hw->phy_type == e1000_phy_igp || |
2892 | hw->phy_type == e1000_phy_igp_2) && | 3302 | hw->phy_type == e1000_phy_igp_2) && |
2893 | (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { | 3303 | (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { |
2894 | ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, | 3304 | ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, |
2895 | (uint16_t)reg_addr); | 3305 | (uint16_t)reg_addr); |
2896 | if(ret_val) { | 3306 | if(ret_val) { |
3307 | e1000_swfw_sync_release(hw, swfw); | ||
2897 | return ret_val; | 3308 | return ret_val; |
2898 | } | 3309 | } |
3310 | } else if (hw->phy_type == e1000_phy_gg82563) { | ||
3311 | if (((reg_addr & MAX_PHY_REG_ADDRESS) > MAX_PHY_MULTI_PAGE_REG) || | ||
3312 | (hw->mac_type == e1000_80003es2lan)) { | ||
3313 | /* Select Configuration Page */ | ||
3314 | if ((reg_addr & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { | ||
3315 | ret_val = e1000_write_phy_reg_ex(hw, GG82563_PHY_PAGE_SELECT, | ||
3316 | (uint16_t)((uint16_t)reg_addr >> GG82563_PAGE_SHIFT)); | ||
3317 | } else { | ||
3318 | /* Use Alternative Page Select register to access | ||
3319 | * registers 30 and 31 | ||
3320 | */ | ||
3321 | ret_val = e1000_write_phy_reg_ex(hw, | ||
3322 | GG82563_PHY_PAGE_SELECT_ALT, | ||
3323 | (uint16_t)((uint16_t)reg_addr >> GG82563_PAGE_SHIFT)); | ||
3324 | } | ||
3325 | |||
3326 | if (ret_val) { | ||
3327 | e1000_swfw_sync_release(hw, swfw); | ||
3328 | return ret_val; | ||
3329 | } | ||
3330 | } | ||
2899 | } | 3331 | } |
2900 | 3332 | ||
2901 | ret_val = e1000_write_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr, | 3333 | ret_val = e1000_write_phy_reg_ex(hw, MAX_PHY_REG_ADDRESS & reg_addr, |
2902 | phy_data); | 3334 | phy_data); |
2903 | 3335 | ||
3336 | e1000_swfw_sync_release(hw, swfw); | ||
2904 | return ret_val; | 3337 | return ret_val; |
2905 | } | 3338 | } |
2906 | 3339 | ||
@@ -2967,6 +3400,65 @@ e1000_write_phy_reg_ex(struct e1000_hw *hw, | |||
2967 | return E1000_SUCCESS; | 3400 | return E1000_SUCCESS; |
2968 | } | 3401 | } |
2969 | 3402 | ||
3403 | int32_t | ||
3404 | e1000_read_kmrn_reg(struct e1000_hw *hw, | ||
3405 | uint32_t reg_addr, | ||
3406 | uint16_t *data) | ||
3407 | { | ||
3408 | uint32_t reg_val; | ||
3409 | uint16_t swfw; | ||
3410 | DEBUGFUNC("e1000_read_kmrn_reg"); | ||
3411 | |||
3412 | if ((hw->mac_type == e1000_80003es2lan) && | ||
3413 | (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) { | ||
3414 | swfw = E1000_SWFW_PHY1_SM; | ||
3415 | } else { | ||
3416 | swfw = E1000_SWFW_PHY0_SM; | ||
3417 | } | ||
3418 | if (e1000_swfw_sync_acquire(hw, swfw)) | ||
3419 | return -E1000_ERR_SWFW_SYNC; | ||
3420 | |||
3421 | /* Write register address */ | ||
3422 | reg_val = ((reg_addr << E1000_KUMCTRLSTA_OFFSET_SHIFT) & | ||
3423 | E1000_KUMCTRLSTA_OFFSET) | | ||
3424 | E1000_KUMCTRLSTA_REN; | ||
3425 | E1000_WRITE_REG(hw, KUMCTRLSTA, reg_val); | ||
3426 | udelay(2); | ||
3427 | |||
3428 | /* Read the data returned */ | ||
3429 | reg_val = E1000_READ_REG(hw, KUMCTRLSTA); | ||
3430 | *data = (uint16_t)reg_val; | ||
3431 | |||
3432 | e1000_swfw_sync_release(hw, swfw); | ||
3433 | return E1000_SUCCESS; | ||
3434 | } | ||
3435 | |||
3436 | int32_t | ||
3437 | e1000_write_kmrn_reg(struct e1000_hw *hw, | ||
3438 | uint32_t reg_addr, | ||
3439 | uint16_t data) | ||
3440 | { | ||
3441 | uint32_t reg_val; | ||
3442 | uint16_t swfw; | ||
3443 | DEBUGFUNC("e1000_write_kmrn_reg"); | ||
3444 | |||
3445 | if ((hw->mac_type == e1000_80003es2lan) && | ||
3446 | (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) { | ||
3447 | swfw = E1000_SWFW_PHY1_SM; | ||
3448 | } else { | ||
3449 | swfw = E1000_SWFW_PHY0_SM; | ||
3450 | } | ||
3451 | if (e1000_swfw_sync_acquire(hw, swfw)) | ||
3452 | return -E1000_ERR_SWFW_SYNC; | ||
3453 | |||
3454 | reg_val = ((reg_addr << E1000_KUMCTRLSTA_OFFSET_SHIFT) & | ||
3455 | E1000_KUMCTRLSTA_OFFSET) | data; | ||
3456 | E1000_WRITE_REG(hw, KUMCTRLSTA, reg_val); | ||
3457 | udelay(2); | ||
3458 | |||
3459 | e1000_swfw_sync_release(hw, swfw); | ||
3460 | return E1000_SUCCESS; | ||
3461 | } | ||
2970 | 3462 | ||
2971 | /****************************************************************************** | 3463 | /****************************************************************************** |
2972 | * Returns the PHY to the power-on reset state | 3464 | * Returns the PHY to the power-on reset state |
@@ -2979,6 +3471,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
2979 | uint32_t ctrl, ctrl_ext; | 3471 | uint32_t ctrl, ctrl_ext; |
2980 | uint32_t led_ctrl; | 3472 | uint32_t led_ctrl; |
2981 | int32_t ret_val; | 3473 | int32_t ret_val; |
3474 | uint16_t swfw; | ||
2982 | 3475 | ||
2983 | DEBUGFUNC("e1000_phy_hw_reset"); | 3476 | DEBUGFUNC("e1000_phy_hw_reset"); |
2984 | 3477 | ||
@@ -2991,11 +3484,21 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
2991 | DEBUGOUT("Resetting Phy...\n"); | 3484 | DEBUGOUT("Resetting Phy...\n"); |
2992 | 3485 | ||
2993 | if(hw->mac_type > e1000_82543) { | 3486 | if(hw->mac_type > e1000_82543) { |
3487 | if ((hw->mac_type == e1000_80003es2lan) && | ||
3488 | (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) { | ||
3489 | swfw = E1000_SWFW_PHY1_SM; | ||
3490 | } else { | ||
3491 | swfw = E1000_SWFW_PHY0_SM; | ||
3492 | } | ||
3493 | if (e1000_swfw_sync_acquire(hw, swfw)) { | ||
3494 | e1000_release_software_semaphore(hw); | ||
3495 | return -E1000_ERR_SWFW_SYNC; | ||
3496 | } | ||
2994 | /* Read the device control register and assert the E1000_CTRL_PHY_RST | 3497 | /* Read the device control register and assert the E1000_CTRL_PHY_RST |
2995 | * bit. Then, take it out of reset. | 3498 | * bit. Then, take it out of reset. |
2996 | * For pre-e1000_82571 hardware, we delay for 10ms between the assert | 3499 | * For pre-e1000_82571 hardware, we delay for 10ms between the assert |
2997 | * and deassert. For e1000_82571 hardware and later, we instead delay | 3500 | * and deassert. For e1000_82571 hardware and later, we instead delay |
2998 | * for 10ms after the deassertion. | 3501 | * for 50us between and 10ms after the deassertion. |
2999 | */ | 3502 | */ |
3000 | ctrl = E1000_READ_REG(hw, CTRL); | 3503 | ctrl = E1000_READ_REG(hw, CTRL); |
3001 | E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST); | 3504 | E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST); |
@@ -3011,6 +3514,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
3011 | 3514 | ||
3012 | if (hw->mac_type >= e1000_82571) | 3515 | if (hw->mac_type >= e1000_82571) |
3013 | msec_delay(10); | 3516 | msec_delay(10); |
3517 | e1000_swfw_sync_release(hw, swfw); | ||
3014 | } else { | 3518 | } else { |
3015 | /* Read the Extended Device Control Register, assert the PHY_RESET_DIR | 3519 | /* Read the Extended Device Control Register, assert the PHY_RESET_DIR |
3016 | * bit to put the PHY into reset. Then, take it out of reset. | 3520 | * bit to put the PHY into reset. Then, take it out of reset. |
@@ -3037,6 +3541,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
3037 | 3541 | ||
3038 | /* Wait for FW to finish PHY configuration. */ | 3542 | /* Wait for FW to finish PHY configuration. */ |
3039 | ret_val = e1000_get_phy_cfg_done(hw); | 3543 | ret_val = e1000_get_phy_cfg_done(hw); |
3544 | e1000_release_software_semaphore(hw); | ||
3040 | 3545 | ||
3041 | return ret_val; | 3546 | return ret_val; |
3042 | } | 3547 | } |
@@ -3114,6 +3619,15 @@ e1000_detect_gig_phy(struct e1000_hw *hw) | |||
3114 | return E1000_SUCCESS; | 3619 | return E1000_SUCCESS; |
3115 | } | 3620 | } |
3116 | 3621 | ||
3622 | /* ESB-2 PHY reads require e1000_phy_gg82563 to be set because of a work- | ||
3623 | * around that forces PHY page 0 to be set or the reads fail. The rest of | ||
3624 | * the code in this routine uses e1000_read_phy_reg to read the PHY ID. | ||
3625 | * So for ESB-2 we need to have this set so our reads won't fail. If the | ||
3626 | * attached PHY is not a e1000_phy_gg82563, the routines below will figure | ||
3627 | * this out as well. */ | ||
3628 | if (hw->mac_type == e1000_80003es2lan) | ||
3629 | hw->phy_type = e1000_phy_gg82563; | ||
3630 | |||
3117 | /* Read the PHY ID Registers to identify which PHY is onboard. */ | 3631 | /* Read the PHY ID Registers to identify which PHY is onboard. */ |
3118 | ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high); | 3632 | ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high); |
3119 | if(ret_val) | 3633 | if(ret_val) |
@@ -3151,6 +3665,9 @@ e1000_detect_gig_phy(struct e1000_hw *hw) | |||
3151 | case e1000_82573: | 3665 | case e1000_82573: |
3152 | if(hw->phy_id == M88E1111_I_PHY_ID) match = TRUE; | 3666 | if(hw->phy_id == M88E1111_I_PHY_ID) match = TRUE; |
3153 | break; | 3667 | break; |
3668 | case e1000_80003es2lan: | ||
3669 | if (hw->phy_id == GG82563_E_PHY_ID) match = TRUE; | ||
3670 | break; | ||
3154 | default: | 3671 | default: |
3155 | DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type); | 3672 | DEBUGOUT1("Invalid MAC type %d\n", hw->mac_type); |
3156 | return -E1000_ERR_CONFIG; | 3673 | return -E1000_ERR_CONFIG; |
@@ -3177,8 +3694,10 @@ e1000_phy_reset_dsp(struct e1000_hw *hw) | |||
3177 | DEBUGFUNC("e1000_phy_reset_dsp"); | 3694 | DEBUGFUNC("e1000_phy_reset_dsp"); |
3178 | 3695 | ||
3179 | do { | 3696 | do { |
3180 | ret_val = e1000_write_phy_reg(hw, 29, 0x001d); | 3697 | if (hw->phy_type != e1000_phy_gg82563) { |
3181 | if(ret_val) break; | 3698 | ret_val = e1000_write_phy_reg(hw, 29, 0x001d); |
3699 | if(ret_val) break; | ||
3700 | } | ||
3182 | ret_val = e1000_write_phy_reg(hw, 30, 0x00c1); | 3701 | ret_val = e1000_write_phy_reg(hw, 30, 0x00c1); |
3183 | if(ret_val) break; | 3702 | if(ret_val) break; |
3184 | ret_val = e1000_write_phy_reg(hw, 30, 0x0000); | 3703 | ret_val = e1000_write_phy_reg(hw, 30, 0x0000); |
@@ -3310,8 +3829,17 @@ e1000_phy_m88_get_info(struct e1000_hw *hw, | |||
3310 | /* Cable Length Estimation and Local/Remote Receiver Information | 3829 | /* Cable Length Estimation and Local/Remote Receiver Information |
3311 | * are only valid at 1000 Mbps. | 3830 | * are only valid at 1000 Mbps. |
3312 | */ | 3831 | */ |
3313 | phy_info->cable_length = ((phy_data & M88E1000_PSSR_CABLE_LENGTH) >> | 3832 | if (hw->phy_type != e1000_phy_gg82563) { |
3314 | M88E1000_PSSR_CABLE_LENGTH_SHIFT); | 3833 | phy_info->cable_length = ((phy_data & M88E1000_PSSR_CABLE_LENGTH) >> |
3834 | M88E1000_PSSR_CABLE_LENGTH_SHIFT); | ||
3835 | } else { | ||
3836 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_DSP_DISTANCE, | ||
3837 | &phy_data); | ||
3838 | if (ret_val) | ||
3839 | return ret_val; | ||
3840 | |||
3841 | phy_info->cable_length = phy_data & GG82563_DSPD_CABLE_LENGTH; | ||
3842 | } | ||
3315 | 3843 | ||
3316 | ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data); | 3844 | ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data); |
3317 | if(ret_val) | 3845 | if(ret_val) |
@@ -3392,7 +3920,8 @@ e1000_validate_mdi_setting(struct e1000_hw *hw) | |||
3392 | 3920 | ||
3393 | /****************************************************************************** | 3921 | /****************************************************************************** |
3394 | * Sets up eeprom variables in the hw struct. Must be called after mac_type | 3922 | * Sets up eeprom variables in the hw struct. Must be called after mac_type |
3395 | * is configured. | 3923 | * is configured. Additionally, if this is ICH8, the flash controller GbE |
3924 | * registers must be mapped, or this will crash. | ||
3396 | * | 3925 | * |
3397 | * hw - Struct containing variables accessed by shared code | 3926 | * hw - Struct containing variables accessed by shared code |
3398 | *****************************************************************************/ | 3927 | *****************************************************************************/ |
@@ -3505,6 +4034,20 @@ e1000_init_eeprom_params(struct e1000_hw *hw) | |||
3505 | E1000_WRITE_REG(hw, EECD, eecd); | 4034 | E1000_WRITE_REG(hw, EECD, eecd); |
3506 | } | 4035 | } |
3507 | break; | 4036 | break; |
4037 | case e1000_80003es2lan: | ||
4038 | eeprom->type = e1000_eeprom_spi; | ||
4039 | eeprom->opcode_bits = 8; | ||
4040 | eeprom->delay_usec = 1; | ||
4041 | if (eecd & E1000_EECD_ADDR_BITS) { | ||
4042 | eeprom->page_size = 32; | ||
4043 | eeprom->address_bits = 16; | ||
4044 | } else { | ||
4045 | eeprom->page_size = 8; | ||
4046 | eeprom->address_bits = 8; | ||
4047 | } | ||
4048 | eeprom->use_eerd = TRUE; | ||
4049 | eeprom->use_eewr = FALSE; | ||
4050 | break; | ||
3508 | default: | 4051 | default: |
3509 | break; | 4052 | break; |
3510 | } | 4053 | } |
@@ -3685,9 +4228,8 @@ e1000_acquire_eeprom(struct e1000_hw *hw) | |||
3685 | 4228 | ||
3686 | DEBUGFUNC("e1000_acquire_eeprom"); | 4229 | DEBUGFUNC("e1000_acquire_eeprom"); |
3687 | 4230 | ||
3688 | if(e1000_get_hw_eeprom_semaphore(hw)) | 4231 | if (e1000_swfw_sync_acquire(hw, E1000_SWFW_EEP_SM)) |
3689 | return -E1000_ERR_EEPROM; | 4232 | return -E1000_ERR_SWFW_SYNC; |
3690 | |||
3691 | eecd = E1000_READ_REG(hw, EECD); | 4233 | eecd = E1000_READ_REG(hw, EECD); |
3692 | 4234 | ||
3693 | if (hw->mac_type != e1000_82573) { | 4235 | if (hw->mac_type != e1000_82573) { |
@@ -3706,7 +4248,7 @@ e1000_acquire_eeprom(struct e1000_hw *hw) | |||
3706 | eecd &= ~E1000_EECD_REQ; | 4248 | eecd &= ~E1000_EECD_REQ; |
3707 | E1000_WRITE_REG(hw, EECD, eecd); | 4249 | E1000_WRITE_REG(hw, EECD, eecd); |
3708 | DEBUGOUT("Could not acquire EEPROM grant\n"); | 4250 | DEBUGOUT("Could not acquire EEPROM grant\n"); |
3709 | e1000_put_hw_eeprom_semaphore(hw); | 4251 | e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM); |
3710 | return -E1000_ERR_EEPROM; | 4252 | return -E1000_ERR_EEPROM; |
3711 | } | 4253 | } |
3712 | } | 4254 | } |
@@ -3829,7 +4371,7 @@ e1000_release_eeprom(struct e1000_hw *hw) | |||
3829 | E1000_WRITE_REG(hw, EECD, eecd); | 4371 | E1000_WRITE_REG(hw, EECD, eecd); |
3830 | } | 4372 | } |
3831 | 4373 | ||
3832 | e1000_put_hw_eeprom_semaphore(hw); | 4374 | e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM); |
3833 | } | 4375 | } |
3834 | 4376 | ||
3835 | /****************************************************************************** | 4377 | /****************************************************************************** |
@@ -3908,6 +4450,8 @@ e1000_read_eeprom(struct e1000_hw *hw, | |||
3908 | if (e1000_is_onboard_nvm_eeprom(hw) == TRUE && | 4450 | if (e1000_is_onboard_nvm_eeprom(hw) == TRUE && |
3909 | hw->eeprom.use_eerd == FALSE) { | 4451 | hw->eeprom.use_eerd == FALSE) { |
3910 | switch (hw->mac_type) { | 4452 | switch (hw->mac_type) { |
4453 | case e1000_80003es2lan: | ||
4454 | break; | ||
3911 | default: | 4455 | default: |
3912 | /* Prepare the EEPROM for reading */ | 4456 | /* Prepare the EEPROM for reading */ |
3913 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) | 4457 | if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) |
@@ -4025,6 +4569,9 @@ e1000_write_eeprom_eewr(struct e1000_hw *hw, | |||
4025 | uint32_t i = 0; | 4569 | uint32_t i = 0; |
4026 | int32_t error = 0; | 4570 | int32_t error = 0; |
4027 | 4571 | ||
4572 | if (e1000_swfw_sync_acquire(hw, E1000_SWFW_EEP_SM)) | ||
4573 | return -E1000_ERR_SWFW_SYNC; | ||
4574 | |||
4028 | for (i = 0; i < words; i++) { | 4575 | for (i = 0; i < words; i++) { |
4029 | register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) | | 4576 | register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) | |
4030 | ((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) | | 4577 | ((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) | |
@@ -4044,6 +4591,7 @@ e1000_write_eeprom_eewr(struct e1000_hw *hw, | |||
4044 | } | 4591 | } |
4045 | } | 4592 | } |
4046 | 4593 | ||
4594 | e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM); | ||
4047 | return error; | 4595 | return error; |
4048 | } | 4596 | } |
4049 | 4597 | ||
@@ -4085,6 +4633,8 @@ e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) | |||
4085 | { | 4633 | { |
4086 | uint32_t eecd = 0; | 4634 | uint32_t eecd = 0; |
4087 | 4635 | ||
4636 | DEBUGFUNC("e1000_is_onboard_nvm_eeprom"); | ||
4637 | |||
4088 | if(hw->mac_type == e1000_82573) { | 4638 | if(hw->mac_type == e1000_82573) { |
4089 | eecd = E1000_READ_REG(hw, EECD); | 4639 | eecd = E1000_READ_REG(hw, EECD); |
4090 | 4640 | ||
@@ -4511,6 +5061,7 @@ e1000_read_mac_addr(struct e1000_hw * hw) | |||
4511 | case e1000_82546: | 5061 | case e1000_82546: |
4512 | case e1000_82546_rev_3: | 5062 | case e1000_82546_rev_3: |
4513 | case e1000_82571: | 5063 | case e1000_82571: |
5064 | case e1000_80003es2lan: | ||
4514 | if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) | 5065 | if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) |
4515 | hw->perm_mac_addr[5] ^= 0x01; | 5066 | hw->perm_mac_addr[5] ^= 0x01; |
4516 | break; | 5067 | break; |
@@ -4749,8 +5300,37 @@ e1000_rar_set(struct e1000_hw *hw, | |||
4749 | rar_low = ((uint32_t) addr[0] | | 5300 | rar_low = ((uint32_t) addr[0] | |
4750 | ((uint32_t) addr[1] << 8) | | 5301 | ((uint32_t) addr[1] << 8) | |
4751 | ((uint32_t) addr[2] << 16) | ((uint32_t) addr[3] << 24)); | 5302 | ((uint32_t) addr[2] << 16) | ((uint32_t) addr[3] << 24)); |
5303 | rar_high = ((uint32_t) addr[4] | ((uint32_t) addr[5] << 8)); | ||
4752 | 5304 | ||
4753 | rar_high = ((uint32_t) addr[4] | ((uint32_t) addr[5] << 8) | E1000_RAH_AV); | 5305 | /* Disable Rx and flush all Rx frames before enabling RSS to avoid Rx |
5306 | * unit hang. | ||
5307 | * | ||
5308 | * Description: | ||
5309 | * If there are any Rx frames queued up or otherwise present in the HW | ||
5310 | * before RSS is enabled, and then we enable RSS, the HW Rx unit will | ||
5311 | * hang. To work around this issue, we have to disable receives and | ||
5312 | * flush out all Rx frames before we enable RSS. To do so, we modify we | ||
5313 | * redirect all Rx traffic to manageability and then reset the HW. | ||
5314 | * This flushes away Rx frames, and (since the redirections to | ||
5315 | * manageability persists across resets) keeps new ones from coming in | ||
5316 | * while we work. Then, we clear the Address Valid AV bit for all MAC | ||
5317 | * addresses and undo the re-direction to manageability. | ||
5318 | * Now, frames are coming in again, but the MAC won't accept them, so | ||
5319 | * far so good. We now proceed to initialize RSS (if necessary) and | ||
5320 | * configure the Rx unit. Last, we re-enable the AV bits and continue | ||
5321 | * on our merry way. | ||
5322 | */ | ||
5323 | switch (hw->mac_type) { | ||
5324 | case e1000_82571: | ||
5325 | case e1000_82572: | ||
5326 | case e1000_80003es2lan: | ||
5327 | if (hw->leave_av_bit_off == TRUE) | ||
5328 | break; | ||
5329 | default: | ||
5330 | /* Indicate to hardware the Address is Valid. */ | ||
5331 | rar_high |= E1000_RAH_AV; | ||
5332 | break; | ||
5333 | } | ||
4754 | 5334 | ||
4755 | E1000_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); | 5335 | E1000_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); |
4756 | E1000_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); | 5336 | E1000_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); |
@@ -5330,6 +5910,7 @@ e1000_get_bus_info(struct e1000_hw *hw) | |||
5330 | hw->bus_width = e1000_bus_width_pciex_1; | 5910 | hw->bus_width = e1000_bus_width_pciex_1; |
5331 | break; | 5911 | break; |
5332 | case e1000_82571: | 5912 | case e1000_82571: |
5913 | case e1000_80003es2lan: | ||
5333 | hw->bus_type = e1000_bus_type_pci_express; | 5914 | hw->bus_type = e1000_bus_type_pci_express; |
5334 | hw->bus_speed = e1000_bus_speed_2500; | 5915 | hw->bus_speed = e1000_bus_speed_2500; |
5335 | hw->bus_width = e1000_bus_width_pciex_4; | 5916 | hw->bus_width = e1000_bus_width_pciex_4; |
@@ -5475,6 +6056,34 @@ e1000_get_cable_length(struct e1000_hw *hw, | |||
5475 | return -E1000_ERR_PHY; | 6056 | return -E1000_ERR_PHY; |
5476 | break; | 6057 | break; |
5477 | } | 6058 | } |
6059 | } else if (hw->phy_type == e1000_phy_gg82563) { | ||
6060 | ret_val = e1000_read_phy_reg(hw, GG82563_PHY_DSP_DISTANCE, | ||
6061 | &phy_data); | ||
6062 | if (ret_val) | ||
6063 | return ret_val; | ||
6064 | cable_length = phy_data & GG82563_DSPD_CABLE_LENGTH; | ||
6065 | |||
6066 | switch (cable_length) { | ||
6067 | case e1000_gg_cable_length_60: | ||
6068 | *min_length = 0; | ||
6069 | *max_length = e1000_igp_cable_length_60; | ||
6070 | break; | ||
6071 | case e1000_gg_cable_length_60_115: | ||
6072 | *min_length = e1000_igp_cable_length_60; | ||
6073 | *max_length = e1000_igp_cable_length_115; | ||
6074 | break; | ||
6075 | case e1000_gg_cable_length_115_150: | ||
6076 | *min_length = e1000_igp_cable_length_115; | ||
6077 | *max_length = e1000_igp_cable_length_150; | ||
6078 | break; | ||
6079 | case e1000_gg_cable_length_150: | ||
6080 | *min_length = e1000_igp_cable_length_150; | ||
6081 | *max_length = e1000_igp_cable_length_180; | ||
6082 | break; | ||
6083 | default: | ||
6084 | return -E1000_ERR_PHY; | ||
6085 | break; | ||
6086 | } | ||
5478 | } else if(hw->phy_type == e1000_phy_igp) { /* For IGP PHY */ | 6087 | } else if(hw->phy_type == e1000_phy_igp) { /* For IGP PHY */ |
5479 | uint16_t agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = | 6088 | uint16_t agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = |
5480 | {IGP01E1000_PHY_AGC_A, | 6089 | {IGP01E1000_PHY_AGC_A, |
@@ -5584,7 +6193,8 @@ e1000_check_polarity(struct e1000_hw *hw, | |||
5584 | 6193 | ||
5585 | DEBUGFUNC("e1000_check_polarity"); | 6194 | DEBUGFUNC("e1000_check_polarity"); |
5586 | 6195 | ||
5587 | if(hw->phy_type == e1000_phy_m88) { | 6196 | if ((hw->phy_type == e1000_phy_m88) || |
6197 | (hw->phy_type == e1000_phy_gg82563)) { | ||
5588 | /* return the Polarity bit in the Status register. */ | 6198 | /* return the Polarity bit in the Status register. */ |
5589 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, | 6199 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, |
5590 | &phy_data); | 6200 | &phy_data); |
@@ -5653,7 +6263,8 @@ e1000_check_downshift(struct e1000_hw *hw) | |||
5653 | return ret_val; | 6263 | return ret_val; |
5654 | 6264 | ||
5655 | hw->speed_downgraded = (phy_data & IGP01E1000_PLHR_SS_DOWNGRADE) ? 1 : 0; | 6265 | hw->speed_downgraded = (phy_data & IGP01E1000_PLHR_SS_DOWNGRADE) ? 1 : 0; |
5656 | } else if(hw->phy_type == e1000_phy_m88) { | 6266 | } else if ((hw->phy_type == e1000_phy_m88) || |
6267 | (hw->phy_type == e1000_phy_gg82563)) { | ||
5657 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, | 6268 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, |
5658 | &phy_data); | 6269 | &phy_data); |
5659 | if(ret_val) | 6270 | if(ret_val) |
@@ -6686,6 +7297,7 @@ e1000_get_auto_rd_done(struct e1000_hw *hw) | |||
6686 | case e1000_82571: | 7297 | case e1000_82571: |
6687 | case e1000_82572: | 7298 | case e1000_82572: |
6688 | case e1000_82573: | 7299 | case e1000_82573: |
7300 | case e1000_80003es2lan: | ||
6689 | while(timeout) { | 7301 | while(timeout) { |
6690 | if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD) break; | 7302 | if (E1000_READ_REG(hw, EECD) & E1000_EECD_AUTO_RD) break; |
6691 | else msec_delay(1); | 7303 | else msec_delay(1); |
@@ -6729,6 +7341,11 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw) | |||
6729 | default: | 7341 | default: |
6730 | msec_delay(10); | 7342 | msec_delay(10); |
6731 | break; | 7343 | break; |
7344 | case e1000_80003es2lan: | ||
7345 | /* Separate *_CFG_DONE_* bit for each port */ | ||
7346 | if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) | ||
7347 | cfg_mask = E1000_EEPROM_CFG_DONE_PORT_1; | ||
7348 | /* Fall Through */ | ||
6732 | case e1000_82571: | 7349 | case e1000_82571: |
6733 | case e1000_82572: | 7350 | case e1000_82572: |
6734 | while (timeout) { | 7351 | while (timeout) { |
@@ -6746,12 +7363,6 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw) | |||
6746 | break; | 7363 | break; |
6747 | } | 7364 | } |
6748 | 7365 | ||
6749 | /* PHY configuration from NVM just starts after EECD_AUTO_RD sets to high. | ||
6750 | * Need to wait for PHY configuration completion before accessing NVM | ||
6751 | * and PHY. */ | ||
6752 | if (hw->mac_type == e1000_82573) | ||
6753 | msec_delay(25); | ||
6754 | |||
6755 | return E1000_SUCCESS; | 7366 | return E1000_SUCCESS; |
6756 | } | 7367 | } |
6757 | 7368 | ||
@@ -6777,6 +7388,11 @@ e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) | |||
6777 | if(!hw->eeprom_semaphore_present) | 7388 | if(!hw->eeprom_semaphore_present) |
6778 | return E1000_SUCCESS; | 7389 | return E1000_SUCCESS; |
6779 | 7390 | ||
7391 | if (hw->mac_type == e1000_80003es2lan) { | ||
7392 | /* Get the SW semaphore. */ | ||
7393 | if (e1000_get_software_semaphore(hw) != E1000_SUCCESS) | ||
7394 | return -E1000_ERR_EEPROM; | ||
7395 | } | ||
6780 | 7396 | ||
6781 | /* Get the FW semaphore. */ | 7397 | /* Get the FW semaphore. */ |
6782 | timeout = hw->eeprom.word_size + 1; | 7398 | timeout = hw->eeprom.word_size + 1; |
@@ -6822,10 +7438,75 @@ e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) | |||
6822 | return; | 7438 | return; |
6823 | 7439 | ||
6824 | swsm = E1000_READ_REG(hw, SWSM); | 7440 | swsm = E1000_READ_REG(hw, SWSM); |
7441 | if (hw->mac_type == e1000_80003es2lan) { | ||
7442 | /* Release both semaphores. */ | ||
7443 | swsm &= ~(E1000_SWSM_SMBI | E1000_SWSM_SWESMBI); | ||
7444 | } else | ||
6825 | swsm &= ~(E1000_SWSM_SWESMBI); | 7445 | swsm &= ~(E1000_SWSM_SWESMBI); |
6826 | E1000_WRITE_REG(hw, SWSM, swsm); | 7446 | E1000_WRITE_REG(hw, SWSM, swsm); |
6827 | } | 7447 | } |
6828 | 7448 | ||
7449 | /*************************************************************************** | ||
7450 | * | ||
7451 | * Obtaining software semaphore bit (SMBI) before resetting PHY. | ||
7452 | * | ||
7453 | * hw: Struct containing variables accessed by shared code | ||
7454 | * | ||
7455 | * returns: - E1000_ERR_RESET if fail to obtain semaphore. | ||
7456 | * E1000_SUCCESS at any other case. | ||
7457 | * | ||
7458 | ***************************************************************************/ | ||
7459 | int32_t | ||
7460 | e1000_get_software_semaphore(struct e1000_hw *hw) | ||
7461 | { | ||
7462 | int32_t timeout = hw->eeprom.word_size + 1; | ||
7463 | uint32_t swsm; | ||
7464 | |||
7465 | DEBUGFUNC("e1000_get_software_semaphore"); | ||
7466 | |||
7467 | if (hw->mac_type != e1000_80003es2lan) | ||
7468 | return E1000_SUCCESS; | ||
7469 | |||
7470 | while(timeout) { | ||
7471 | swsm = E1000_READ_REG(hw, SWSM); | ||
7472 | /* If SMBI bit cleared, it is now set and we hold the semaphore */ | ||
7473 | if(!(swsm & E1000_SWSM_SMBI)) | ||
7474 | break; | ||
7475 | msec_delay_irq(1); | ||
7476 | timeout--; | ||
7477 | } | ||
7478 | |||
7479 | if(!timeout) { | ||
7480 | DEBUGOUT("Driver can't access device - SMBI bit is set.\n"); | ||
7481 | return -E1000_ERR_RESET; | ||
7482 | } | ||
7483 | |||
7484 | return E1000_SUCCESS; | ||
7485 | } | ||
7486 | |||
7487 | /*************************************************************************** | ||
7488 | * | ||
7489 | * Release semaphore bit (SMBI). | ||
7490 | * | ||
7491 | * hw: Struct containing variables accessed by shared code | ||
7492 | * | ||
7493 | ***************************************************************************/ | ||
7494 | void | ||
7495 | e1000_release_software_semaphore(struct e1000_hw *hw) | ||
7496 | { | ||
7497 | uint32_t swsm; | ||
7498 | |||
7499 | DEBUGFUNC("e1000_release_software_semaphore"); | ||
7500 | |||
7501 | if (hw->mac_type != e1000_80003es2lan) | ||
7502 | return; | ||
7503 | |||
7504 | swsm = E1000_READ_REG(hw, SWSM); | ||
7505 | /* Release the SW semaphores.*/ | ||
7506 | swsm &= ~E1000_SWSM_SMBI; | ||
7507 | E1000_WRITE_REG(hw, SWSM, swsm); | ||
7508 | } | ||
7509 | |||
6829 | /****************************************************************************** | 7510 | /****************************************************************************** |
6830 | * Checks if PHY reset is blocked due to SOL/IDER session, for example. | 7511 | * Checks if PHY reset is blocked due to SOL/IDER session, for example. |
6831 | * Returning E1000_BLK_PHY_RESET isn't necessarily an error. But it's up to | 7512 | * Returning E1000_BLK_PHY_RESET isn't necessarily an error. But it's up to |
@@ -6862,6 +7543,7 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw) | |||
6862 | case e1000_82571: | 7543 | case e1000_82571: |
6863 | case e1000_82572: | 7544 | case e1000_82572: |
6864 | case e1000_82573: | 7545 | case e1000_82573: |
7546 | case e1000_80003es2lan: | ||
6865 | fwsm = E1000_READ_REG(hw, FWSM); | 7547 | fwsm = E1000_READ_REG(hw, FWSM); |
6866 | if((fwsm & E1000_FWSM_MODE_MASK) != 0) | 7548 | if((fwsm & E1000_FWSM_MODE_MASK) != 0) |
6867 | return TRUE; | 7549 | return TRUE; |