[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1560893778-6838-6-git-send-email-weifeng.voon@intel.com>
Date: Wed, 19 Jun 2019 05:36:18 +0800
From: Voon Weifeng <weifeng.voon@...el.com>
To: "David S. Miller" <davem@...emloft.net>,
Maxime Coquelin <mcoquelin.stm32@...il.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Jose Abreu <joabreu@...opsys.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Alexandre Torgue <alexandre.torgue@...com>,
Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Ong Boon Leong <boon.leong.ong@...el.com>,
Voon Weifeng <weifeng.voon@...el.com>
Subject: [RFC net-next 5/5] net: stmmac: Set TSN HW tunable after tsn setup
TSN HW tunable data for PTP Time Offset Value(PTOV),
Current Time Offset Value(CTOV) and Time Interval Shift
Amount(TILS) are added as platform data. These platform
data are set after tsn setup.
Signed-off-by: Voon Weifeng <weifeng.voon@...el.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 16 ++++++++++++++++
include/linux/stmmac.h | 3 +++
2 files changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a443c42fa58b..d3ce86abdc69 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2533,6 +2533,22 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
/* Setup for TSN capability */
dwmac_tsn_setup(priv->ioaddr);
+ /* Set TSN HW tunable */
+ if (priv->plat->ptov)
+ stmmac_set_tsn_hwtunable(priv, priv->ioaddr,
+ TSN_HWTUNA_TX_EST_PTOV,
+ &priv->plat->ptov);
+
+ if (priv->plat->ctov)
+ stmmac_set_tsn_hwtunable(priv, priv->ioaddr,
+ TSN_HWTUNA_TX_EST_CTOV,
+ &priv->plat->ctov);
+
+ if (priv->plat->tils)
+ stmmac_set_tsn_hwtunable(priv, priv->ioaddr,
+ TSN_HWTUNA_TX_EST_TILS,
+ &priv->plat->tils);
+
return 0;
}
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index d4a90f48e49b..792aa8b3e138 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -176,5 +176,8 @@ struct plat_stmmacenet_data {
int mac_port_sel_speed;
bool en_tx_lpi_clockgating;
int has_xgmac;
+ unsigned int ptov;
+ unsigned int ctov;
+ unsigned int tils;
};
#endif
--
1.9.1
Powered by blists - more mailing lists