Skip to content

Commit

Permalink
Add 2 parameters for driver tg3 can support "short preamble" and "res…
Browse files Browse the repository at this point in the history
…et". (#71)

* Add 2 parameters for tg3 can support "short preamble" and "reset".
Signed-off-by: roy_lee <roy_lee@accton.com>

* Remove extra log on enabling short-preambl.

Signed-off-by: roy_lee <roy_lee@accton.com>

* Remove extra log on enabling bcm5718s_reset.
Signed-off-by: roy_lee <roy_lee@accton.com>
  • Loading branch information
roylee123 authored and lguohan committed Nov 30, 2018
1 parent 3107549 commit ad754bd
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
56 changes: 56 additions & 0 deletions patch/driver-net-tg3-add-param-short-preamble-and-reset.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Subject: [PATCH] Add 2 more parameter for tg3.c.

1. short_preamble: Enable mdio traffic to external PHYs(i.g. BCM54616).
2. bcm5718s_reset: Enable BCM5718S reset support.

Signed-off-by: roy_lee <roy_lee@accton.com>
---
drivers/net/ethernet/broadcom/tg3.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index d658255..d31c395 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -234,6 +234,14 @@ static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */
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

@@ -1502,6 +1510,11 @@ static void tg3_mdio_config_5785(struct tg3 *tp)
static void tg3_mdio_start(struct tg3 *tp)
{
tp->mi_mode &= ~MAC_MI_MODE_AUTO_POLL;
+
+ if(short_preamble) {
+ tp->mi_mode |= MAC_MI_MODE_SHORT_PREAMBLE;
+ }
+
tw32_f(MAC_MI_MODE, tp->mi_mode);
udelay(80);

@@ -2704,6 +2717,11 @@ static int tg3_phy_reset(struct tg3 *tp)
}
}

+ if (bcm5718s_reset && tp->phy_id == TG3_PHY_ID_BCM5718S) {
+ __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;
--
2.1.4

1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ driver-support-optoe.patch
driver-support-optoe-EOF_fix.patch
driver-support-optoe-chunk-offset-fix.patch
bridge-add-per-port-broadcast-flood-flag.patch
driver-net-tg3-add-param-short-preamble-and-reset.patch
config-dell-s6000.patch
config-dell-z9100.patch
config-ingrasys-s9100.patch
Expand Down

0 comments on commit ad754bd

Please sign in to comment.