aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2011-01-25 10:58:55 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-25 22:38:20 -0500
commit21a00ab270f95d32e502d92f166dd75c518d3c5f (patch)
treebb2343a3793dabc3711db3f82a78fa3c19ce0892 /drivers/net
parentab78904608bd6e421b81420e4d2f7d5bae9d4660 (diff)
tg3: Fix EEE interoperability issue
This patch fixes a problem where EEE will fail to work in certain environments. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tg3.c42
-rw-r--r--drivers/net/tg3.h4
2 files changed, 39 insertions, 7 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index c333481deb1f..f2b6257b9ef6 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1776,9 +1776,29 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
1776 tg3_phy_cl45_read(tp, MDIO_MMD_AN, 1776 tg3_phy_cl45_read(tp, MDIO_MMD_AN,
1777 TG3_CL45_D7_EEERES_STAT, &val); 1777 TG3_CL45_D7_EEERES_STAT, &val);
1778 1778
1779 if (val == TG3_CL45_D7_EEERES_STAT_LP_1000T || 1779 switch (val) {
1780 val == TG3_CL45_D7_EEERES_STAT_LP_100TX) 1780 case TG3_CL45_D7_EEERES_STAT_LP_1000T:
1781 switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
1782 case ASIC_REV_5717:
1783 case ASIC_REV_5719:
1784 case ASIC_REV_57765:
1785 /* Enable SM_DSP clock and tx 6dB coding. */
1786 val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
1787 MII_TG3_AUXCTL_ACTL_SMDSP_ENA |
1788 MII_TG3_AUXCTL_ACTL_TX_6DB;
1789 tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
1790
1791 tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0000);
1792
1793 /* Turn off SM_DSP clock. */
1794 val = MII_TG3_AUXCTL_SHDWSEL_AUXCTL |
1795 MII_TG3_AUXCTL_ACTL_TX_6DB;
1796 tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
1797 }
1798 /* Fallthrough */
1799 case TG3_CL45_D7_EEERES_STAT_LP_100TX:
1781 tp->setlpicnt = 2; 1800 tp->setlpicnt = 2;
1801 }
1782 } 1802 }
1783 1803
1784 if (!tp->setlpicnt) { 1804 if (!tp->setlpicnt) {
@@ -2968,11 +2988,19 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
2968 MII_TG3_AUXCTL_ACTL_TX_6DB; 2988 MII_TG3_AUXCTL_ACTL_TX_6DB;
2969 tg3_writephy(tp, MII_TG3_AUX_CTRL, val); 2989 tg3_writephy(tp, MII_TG3_AUX_CTRL, val);
2970 2990
2971 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 || 2991 switch (GET_ASIC_REV(tp->pci_chip_rev_id)) {
2972 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) && 2992 case ASIC_REV_5717:
2973 !tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val)) 2993 case ASIC_REV_57765:
2974 tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, 2994 if (!tg3_phydsp_read(tp, MII_TG3_DSP_CH34TP2, &val))
2975 val | MII_TG3_DSP_CH34TP2_HIBW01); 2995 tg3_phydsp_write(tp, MII_TG3_DSP_CH34TP2, val |
2996 MII_TG3_DSP_CH34TP2_HIBW01);
2997 /* Fall through */
2998 case ASIC_REV_5719:
2999 val = MII_TG3_DSP_TAP26_ALNOKO |
3000 MII_TG3_DSP_TAP26_RMRXSTO |
3001 MII_TG3_DSP_TAP26_OPCSINPT;
3002 tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, val);
3003 }
2976 3004
2977 val = 0; 3005 val = 0;
2978 if (tp->link_config.autoneg == AUTONEG_ENABLE) { 3006 if (tp->link_config.autoneg == AUTONEG_ENABLE) {
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index fc8ecdd7c859..1dbe5eca6fed 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2113,6 +2113,10 @@
2113 2113
2114#define MII_TG3_DSP_TAP1 0x0001 2114#define MII_TG3_DSP_TAP1 0x0001
2115#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007 2115#define MII_TG3_DSP_TAP1_AGCTGT_DFLT 0x0007
2116#define MII_TG3_DSP_TAP26 0x001a
2117#define MII_TG3_DSP_TAP26_ALNOKO 0x0001
2118#define MII_TG3_DSP_TAP26_RMRXSTO 0x0002
2119#define MII_TG3_DSP_TAP26_OPCSINPT 0x0004
2116#define MII_TG3_DSP_AADJ1CH0 0x001f 2120#define MII_TG3_DSP_AADJ1CH0 0x001f
2117#define MII_TG3_DSP_CH34TP2 0x4022 2121#define MII_TG3_DSP_CH34TP2 0x4022
2118#define MII_TG3_DSP_CH34TP2_HIBW01 0x0010 2122#define MII_TG3_DSP_CH34TP2_HIBW01 0x0010