Some of the newer silicon versions in CN10K series supports a feature where in the current PTP timestamp in HW can be updated atomically without losing any cpu cycles unlike read/modify/write register. This patch uses this feature so that PTP accuracy can be improved while adjusting the master offset in HW. There is no need for SW timecounter when using this feature. So removed references to SW timecounter wherever appropriate. Signed-off-by: Sai Krishna <saikrishnag@marvell.com> Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
33 lines
624 B
C
33 lines
624 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Marvell PTP driver
|
|
*
|
|
* Copyright (C) 2020 Marvell.
|
|
*
|
|
*/
|
|
|
|
#ifndef PTP_H
|
|
#define PTP_H
|
|
|
|
#include <linux/timecounter.h>
|
|
#include <linux/time64.h>
|
|
#include <linux/spinlock.h>
|
|
|
|
struct ptp {
|
|
struct pci_dev *pdev;
|
|
void __iomem *reg_base;
|
|
u64 (*read_ptp_tstmp)(struct ptp *ptp);
|
|
spinlock_t ptp_lock; /* lock */
|
|
struct hrtimer hrtimer;
|
|
ktime_t last_ts;
|
|
u32 clock_rate;
|
|
u32 clock_period;
|
|
};
|
|
|
|
struct rvu;
|
|
struct ptp *ptp_get(void);
|
|
void ptp_put(struct ptp *ptp);
|
|
void ptp_start(struct rvu *rvu, u64 sclk, u32 ext_clk_freq, u32 extts);
|
|
|
|
extern struct pci_driver ptp_driver;
|
|
|
|
#endif
|