[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210507085756.20427-5-yangbo.lu@nxp.com>
Date: Fri, 7 May 2021 16:57:54 +0800
From: Yangbo Lu <yangbo.lu@....com>
To: netdev@...r.kernel.org
Cc: Yangbo Lu <yangbo.lu@....com>,
"David S . Miller" <davem@...emloft.net>,
Richard Cochran <richardcochran@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Jakub Kicinski <kuba@...nel.org>
Subject: [net-next 4/6] enetc_ptp: support ptp virtual clock
Add support for ptp virtual clock.
Signed-off-by: Yangbo Lu <yangbo.lu@....com>
---
drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
index bc594892507a..52de736df800 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
@@ -10,6 +10,16 @@
int enetc_phc_index = -1;
EXPORT_SYMBOL(enetc_phc_index);
+struct ptp_vclock_cc ptp_qoriq_vclock_cc = {
+ .cc.read = ptp_qoriq_clock_read,
+ .cc.mask = CYCLECOUNTER_MASK(64),
+ .cc.shift = 28,
+ .cc.mult = (1 << 28),
+ .refresh_interval = (HZ * 60),
+ .mult_num = (1 << 6),
+ .mult_dem = 15625,
+};
+
static struct ptp_clock_info enetc_ptp_caps = {
.owner = THIS_MODULE,
.name = "ENETC PTP clock",
@@ -24,6 +34,7 @@ static struct ptp_clock_info enetc_ptp_caps = {
.gettime64 = ptp_qoriq_gettime,
.settime64 = ptp_qoriq_settime,
.enable = ptp_qoriq_enable,
+ .vclock_cc = &ptp_qoriq_vclock_cc,
};
static int enetc_ptp_probe(struct pci_dev *pdev,
--
2.25.1
Powered by blists - more mailing lists