netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Voon Weifeng <weifeng.voon@intel.com>
To: "David S. Miller" <davem@davemloft.net>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jose Abreu <joabreu@synopsys.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Ong Boon Leong <boon.leong.ong@intel.com>,
	Voon Weifeng <weifeng.voon@intel.com>
Subject: [RFC net-next 5/5] net: stmmac: Set TSN HW tunable after tsn setup
Date: Wed, 19 Jun 2019 05:36:18 +0800	[thread overview]
Message-ID: <1560893778-6838-6-git-send-email-weifeng.voon@intel.com> (raw)
In-Reply-To: <1560893778-6838-1-git-send-email-weifeng.voon@intel.com>

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@intel.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


      parent reply	other threads:[~2019-06-18 13:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18 21:36 [RFC net-next 0/5] net: stmmac: Introducing IEEE802.1Qbv feature Voon Weifeng
2019-06-18 21:36 ` [RFC net-next 1/5] net: stmmac: introduce IEEE 802.1Qbv configuration functionalities Voon Weifeng
2019-06-19  3:07   ` Andrew Lunn
2019-06-19  8:48     ` Voon, Weifeng
2019-06-19 12:44       ` Andrew Lunn
2019-06-20  3:14         ` Ong, Boon Leong
2019-06-19 18:12   ` Vinicius Costa Gomes
2019-06-20  3:37     ` Ong, Boon Leong
2019-06-27 12:21   ` Jose Abreu
2019-06-27 23:08     ` Ong, Boon Leong
2019-06-18 21:36 ` [RFC net-next 2/5] net: stmmac: gcl errors reporting and its interrupt handling Voon Weifeng
2019-06-18 21:36 ` [RFC net-next 3/5] taprio: Add support for hardware offloading Voon Weifeng
2019-06-18 21:36 ` [RFC net-next 4/5] net: stmmac: enable HW offloading for tc taprio Voon Weifeng
2019-06-18 21:36 ` Voon Weifeng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560893778-6838-6-git-send-email-weifeng.voon@intel.com \
    --to=weifeng.voon@intel.com \
    --cc=alexandre.torgue@st.com \
    --cc=andrew@lunn.ch \
    --cc=boon.leong.ong@intel.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=joabreu@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=vinicius.gomes@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).