aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2009-08-25 06:09:07 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-26 18:47:56 -0400
commitbb85fbb6a98d8edab81599913559c7ff0a963984 (patch)
tree3509fc3b02a48597f3dac4d5678db547e33f69a6 /drivers/net/tg3.c
parent5e7ccf2003e6a9c35b5aa24953ba5009a1a8b653 (diff)
tg3: Tune 5785 clock switching
This patch tunes the timeouts the CPMU uses to decide when to switch from the clocks output by the PHY to internal clock sources. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 9ae332083585..41e0d40259e3 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -917,7 +917,9 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
917 tw32(MAC_PHYCFG2, val); 917 tw32(MAC_PHYCFG2, val);
918 918
919 val = tr32(MAC_PHYCFG1); 919 val = tr32(MAC_PHYCFG1);
920 val &= ~MAC_PHYCFG1_RGMII_INT; 920 val &= ~(MAC_PHYCFG1_RGMII_INT |
921 MAC_PHYCFG1_RXCLK_TO_MASK | MAC_PHYCFG1_TXCLK_TO_MASK);
922 val |= MAC_PHYCFG1_RXCLK_TIMEOUT | MAC_PHYCFG1_TXCLK_TIMEOUT;
921 tw32(MAC_PHYCFG1, val); 923 tw32(MAC_PHYCFG1, val);
922 924
923 return; 925 return;
@@ -933,15 +935,18 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
933 935
934 tw32(MAC_PHYCFG2, val); 936 tw32(MAC_PHYCFG2, val);
935 937
936 val = tr32(MAC_PHYCFG1) & ~(MAC_PHYCFG1_RGMII_EXT_RX_DEC | 938 val = tr32(MAC_PHYCFG1);
937 MAC_PHYCFG1_RGMII_SND_STAT_EN); 939 val &= ~(MAC_PHYCFG1_RXCLK_TO_MASK | MAC_PHYCFG1_TXCLK_TO_MASK |
938 if (tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE) { 940 MAC_PHYCFG1_RGMII_EXT_RX_DEC | MAC_PHYCFG1_RGMII_SND_STAT_EN);
941 if (!(tp->tg3_flags3 & TG3_FLG3_RGMII_STD_IBND_DISABLE)) {
939 if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN) 942 if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_RX_EN)
940 val |= MAC_PHYCFG1_RGMII_EXT_RX_DEC; 943 val |= MAC_PHYCFG1_RGMII_EXT_RX_DEC;
941 if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_TX_EN) 944 if (tp->tg3_flags3 & TG3_FLG3_RGMII_EXT_IBND_TX_EN)
942 val |= MAC_PHYCFG1_RGMII_SND_STAT_EN; 945 val |= MAC_PHYCFG1_RGMII_SND_STAT_EN;
943 } 946 }
944 tw32(MAC_PHYCFG1, val | MAC_PHYCFG1_RGMII_INT | MAC_PHYCFG1_TXC_DRV); 947 val |= MAC_PHYCFG1_RXCLK_TIMEOUT | MAC_PHYCFG1_TXCLK_TIMEOUT |
948 MAC_PHYCFG1_RGMII_INT | MAC_PHYCFG1_TXC_DRV;
949 tw32(MAC_PHYCFG1, val);
945 950
946 val = tr32(MAC_EXT_RGMII_MODE); 951 val = tr32(MAC_EXT_RGMII_MODE);
947 val &= ~(MAC_RGMII_MODE_RX_INT_B | 952 val &= ~(MAC_RGMII_MODE_RX_INT_B |