1/* SPDX-License-Identifier: GPL-2.0 */
2/* Marvell PTP driver
3 *
4 * Copyright (C) 2020 Marvell.
5 *
6 */
7
8#ifndef PTP_H
9#define PTP_H
10
11#include <linux/timecounter.h>
12#include <linux/time64.h>
13#include <linux/spinlock.h>
14
15struct ptp {
16 struct pci_dev *pdev;
17 void __iomem *reg_base;
18 u64 (*read_ptp_tstmp)(struct ptp *ptp);
19 spinlock_t ptp_lock; /* lock */
20 struct hrtimer hrtimer;
21 ktime_t last_ts;
22 u32 clock_rate;
23 u32 clock_period;
24};
25
26struct rvu;
27struct ptp *ptp_get(void);
28void ptp_put(struct ptp *ptp);
29void ptp_start(struct rvu *rvu, u64 sclk, u32 ext_clk_freq, u32 extts);
30
31extern struct pci_driver ptp_driver;
32
33#endif
34

source code of linux/drivers/net/ethernet/marvell/octeontx2/af/ptp.h