diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2008-04-04 00:44:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-04 00:44:44 -0400 |
commit | b2a5c19ca0315723cecb9489ff8b67c4f17367b4 (patch) | |
tree | e218cd12701ef2a180e283b99697a277ab0f70c0 /drivers/net/tg3.h | |
parent | 61407f80f72970d52d4339f81c6c3cd03f4ca0f0 (diff) |
[TG3]: Add PHY workaround for 5784
The 5784 B step and newer chips require the PHY DSPs to be fine-tuned
based on one-time programmable values stored in the chip. This is
essential to achieve optimal PHY operations especially when using
long cables. We also need to properly handle the 10Mbit RX bit in the
CPMU_CTRL register during PHY reset.
Update version to 3.89.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.h')
-rw-r--r-- | drivers/net/tg3.h | 79 |
1 files changed, 76 insertions, 3 deletions
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index 3938eb35ce8c..c1075a73d66c 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -138,6 +138,8 @@ | |||
138 | #define CHIPREV_5704_BX 0x21 | 138 | #define CHIPREV_5704_BX 0x21 |
139 | #define CHIPREV_5750_AX 0x40 | 139 | #define CHIPREV_5750_AX 0x40 |
140 | #define CHIPREV_5750_BX 0x41 | 140 | #define CHIPREV_5750_BX 0x41 |
141 | #define CHIPREV_5784_AX 0x57840 | ||
142 | #define CHIPREV_5761_AX 0x57610 | ||
141 | #define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) | 143 | #define GET_METAL_REV(CHIP_REV_ID) ((CHIP_REV_ID) & 0xff) |
142 | #define METAL_REV_A0 0x00 | 144 | #define METAL_REV_A0 0x00 |
143 | #define METAL_REV_A1 0x01 | 145 | #define METAL_REV_A1 0x01 |
@@ -866,6 +868,7 @@ | |||
866 | #define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 | 868 | #define CPMU_CTRL_LINK_IDLE_MODE 0x00000200 |
867 | #define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 | 869 | #define CPMU_CTRL_LINK_AWARE_MODE 0x00000400 |
868 | #define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 | 870 | #define CPMU_CTRL_LINK_SPEED_MODE 0x00004000 |
871 | #define CPMU_CTRL_GPHY_10MB_RXONLY 0x00010000 | ||
869 | #define TG3_CPMU_LSPD_10MB_CLK 0x00003604 | 872 | #define TG3_CPMU_LSPD_10MB_CLK 0x00003604 |
870 | #define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 | 873 | #define CPMU_LSPD_10MB_MACCLK_MASK 0x001f0000 |
871 | #define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 | 874 | #define CPMU_LSPD_10MB_MACCLK_6_25 0x00130000 |
@@ -1559,7 +1562,24 @@ | |||
1559 | /* 0x702c unused */ | 1562 | /* 0x702c unused */ |
1560 | 1563 | ||
1561 | #define NVRAM_ADDR_LOCKOUT 0x00007030 | 1564 | #define NVRAM_ADDR_LOCKOUT 0x00007030 |
1562 | /* 0x7034 --> 0x7c00 unused */ | 1565 | /* 0x7034 --> 0x7500 unused */ |
1566 | |||
1567 | #define OTP_MODE 0x00007500 | ||
1568 | #define OTP_MODE_OTP_THRU_GRC 0x00000001 | ||
1569 | #define OTP_CTRL 0x00007504 | ||
1570 | #define OTP_CTRL_OTP_PROG_ENABLE 0x00200000 | ||
1571 | #define OTP_CTRL_OTP_CMD_READ 0x00000000 | ||
1572 | #define OTP_CTRL_OTP_CMD_INIT 0x00000008 | ||
1573 | #define OTP_CTRL_OTP_CMD_START 0x00000001 | ||
1574 | #define OTP_STATUS 0x00007508 | ||
1575 | #define OTP_STATUS_CMD_DONE 0x00000001 | ||
1576 | #define OTP_ADDRESS 0x0000750c | ||
1577 | #define OTP_ADDRESS_MAGIC1 0x000000a0 | ||
1578 | #define OTP_ADDRESS_MAGIC2 0x00000080 | ||
1579 | /* 0x7510 unused */ | ||
1580 | |||
1581 | #define OTP_READ_DATA 0x00007514 | ||
1582 | /* 0x7518 --> 0x7c04 unused */ | ||
1563 | 1583 | ||
1564 | #define PCIE_TRANSACTION_CFG 0x00007c04 | 1584 | #define PCIE_TRANSACTION_CFG 0x00007c04 |
1565 | #define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 | 1585 | #define PCIE_TRANS_CFG_1SHOT_MSI 0x20000000 |
@@ -1568,6 +1588,28 @@ | |||
1568 | #define PCIE_PWR_MGMT_THRESH 0x00007d28 | 1588 | #define PCIE_PWR_MGMT_THRESH 0x00007d28 |
1569 | #define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 | 1589 | #define PCIE_PWR_MGMT_L1_THRESH_MSK 0x0000ff00 |
1570 | 1590 | ||
1591 | |||
1592 | /* OTP bit definitions */ | ||
1593 | #define TG3_OTP_AGCTGT_MASK 0x000000e0 | ||
1594 | #define TG3_OTP_AGCTGT_SHIFT 1 | ||
1595 | #define TG3_OTP_HPFFLTR_MASK 0x00000300 | ||
1596 | #define TG3_OTP_HPFFLTR_SHIFT 1 | ||
1597 | #define TG3_OTP_HPFOVER_MASK 0x00000400 | ||
1598 | #define TG3_OTP_HPFOVER_SHIFT 1 | ||
1599 | #define TG3_OTP_LPFDIS_MASK 0x00000800 | ||
1600 | #define TG3_OTP_LPFDIS_SHIFT 11 | ||
1601 | #define TG3_OTP_VDAC_MASK 0xff000000 | ||
1602 | #define TG3_OTP_VDAC_SHIFT 24 | ||
1603 | #define TG3_OTP_10BTAMP_MASK 0x0000f000 | ||
1604 | #define TG3_OTP_10BTAMP_SHIFT 8 | ||
1605 | #define TG3_OTP_ROFF_MASK 0x00e00000 | ||
1606 | #define TG3_OTP_ROFF_SHIFT 11 | ||
1607 | #define TG3_OTP_RCOFF_MASK 0x001c0000 | ||
1608 | #define TG3_OTP_RCOFF_SHIFT 16 | ||
1609 | |||
1610 | #define TG3_OTP_DEFAULT 0x286c1640 | ||
1611 | |||
1612 | |||
1571 | #define TG3_EEPROM_MAGIC 0x669955aa | 1613 | #define TG3_EEPROM_MAGIC 0x669955aa |
1572 | #define TG3_EEPROM_MAGIC_FW 0xa5000000 | 1614 | #define TG3_EEPROM_MAGIC_FW 0xa5000000 |
1573 | #define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 | 1615 | #define TG3_EEPROM_MAGIC_FW_MSK 0xff000000 |
@@ -1705,15 +1747,31 @@ | |||
1705 | 1747 | ||
1706 | #define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ | 1748 | #define MII_TG3_DSP_RW_PORT 0x15 /* DSP coefficient read/write port */ |
1707 | 1749 | ||
1708 | #define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */ | ||
1709 | #define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */ | 1750 | #define MII_TG3_EPHY_PTEST 0x17 /* 5906 PHY register */ |
1751 | #define MII_TG3_DSP_ADDRESS 0x17 /* DSP address register */ | ||
1752 | |||
1753 | #define MII_TG3_DSP_TAP1 0x0001 | ||
1754 | #define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007 | ||
1755 | #define MII_TG3_DSP_AADJ1CH0 0x001f | ||
1756 | #define MII_TG3_DSP_AADJ1CH3 0x601f | ||
1757 | #define MII_TG3_DSP_AADJ1CH3_ADCCKADJ 0x0002 | ||
1758 | #define MII_TG3_DSP_EXP8 0x0708 | ||
1759 | #define MII_TG3_DSP_EXP8_REJ2MHz 0x0001 | ||
1760 | #define MII_TG3_DSP_EXP8_AEDW 0x0200 | ||
1761 | #define MII_TG3_DSP_EXP75 0x0f75 | ||
1762 | #define MII_TG3_DSP_EXP96 0x0f96 | ||
1763 | #define MII_TG3_DSP_EXP97 0x0f97 | ||
1710 | 1764 | ||
1711 | #define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ | 1765 | #define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ |
1712 | 1766 | ||
1713 | #define MII_TG3_AUXCTL_MISC_WREN 0x8000 | 1767 | #define MII_TG3_AUXCTL_MISC_WREN 0x8000 |
1714 | #define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 | 1768 | #define MII_TG3_AUXCTL_MISC_FORCE_AMDIX 0x0200 |
1715 | #define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000 | 1769 | #define MII_TG3_AUXCTL_MISC_RDSEL_MISC 0x7000 |
1716 | #define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 | 1770 | #define MII_TG3_AUXCTL_SHDWSEL_MISC 0x0007 |
1771 | |||
1772 | #define MII_TG3_AUXCTL_ACTL_SMDSP_ENA 0x0800 | ||
1773 | #define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400 | ||
1774 | #define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000 | ||
1717 | 1775 | ||
1718 | #define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ | 1776 | #define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ |
1719 | #define MII_TG3_AUX_STAT_LPASS 0x0004 | 1777 | #define MII_TG3_AUX_STAT_LPASS 0x0004 |
@@ -1743,6 +1801,20 @@ | |||
1743 | #define MII_TG3_INT_DUPLEXCHG 0x0008 | 1801 | #define MII_TG3_INT_DUPLEXCHG 0x0008 |
1744 | #define MII_TG3_INT_ANEG_PAGE_RX 0x0400 | 1802 | #define MII_TG3_INT_ANEG_PAGE_RX 0x0400 |
1745 | 1803 | ||
1804 | #define MII_TG3_MISC_SHDW 0x1c | ||
1805 | #define MII_TG3_MISC_SHDW_WREN 0x8000 | ||
1806 | #define MII_TG3_MISC_SHDW_SCR5_SEL 0x1400 | ||
1807 | #define MII_TG3_MISC_SHDW_APD_SEL 0x2800 | ||
1808 | |||
1809 | #define MII_TG3_MISC_SHDW_SCR5_C125OE 0x0001 | ||
1810 | #define MII_TG3_MISC_SHDW_SCR5_DLLAPD 0x0002 | ||
1811 | #define MII_TG3_MISC_SHDW_SCR5_SDTL 0x0004 | ||
1812 | #define MII_TG3_MISC_SHDW_SCR5_DLPTLM 0x0008 | ||
1813 | #define MII_TG3_MISC_SHDW_SCR5_LPED 0x0010 | ||
1814 | |||
1815 | #define MII_TG3_MISC_SHDW_APD_WKTM_84MS 0x0001 | ||
1816 | #define MII_TG3_MISC_SHDW_APD_ENABLE 0x0020 | ||
1817 | |||
1746 | #define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ | 1818 | #define MII_TG3_EPHY_TEST 0x1f /* 5906 PHY register */ |
1747 | #define MII_TG3_EPHY_SHADOW_EN 0x80 | 1819 | #define MII_TG3_EPHY_SHADOW_EN 0x80 |
1748 | 1820 | ||
@@ -2473,6 +2545,7 @@ struct tg3 { | |||
2473 | #define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ | 2545 | #define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */ |
2474 | 2546 | ||
2475 | u32 led_ctrl; | 2547 | u32 led_ctrl; |
2548 | u32 phy_otp; | ||
2476 | u16 pci_cmd; | 2549 | u16 pci_cmd; |
2477 | 2550 | ||
2478 | char board_part_number[24]; | 2551 | char board_part_number[24]; |