This functionality was previously provided by an AS7716-specific patch.

The changes are now controlled by module parameters and those modules parameters can be
specified by the platform when necessary.
This commit is contained in:
Jeffrey Townsend
2017-01-03 19:57:01 +00:00
parent f04f6e605f
commit 301b94a6b1
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
diff -urpN a/drivers/net/ethernet/broadcom/tg3/tg3.c b/drivers/net/ethernet/broadcom/tg3/tg3.c
--- a/drivers/net/ethernet/broadcom/tg3/tg3.c 2017-01-03 10:58:35.130883468 -0800
+++ b/drivers/net/ethernet/broadcom/tg3/tg3.c 2017-01-03 11:22:46.910914971 -0800
@@ -324,6 +324,14 @@ module_param(tg3_disable_eee, int, 0);
MODULE_PARM_DESC(tg3_disable_eee, "Disable Energy Efficient Ethernet (EEE) support");
#endif
+static int short_preamble = 0;
+module_param(short_preamble, int, 0);
+MODULE_PARM_DESC(short_preamble, "Enable short preamble.");
+
+static int bcm5718s_reset = 0;
+module_param(bcm5718s_reset, int, 0);
+MODULE_PARM_DESC(bcm5718s_reset, "Enable BCM5718S reset support.");
+
#define TG3_DRV_DATA_FLAG_10_100_ONLY 0x0001
#define TG3_DRV_DATA_FLAG_5705_10_100 0x0002
@@ -1628,6 +1635,12 @@ static void tg3_mdio_config_5785(struct
static void tg3_mdio_start(struct tg3 *tp)
{
tp->mi_mode &= ~MAC_MI_MODE_AUTO_POLL;
+
+ if(short_preamble) {
+ netdev_info(tp->dev, "Setting short preamble...");
+ tp->mi_mode |= MAC_MI_MODE_SHORT_PREAMBLE;
+ }
+
tw32_f(MAC_MI_MODE, tp->mi_mode);
udelay(80);
@@ -2899,6 +2911,12 @@ static int tg3_phy_reset(struct tg3 *tp)
}
}
+ if (bcm5718s_reset && tp->phy_id == TG3_PHY_ID_BCM5718S) {
+ netdev_info(tp->dev, "BCM5718S reset...");
+ __tg3_writephy(tp, 0x8, 0x10, 0x1d0); /* set internal phy 0x8 to make linkup */
+ __tg3_writephy(tp, 0x1f, 0x4, 0x5e1); /* enable 10/100 cability of external phy */
+ }
+
if (tg3_flag(tp, 5717_PLUS) &&
(tp->phy_flags & TG3_PHYFLG_MII_SERDES))
return 0;

View File

@@ -243,3 +243,4 @@ arch-intel-reboot-cf9-cold.patch
drivers-hwmon-adm1021-detect.patch
drivers-i2c-busses-i2c-isch-timeout.patch
CVE-2016-5195.patch
drivers-net-ethernet-broadcom-tg3-preamble-reset.patch