DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tomasz Duszynski <tduszynski@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>, Ray Kinsella <mdr@ashroe.eu>,
	Neil Horman <nhorman@tuxdriver.com>
Cc: <dev@dpdk.org>, Tomasz Duszynski <tduszynski@marvell.com>,
	Jakub Palider <jpalider@marvell.com>
Subject: [dpdk-dev] [PATCH v2 05/32] common/cnxk: support for changing ptp mode
Date: Tue, 15 Jun 2021 13:03:18 +0200	[thread overview]
Message-ID: <20210615110345.11057-6-tduszynski@marvell.com> (raw)
In-Reply-To: <20210615110345.11057-1-tduszynski@marvell.com>

Add support for enabling or disablig ptp mode.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Signed-off-by: Jakub Palider <jpalider@marvell.com>
---
 drivers/common/cnxk/roc_bphy_cgx.c      | 33 +++++++++++++++++++++++++
 drivers/common/cnxk/roc_bphy_cgx.h      |  5 ++++
 drivers/common/cnxk/roc_bphy_cgx_priv.h |  1 +
 drivers/common/cnxk/version.map         |  2 ++
 4 files changed, 41 insertions(+)

diff --git a/drivers/common/cnxk/roc_bphy_cgx.c b/drivers/common/cnxk/roc_bphy_cgx.c
index 004323968..ba86a7dab 100644
--- a/drivers/common/cnxk/roc_bphy_cgx.c
+++ b/drivers/common/cnxk/roc_bphy_cgx.c
@@ -231,6 +231,27 @@ roc_bphy_cgx_intlbk_ena_dis(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
 	return roc_bphy_cgx_intf_req(roc_cgx, lmac, scr1, &scr0);
 }
 
+static int
+roc_bphy_cgx_ptp_rx_ena_dis(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
+			    bool enable)
+{
+	uint64_t scr1, scr0;
+
+	if (roc_model_is_cn10k())
+		return -ENOTSUP;
+
+	if (!roc_cgx)
+		return -EINVAL;
+
+	if (!roc_bphy_cgx_lmac_exists(roc_cgx, lmac))
+		return -ENODEV;
+
+	scr1 = FIELD_PREP(SCR1_ETH_CMD_ID, ETH_CMD_SET_PTP_MODE) |
+	       FIELD_PREP(SCR1_ETH_CTL_ARGS_ENABLE, enable);
+
+	return roc_bphy_cgx_intf_req(roc_cgx, lmac, scr1, &scr0);
+}
+
 int
 roc_bphy_cgx_get_linkinfo(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
 			  struct roc_bphy_cgx_link_info *info)
@@ -273,3 +294,15 @@ roc_bphy_cgx_intlbk_disable(struct roc_bphy_cgx *roc_cgx, unsigned int lmac)
 {
 	return roc_bphy_cgx_intlbk_ena_dis(roc_cgx, lmac, false);
 }
+
+int
+roc_bphy_cgx_ptp_rx_enable(struct roc_bphy_cgx *roc_cgx, unsigned int lmac)
+{
+	return roc_bphy_cgx_ptp_rx_ena_dis(roc_cgx, lmac, true);
+}
+
+int
+roc_bphy_cgx_ptp_rx_disable(struct roc_bphy_cgx *roc_cgx, unsigned int lmac)
+{
+	return roc_bphy_cgx_ptp_rx_ena_dis(roc_cgx, lmac, false);
+}
diff --git a/drivers/common/cnxk/roc_bphy_cgx.h b/drivers/common/cnxk/roc_bphy_cgx.h
index 970122845..992e2d3ed 100644
--- a/drivers/common/cnxk/roc_bphy_cgx.h
+++ b/drivers/common/cnxk/roc_bphy_cgx.h
@@ -94,5 +94,10 @@ __roc_api int roc_bphy_cgx_intlbk_enable(struct roc_bphy_cgx *roc_cgx,
 					 unsigned int lmac);
 __roc_api int roc_bphy_cgx_intlbk_disable(struct roc_bphy_cgx *roc_cgx,
 					  unsigned int lmac);
+__roc_api int roc_bphy_cgx_ptp_rx_enable(struct roc_bphy_cgx *roc_cgx,
+					 unsigned int lmac);
+__roc_api int roc_bphy_cgx_ptp_rx_disable(struct roc_bphy_cgx *roc_cgx,
+					  unsigned int lmac);
+
 
 #endif /* _ROC_BPHY_CGX_H_ */
diff --git a/drivers/common/cnxk/roc_bphy_cgx_priv.h b/drivers/common/cnxk/roc_bphy_cgx_priv.h
index cb59cac09..4e86ae4ea 100644
--- a/drivers/common/cnxk/roc_bphy_cgx_priv.h
+++ b/drivers/common/cnxk/roc_bphy_cgx_priv.h
@@ -10,6 +10,7 @@ enum eth_cmd_id {
 	ETH_CMD_GET_LINK_STS = 4,
 	ETH_CMD_INTERNAL_LBK = 7,
 	ETH_CMD_INTF_SHUTDOWN = 12,
+	ETH_CMD_SET_PTP_MODE = 34,
 };
 
 /* event types - cause of interrupt */
diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map
index 71437a6c5..205a0602b 100644
--- a/drivers/common/cnxk/version.map
+++ b/drivers/common/cnxk/version.map
@@ -14,6 +14,8 @@ INTERNAL {
 	roc_bphy_cgx_get_linkinfo;
 	roc_bphy_cgx_intlbk_disable;
 	roc_bphy_cgx_intlbk_enable;
+	roc_bphy_cgx_ptp_rx_disable;
+	roc_bphy_cgx_ptp_rx_enable;
 	roc_clk_freq_get;
 	roc_error_msg_get;
 	roc_idev_lmt_base_addr_get;
-- 
2.25.1


  parent reply	other threads:[~2021-06-15 11:04 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 21:41 [dpdk-dev] [PATCH 00/28] add support for baseband phy Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 01/28] common/cnxk: add bphy cgx/rpm initialization and cleanup Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 02/28] common/cnxk: add support for communication with atf Tomasz Duszynski
2021-06-10  5:06   ` Jerin Jacob
2021-05-31 21:41 ` [dpdk-dev] [PATCH 03/28] common/cnxk: add support for getting link information Tomasz Duszynski
2021-06-10  5:09   ` Jerin Jacob
2021-05-31 21:41 ` [dpdk-dev] [PATCH 04/28] common/cnxk: add support for changing internal loopback Tomasz Duszynski
2021-06-10  6:19   ` Jerin Jacob
2021-05-31 21:41 ` [dpdk-dev] [PATCH 05/28] common/cnxk: add support for changing ptp mode Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 06/28] common/cnxk: add support for setting link mode Tomasz Duszynski
2021-06-10  6:21   ` Jerin Jacob
2021-05-31 21:41 ` [dpdk-dev] [PATCH 07/28] common/cnxk: add support for changing link state Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 08/28] common/cnxk: add support for lmac start/stop Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 09/28] raw/cnxk_bphy: add bphy cgx/rpm skeleton driver Tomasz Duszynski
2021-06-01  7:30   ` Thomas Monjalon
2021-06-10  6:40   ` Jerin Jacob
2021-05-31 21:41 ` [dpdk-dev] [PATCH 10/28] raw/cnxk_bphy: add support for reading queue configuration Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 11/28] raw/cnxk_bphy: add support for reading queue count Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 12/28] raw/cnxk_bphy: add support for enqueue operation Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 13/28] raw/cnxk_bphy: add support for dequeue operation Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 14/28] raw/cnxk_bphy: add support for performing selftest Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 15/28] common/cnxk: add support for device init and fini Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 16/28] common/cnxk: add support for baseband phy irq setup Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 17/28] common/cnxk: add support for checking irq availability Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 18/28] common/cnxk: add support for retrieving irq stack Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 19/28] common/cnxk: add support for removing " Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 20/28] common/cnxk: add support for setting bphy irq handler Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 21/28] common/cnxk: add support for clearing " Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 22/28] common/cnxk: add support for registering bphy irq Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 23/28] raw/cnxk_bphy: add baseband phy skeleton driver Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 24/28] raw/cnxk_bphy: add support for interrupt init and cleanup Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 25/28] raw/cnxk_bphy: add support for reading number of irqs Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 26/28] raw/cnxk_bphy: add support for retrieving device memory Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 27/28] raw/cnxk_bphy: add support for registering irq handlers Tomasz Duszynski
2021-05-31 21:41 ` [dpdk-dev] [PATCH 28/28] raw/cnxk_bphy: add support for selftest Tomasz Duszynski
2021-06-10  6:54 ` [dpdk-dev] [PATCH 00/28] add support for baseband phy Jerin Jacob
2021-06-15 11:03 ` [dpdk-dev] [PATCH v2 00/32] " Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 01/32] common/cnxk: add bphy cgx/rpm initialization and cleanup Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 02/32] common/cnxk: support for communication with atf Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 03/32] common/cnxk: support for getting link information Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 04/32] common/cnxk: support for changing internal loopback Tomasz Duszynski
2021-06-15 11:03   ` Tomasz Duszynski [this message]
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 06/32] common/cnxk: support for setting link mode Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 07/32] common/cnxk: support for changing link state Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 08/32] common/cnxk: support for lmac start/stop Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 09/32] raw/cnxk_bphy: add bphy cgx/rpm skeleton driver Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 10/32] raw/cnxk_bphy: support for reading queue configuration Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 11/32] raw/cnxk_bphy: support for reading queue count Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 12/32] raw/cnxk_bphy: support for enqueue operation Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 13/32] raw/cnxk_bphy: support for dequeue operation Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 14/32] raw/cnxk_bphy: support for performing selftest Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 15/32] common/cnxk: support for device init and fini Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 16/32] common/cnxk: support for baseband PHY irq setup Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 17/32] common/cnxk: support for checking irq availability Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 18/32] common/cnxk: support for retrieving irq stack Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 19/32] common/cnxk: support for removing " Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 20/32] common/cnxk: support for setting bphy irq handler Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 21/32] common/cnxk: support for clearing " Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 22/32] common/cnxk: support for registering bphy irq Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 23/32] raw/cnxk_bphy: add baseband PHY skeleton driver Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 24/32] raw/cnxk_bphy: support for reading bphy queue configuration Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 25/32] raw/cnxk_bphy: support for reading bphy queue count Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 26/32] raw/cnxk_bphy: support for bphy enqueue operation Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 27/32] raw/cnxk_bphy: support for bphy dequeue operation Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 28/32] raw/cnxk_bphy: support for interrupt init and cleanup Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 29/32] raw/cnxk_bphy: support for reading number of bphy irqs Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 30/32] raw/cnxk_bphy: support for retrieving bphy device memory Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 31/32] raw/cnxk_bphy: support for registering bphy irq handlers Tomasz Duszynski
2021-06-15 11:03   ` [dpdk-dev] [PATCH v2 32/32] raw/cnxk_bphy: support for bphy selftest Tomasz Duszynski
2021-06-21  8:43   ` [dpdk-dev] [PATCH v2 00/32] add support for baseband phy Jerin Jacob
2021-06-21 15:04 ` [dpdk-dev] [PATCH v3 " Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 01/32] common/cnxk: add bphy cgx/rpm initialization and cleanup Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 02/32] common/cnxk: support for communication with atf Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 03/32] common/cnxk: support for getting link information Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 04/32] common/cnxk: support for changing internal loopback Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 05/32] common/cnxk: support for changing ptp mode Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 06/32] common/cnxk: support for setting link mode Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 07/32] common/cnxk: support for changing link state Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 08/32] common/cnxk: support for lmac start/stop Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 09/32] raw/cnxk_bphy: add bphy cgx/rpm skeleton driver Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 10/32] raw/cnxk_bphy: support for reading queue configuration Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 11/32] raw/cnxk_bphy: support for reading queue count Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 12/32] raw/cnxk_bphy: support for enqueue operation Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 13/32] raw/cnxk_bphy: support for dequeue operation Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 14/32] raw/cnxk_bphy: support for performing selftest Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 15/32] common/cnxk: support for device init and fini Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 16/32] common/cnxk: support for baseband PHY irq setup Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 17/32] common/cnxk: support for checking irq availability Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 18/32] common/cnxk: support for retrieving irq stack Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 19/32] common/cnxk: support for removing " Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 20/32] common/cnxk: support for setting bphy irq handler Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 21/32] common/cnxk: support for clearing " Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 22/32] common/cnxk: support for registering bphy irq Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 23/32] raw/cnxk_bphy: add baseband PHY skeleton driver Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 24/32] raw/cnxk_bphy: support for reading bphy queue configuration Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 25/32] raw/cnxk_bphy: support for reading bphy queue count Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 26/32] raw/cnxk_bphy: support for bphy enqueue operation Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 27/32] raw/cnxk_bphy: support for bphy dequeue operation Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 28/32] raw/cnxk_bphy: support for interrupt init and cleanup Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 29/32] raw/cnxk_bphy: support for reading number of bphy irqs Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 30/32] raw/cnxk_bphy: support for retrieving bphy device memory Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 31/32] raw/cnxk_bphy: support for registering bphy irq handlers Tomasz Duszynski
2021-06-21 15:04   ` [dpdk-dev] [PATCH v3 32/32] raw/cnxk_bphy: support for bphy selftest Tomasz Duszynski
2021-07-05 21:12   ` [dpdk-dev] [PATCH v3 00/32] add support for baseband phy Thomas Monjalon

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=20210615110345.11057-6-tduszynski@marvell.com \
    --to=tduszynski@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jpalider@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=mdr@ashroe.eu \
    --cc=ndabilpuram@marvell.com \
    --cc=nhorman@tuxdriver.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.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).