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-12 21:23:56 +00:00
parent 4fcc589cbf
commit 71589bee68
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
diff -urpN a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
--- a/drivers/net/ethernet/broadcom/tg3.c 2016-11-20 01:17:41.000000000 +0000
+++ b/drivers/net/ethernet/broadcom/tg3.c 2017-01-12 20:49:40.051901568 +0000
@@ -234,6 +234,14 @@ static int tg3_debug = -1; /* -1 == use
module_param(tg3_debug, int, 0);
MODULE_PARM_DESC(tg3_debug, "Tigon3 bitmapped debugging message enable value");
+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
@@ -1485,6 +1493,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);
@@ -2689,6 +2703,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

@@ -20,3 +20,4 @@ driver-early-dma-allocator.patch
driver-esdhc-p2020-broken-timeout.patch
drivers-gpio-config-arch-nr-gpios.patch
driver-hwmon-emerson-update-pmbus-core.patch
drivers-net-ethernet-broadcom-tg3-preamble-reset.patch