From: Matt Carlson <mcarlson@broadcom.com>
Date: Mon, 12 Apr 2010 06:58:26 +0000 (+0000)
Subject: tg3: Reduce 57765 core clock when link at 10Mbps
X-Git-Tag: firefly_0821_release~9833^2~2087^2~511
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a977dbe8445b8a81d6127c4aa9112a2c29a1a008;p=firefly-linux-kernel-4.4.55.git

tg3: Reduce 57765 core clock when link at 10Mbps

This patch reduces the core clock to 6.25MHz when operating at 10Mbps
link speed.  This is needed to prevent a bug that will ultimately cause
transmits to cease.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a0ab89eb8bcc..3e893231fef3 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7654,6 +7654,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 		     val | TG3_PCIE_PL_LO_PHYCTL5_DIS_L2CLKREQ);
 
 		tw32(GRC_MODE, grc_mode);
+
+		val = tr32(TG3_CPMU_LSPD_10MB_CLK);
+		val &= ~CPMU_LSPD_10MB_MACCLK_MASK;
+		val |= CPMU_LSPD_10MB_MACCLK_6_25;
+		tw32(TG3_CPMU_LSPD_10MB_CLK, val);
 	}
 
 	/* This works around an issue with Athlon chipsets on