xref: /linux/drivers/net/ethernet/intel/ice/ice_ptp.h (revision fcd2c1e3139a27766ef263bd2011195dbc8a79f5)
106c16d89SJacob Keller /* SPDX-License-Identifier: GPL-2.0 */
206c16d89SJacob Keller /* Copyright (C) 2021, Intel Corporation. */
306c16d89SJacob Keller 
406c16d89SJacob Keller #ifndef _ICE_PTP_H_
506c16d89SJacob Keller #define _ICE_PTP_H_
606c16d89SJacob Keller 
706c16d89SJacob Keller #include <linux/ptp_clock_kernel.h>
877a78115SJacob Keller #include <linux/kthread.h>
906c16d89SJacob Keller 
1006c16d89SJacob Keller #include "ice_ptp_hw.h"
1106c16d89SJacob Keller 
12325b2064SMaciej Machnikowski enum ice_ptp_pin_e810 {
13172db5f9SMaciej Machnikowski 	GPIO_20 = 0,
14172db5f9SMaciej Machnikowski 	GPIO_21,
15172db5f9SMaciej Machnikowski 	GPIO_22,
16172db5f9SMaciej Machnikowski 	GPIO_23,
17325b2064SMaciej Machnikowski 	NUM_PTP_PIN_E810
18325b2064SMaciej Machnikowski };
19325b2064SMaciej Machnikowski 
20325b2064SMaciej Machnikowski enum ice_ptp_pin_e810t {
21325b2064SMaciej Machnikowski 	GNSS = 0,
22325b2064SMaciej Machnikowski 	SMA1,
23325b2064SMaciej Machnikowski 	UFL1,
24325b2064SMaciej Machnikowski 	SMA2,
25325b2064SMaciej Machnikowski 	UFL2,
26325b2064SMaciej Machnikowski 	NUM_PTP_PINS_E810T
27172db5f9SMaciej Machnikowski };
28172db5f9SMaciej Machnikowski 
29172db5f9SMaciej Machnikowski struct ice_perout_channel {
30172db5f9SMaciej Machnikowski 	bool ena;
31172db5f9SMaciej Machnikowski 	u32 gpio_pin;
32172db5f9SMaciej Machnikowski 	u64 period;
33172db5f9SMaciej Machnikowski 	u64 start_time;
34172db5f9SMaciej Machnikowski };
35172db5f9SMaciej Machnikowski 
36ea9b847cSJacob Keller /* The ice hardware captures Tx hardware timestamps in the PHY. The timestamp
37ea9b847cSJacob Keller  * is stored in a buffer of registers. Depending on the specific hardware,
38ea9b847cSJacob Keller  * this buffer might be shared across multiple PHY ports.
39ea9b847cSJacob Keller  *
40ea9b847cSJacob Keller  * On transmit of a packet to be timestamped, software is responsible for
41ea9b847cSJacob Keller  * selecting an open index. Hardware makes no attempt to lock or prevent
42ea9b847cSJacob Keller  * re-use of an index for multiple packets.
43ea9b847cSJacob Keller  *
44ea9b847cSJacob Keller  * To handle this, timestamp indexes must be tracked by software to ensure
45ea9b847cSJacob Keller  * that an index is not re-used for multiple transmitted packets. The
46ea9b847cSJacob Keller  * structures and functions declared in this file track the available Tx
47ea9b847cSJacob Keller  * register indexes, as well as provide storage for the SKB pointers.
48ea9b847cSJacob Keller  *
49ea9b847cSJacob Keller  * To allow multiple ports to access the shared register block independently,
50ea9b847cSJacob Keller  * the blocks are split up so that indexes are assigned to each port based on
51ea9b847cSJacob Keller  * hardware logical port number.
5271a579f0SMichal Michalik  *
5371a579f0SMichal Michalik  * The timestamp blocks are handled differently for E810- and E822-based
5471a579f0SMichal Michalik  * devices. In E810 devices, each port has its own block of timestamps, while in
5571a579f0SMichal Michalik  * E822 there is a need to logically break the block of registers into smaller
5671a579f0SMichal Michalik  * chunks based on the port number to avoid collisions.
5771a579f0SMichal Michalik  *
5871a579f0SMichal Michalik  * Example for port 5 in E810:
5971a579f0SMichal Michalik  *  +--------+--------+--------+--------+--------+--------+--------+--------+
6071a579f0SMichal Michalik  *  |register|register|register|register|register|register|register|register|
6171a579f0SMichal Michalik  *  | block  | block  | block  | block  | block  | block  | block  | block  |
6271a579f0SMichal Michalik  *  |  for   |  for   |  for   |  for   |  for   |  for   |  for   |  for   |
6371a579f0SMichal Michalik  *  | port 0 | port 1 | port 2 | port 3 | port 4 | port 5 | port 6 | port 7 |
6471a579f0SMichal Michalik  *  +--------+--------+--------+--------+--------+--------+--------+--------+
6571a579f0SMichal Michalik  *                                               ^^
6671a579f0SMichal Michalik  *                                               ||
6771a579f0SMichal Michalik  *                                               |---  quad offset is always 0
6871a579f0SMichal Michalik  *                                               ---- quad number
6971a579f0SMichal Michalik  *
7071a579f0SMichal Michalik  * Example for port 5 in E822:
7171a579f0SMichal Michalik  * +-----------------------------+-----------------------------+
7271a579f0SMichal Michalik  * |  register block for quad 0  |  register block for quad 1  |
7371a579f0SMichal Michalik  * |+------+------+------+------+|+------+------+------+------+|
7471a579f0SMichal Michalik  * ||port 0|port 1|port 2|port 3|||port 0|port 1|port 2|port 3||
7571a579f0SMichal Michalik  * |+------+------+------+------+|+------+------+------+------+|
7671a579f0SMichal Michalik  * +-----------------------------+-------^---------------------+
7771a579f0SMichal Michalik  *                                ^      |
7871a579f0SMichal Michalik  *                                |      --- quad offset*
7971a579f0SMichal Michalik  *                                ---- quad number
8071a579f0SMichal Michalik  *
8171a579f0SMichal Michalik  *   * PHY port 5 is port 1 in quad 1
8271a579f0SMichal Michalik  *
83ea9b847cSJacob Keller  */
84ea9b847cSJacob Keller 
85ea9b847cSJacob Keller /**
86ea9b847cSJacob Keller  * struct ice_tx_tstamp - Tracking for a single Tx timestamp
87ea9b847cSJacob Keller  * @skb: pointer to the SKB for this timestamp request
88ea9b847cSJacob Keller  * @start: jiffies when the timestamp was first requested
8937e738b6SKarol Kolacinski  * @cached_tstamp: last read timestamp
90ea9b847cSJacob Keller  *
91ea9b847cSJacob Keller  * This structure tracks a single timestamp request. The SKB pointer is
92ea9b847cSJacob Keller  * provided when initiating a request. The start time is used to ensure that
93ea9b847cSJacob Keller  * we discard old requests that were not fulfilled within a 2 second time
94ea9b847cSJacob Keller  * window.
9537e738b6SKarol Kolacinski  * Timestamp values in the PHY are read only and do not get cleared except at
9610e4b4a3SJacob Keller  * hardware reset or when a new timestamp value is captured.
9710e4b4a3SJacob Keller  *
9810e4b4a3SJacob Keller  * Some PHY types do not provide a "ready" bitmap indicating which timestamp
9910e4b4a3SJacob Keller  * indexes are valid. In these cases, we use a cached_tstamp to keep track of
10010e4b4a3SJacob Keller  * the last timestamp we read for a given index. If the current timestamp
10110e4b4a3SJacob Keller  * value is the same as the cached value, we assume a new timestamp hasn't
10210e4b4a3SJacob Keller  * been captured. This avoids reporting stale timestamps to the stack. This is
10310e4b4a3SJacob Keller  * only done if the verify_cached flag is set in ice_ptp_tx structure.
104ea9b847cSJacob Keller  */
105ea9b847cSJacob Keller struct ice_tx_tstamp {
106ea9b847cSJacob Keller 	struct sk_buff *skb;
107ea9b847cSJacob Keller 	unsigned long start;
10837e738b6SKarol Kolacinski 	u64 cached_tstamp;
109ea9b847cSJacob Keller };
110ea9b847cSJacob Keller 
111ea9b847cSJacob Keller /**
112ae39eb42SJacob Keller  * enum ice_tx_tstamp_work - Status of Tx timestamp work function
113ae39eb42SJacob Keller  * @ICE_TX_TSTAMP_WORK_DONE: Tx timestamp processing is complete
114ae39eb42SJacob Keller  * @ICE_TX_TSTAMP_WORK_PENDING: More Tx timestamps are pending
115ae39eb42SJacob Keller  */
116ae39eb42SJacob Keller enum ice_tx_tstamp_work {
117ae39eb42SJacob Keller 	ICE_TX_TSTAMP_WORK_DONE = 0,
118ae39eb42SJacob Keller 	ICE_TX_TSTAMP_WORK_PENDING,
119ae39eb42SJacob Keller };
120ae39eb42SJacob Keller 
121ae39eb42SJacob Keller /**
122ea9b847cSJacob Keller  * struct ice_ptp_tx - Tracking structure for all Tx timestamp requests on a port
1233ad5c10bSJacob Keller  * @lock: lock to prevent concurrent access to fields of this struct
124ea9b847cSJacob Keller  * @tstamps: array of len to store outstanding requests
125ea9b847cSJacob Keller  * @in_use: bitmap of len to indicate which slots are in use
126d40fd600SJacob Keller  * @stale: bitmap of len to indicate slots which have stale timestamps
1276b5cbc8cSSergey Temerkhanov  * @block: which memory block (quad or port) the timestamps are captured in
1286b5cbc8cSSergey Temerkhanov  * @offset: offset into timestamp block to get the real index
129ea9b847cSJacob Keller  * @len: length of the tstamps and in_use fields.
130ea9b847cSJacob Keller  * @init: if true, the tracker is initialized;
1313a749623SJacob Keller  * @calibrating: if true, the PHY is calibrating the Tx offset. During this
1323a749623SJacob Keller  *               window, timestamps are temporarily disabled.
13310e4b4a3SJacob Keller  * @verify_cached: if true, verify new timestamp differs from last read value
134ea9b847cSJacob Keller  */
135ea9b847cSJacob Keller struct ice_ptp_tx {
136ea9b847cSJacob Keller 	spinlock_t lock; /* lock protecting in_use bitmap */
137ea9b847cSJacob Keller 	struct ice_tx_tstamp *tstamps;
138ea9b847cSJacob Keller 	unsigned long *in_use;
139d40fd600SJacob Keller 	unsigned long *stale;
1406b5cbc8cSSergey Temerkhanov 	u8 block;
1416b5cbc8cSSergey Temerkhanov 	u8 offset;
142ea9b847cSJacob Keller 	u8 len;
14310e4b4a3SJacob Keller 	u8 init : 1;
14410e4b4a3SJacob Keller 	u8 calibrating : 1;
14510e4b4a3SJacob Keller 	u8 verify_cached : 1;
146ea9b847cSJacob Keller };
147ea9b847cSJacob Keller 
148ea9b847cSJacob Keller /* Quad and port information for initializing timestamp blocks */
149ea9b847cSJacob Keller #define INDEX_PER_QUAD			64
1506b5cbc8cSSergey Temerkhanov #define INDEX_PER_PORT_E822		16
1516b5cbc8cSSergey Temerkhanov #define INDEX_PER_PORT_E810		64
152ea9b847cSJacob Keller 
153ea9b847cSJacob Keller /**
154ea9b847cSJacob Keller  * struct ice_ptp_port - data used to initialize an external port for PTP
155ea9b847cSJacob Keller  *
1563a749623SJacob Keller  * This structure contains data indicating whether a single external port is
1573a749623SJacob Keller  * ready for PTP functionality. It is used to track the port initialization
1583a749623SJacob Keller  * and determine when the port's PHY offset is valid.
159ea9b847cSJacob Keller  *
160d938a8ccSMichal Michalik  * @list_member: list member structure of auxiliary device
161ea9b847cSJacob Keller  * @tx: Tx timestamp tracking for this port
162d938a8ccSMichal Michalik  * @aux_dev: auxiliary device associated with this port
163a69f1cb6SJacob Keller  * @ov_work: delayed work task for tracking when PHY offset is valid
1643a749623SJacob Keller  * @ps_lock: mutex used to protect the overall PTP PHY start procedure
1653a749623SJacob Keller  * @link_up: indicates whether the link is up
166a69f1cb6SJacob Keller  * @tx_fifo_busy_cnt: number of times the Tx FIFO was busy
1673a749623SJacob Keller  * @port_num: the port number this structure represents
168ea9b847cSJacob Keller  */
169ea9b847cSJacob Keller struct ice_ptp_port {
170d938a8ccSMichal Michalik 	struct list_head list_member;
171ea9b847cSJacob Keller 	struct ice_ptp_tx tx;
172d938a8ccSMichal Michalik 	struct auxiliary_device aux_dev;
173a69f1cb6SJacob Keller 	struct kthread_delayed_work ov_work;
1743a749623SJacob Keller 	struct mutex ps_lock; /* protects overall PTP PHY start procedure */
1753a749623SJacob Keller 	bool link_up;
176a69f1cb6SJacob Keller 	u8 tx_fifo_busy_cnt;
1773a749623SJacob Keller 	u8 port_num;
178ea9b847cSJacob Keller };
179ea9b847cSJacob Keller 
180d938a8ccSMichal Michalik enum ice_ptp_tx_interrupt {
181d938a8ccSMichal Michalik 	ICE_PTP_TX_INTERRUPT_NONE = 0,
182d938a8ccSMichal Michalik 	ICE_PTP_TX_INTERRUPT_SELF,
183d938a8ccSMichal Michalik 	ICE_PTP_TX_INTERRUPT_ALL,
184d938a8ccSMichal Michalik };
185d938a8ccSMichal Michalik 
186d938a8ccSMichal Michalik /**
187d938a8ccSMichal Michalik  * struct ice_ptp_port_owner - data used to handle the PTP clock owner info
188d938a8ccSMichal Michalik  *
189d938a8ccSMichal Michalik  * This structure contains data necessary for the PTP clock owner to correctly
190d938a8ccSMichal Michalik  * handle the timestamping feature for all attached ports.
191d938a8ccSMichal Michalik  *
192d938a8ccSMichal Michalik  * @aux_driver: the structure carring the auxiliary driver information
193d938a8ccSMichal Michalik  * @ports: list of porst handled by this port owner
194d938a8ccSMichal Michalik  * @lock: protect access to ports list
195d938a8ccSMichal Michalik  */
196d938a8ccSMichal Michalik struct ice_ptp_port_owner {
197d938a8ccSMichal Michalik 	struct auxiliary_driver aux_driver;
198d938a8ccSMichal Michalik 	struct list_head ports;
199d938a8ccSMichal Michalik 	struct mutex lock;
200d938a8ccSMichal Michalik };
201d938a8ccSMichal Michalik 
202172db5f9SMaciej Machnikowski #define GLTSYN_TGT_H_IDX_MAX		4
203172db5f9SMaciej Machnikowski 
20406c16d89SJacob Keller /**
20506c16d89SJacob Keller  * struct ice_ptp - data used for integrating with CONFIG_PTP_1588_CLOCK
206d938a8ccSMichal Michalik  * @tx_interrupt_mode: the TX interrupt mode for the PTP clock
207ea9b847cSJacob Keller  * @port: data for the PHY port initialization procedure
208d938a8ccSMichal Michalik  * @ports_owner: data for the auxiliary driver owner
20977a78115SJacob Keller  * @work: delayed work function for periodic tasks
21077a78115SJacob Keller  * @cached_phc_time: a cached copy of the PHC time for timestamp extension
211cd25507aSJacob Keller  * @cached_phc_jiffies: jiffies when cached_phc_time was last updated
212172db5f9SMaciej Machnikowski  * @ext_ts_chan: the external timestamp channel in use
213172db5f9SMaciej Machnikowski  * @ext_ts_irq: the external timestamp IRQ in use
21477a78115SJacob Keller  * @kworker: kwork thread for handling periodic work
215172db5f9SMaciej Machnikowski  * @perout_channels: periodic output data
21606c16d89SJacob Keller  * @info: structure defining PTP hardware capabilities
21706c16d89SJacob Keller  * @clock: pointer to registered PTP clock device
21877a78115SJacob Keller  * @tstamp_config: hardware timestamping configuration
21948096710SKarol Kolacinski  * @reset_time: kernel time after clock stop on reset
220f020481bSJacob Keller  * @tx_hwtstamp_skipped: number of Tx time stamp requests skipped
221f020481bSJacob Keller  * @tx_hwtstamp_timeouts: number of Tx skbs discarded with no time stamp
222f020481bSJacob Keller  * @tx_hwtstamp_flushed: number of Tx skbs flushed due to interface closed
223cd25507aSJacob Keller  * @tx_hwtstamp_discarded: number of Tx skbs discarded due to cached PHC time
224cd25507aSJacob Keller  *                         being too old to correctly extend timestamp
225cd25507aSJacob Keller  * @late_cached_phc_updates: number of times cached PHC update is late
22606c16d89SJacob Keller  */
22706c16d89SJacob Keller struct ice_ptp {
228d938a8ccSMichal Michalik 	enum ice_ptp_tx_interrupt tx_interrupt_mode;
229ea9b847cSJacob Keller 	struct ice_ptp_port port;
230d938a8ccSMichal Michalik 	struct ice_ptp_port_owner ports_owner;
23177a78115SJacob Keller 	struct kthread_delayed_work work;
23277a78115SJacob Keller 	u64 cached_phc_time;
233cd25507aSJacob Keller 	unsigned long cached_phc_jiffies;
234172db5f9SMaciej Machnikowski 	u8 ext_ts_chan;
235172db5f9SMaciej Machnikowski 	u8 ext_ts_irq;
23677a78115SJacob Keller 	struct kthread_worker *kworker;
237172db5f9SMaciej Machnikowski 	struct ice_perout_channel perout_channels[GLTSYN_TGT_H_IDX_MAX];
23806c16d89SJacob Keller 	struct ptp_clock_info info;
23906c16d89SJacob Keller 	struct ptp_clock *clock;
24077a78115SJacob Keller 	struct hwtstamp_config tstamp_config;
24148096710SKarol Kolacinski 	u64 reset_time;
242f020481bSJacob Keller 	u32 tx_hwtstamp_skipped;
243f020481bSJacob Keller 	u32 tx_hwtstamp_timeouts;
244f020481bSJacob Keller 	u32 tx_hwtstamp_flushed;
245cd25507aSJacob Keller 	u32 tx_hwtstamp_discarded;
246cd25507aSJacob Keller 	u32 late_cached_phc_updates;
24706c16d89SJacob Keller };
24806c16d89SJacob Keller 
249ea9b847cSJacob Keller #define __ptp_port_to_ptp(p) \
250ea9b847cSJacob Keller 	container_of((p), struct ice_ptp, port)
251ea9b847cSJacob Keller #define ptp_port_to_pf(p) \
252ea9b847cSJacob Keller 	container_of(__ptp_port_to_ptp((p)), struct ice_pf, ptp)
253ea9b847cSJacob Keller 
25406c16d89SJacob Keller #define __ptp_info_to_ptp(i) \
25506c16d89SJacob Keller 	container_of((i), struct ice_ptp, info)
25606c16d89SJacob Keller #define ptp_info_to_pf(i) \
25706c16d89SJacob Keller 	container_of(__ptp_info_to_ptp((i)), struct ice_pf, ptp)
25806c16d89SJacob Keller 
2593a749623SJacob Keller #define PFTSYN_SEM_BYTES		4
26006c16d89SJacob Keller #define PTP_SHARED_CLK_IDX_VALID	BIT(31)
2613a749623SJacob Keller #define TS_CMD_MASK			0xF
2623a749623SJacob Keller #define SYNC_EXEC_CMD			0x3
26377a78115SJacob Keller #define ICE_PTP_TS_VALID		BIT(0)
26406c16d89SJacob Keller 
2653a749623SJacob Keller #define FIFO_EMPTY			BIT(2)
2663a749623SJacob Keller #define FIFO_OK				0xFF
2673a749623SJacob Keller #define ICE_PTP_FIFO_NUM_CHECKS		5
268172db5f9SMaciej Machnikowski /* Per-channel register definitions */
269172db5f9SMaciej Machnikowski #define GLTSYN_AUX_OUT(_chan, _idx)	(GLTSYN_AUX_OUT_0(_idx) + ((_chan) * 8))
270172db5f9SMaciej Machnikowski #define GLTSYN_AUX_IN(_chan, _idx)	(GLTSYN_AUX_IN_0(_idx) + ((_chan) * 8))
271172db5f9SMaciej Machnikowski #define GLTSYN_CLKO(_chan, _idx)	(GLTSYN_CLKO_0(_idx) + ((_chan) * 8))
272172db5f9SMaciej Machnikowski #define GLTSYN_TGT_L(_chan, _idx)	(GLTSYN_TGT_L_0(_idx) + ((_chan) * 16))
273172db5f9SMaciej Machnikowski #define GLTSYN_TGT_H(_chan, _idx)	(GLTSYN_TGT_H_0(_idx) + ((_chan) * 16))
274172db5f9SMaciej Machnikowski #define GLTSYN_EVNT_L(_chan, _idx)	(GLTSYN_EVNT_L_0(_idx) + ((_chan) * 16))
275172db5f9SMaciej Machnikowski #define GLTSYN_EVNT_H(_chan, _idx)	(GLTSYN_EVNT_H_0(_idx) + ((_chan) * 16))
276172db5f9SMaciej Machnikowski #define GLTSYN_EVNT_H_IDX_MAX		3
277172db5f9SMaciej Machnikowski 
278172db5f9SMaciej Machnikowski /* Pin definitions for PTP PPS out */
279172db5f9SMaciej Machnikowski #define PPS_CLK_GEN_CHAN		3
280172db5f9SMaciej Machnikowski #define PPS_CLK_SRC_CHAN		2
281172db5f9SMaciej Machnikowski #define PPS_PIN_INDEX			5
282172db5f9SMaciej Machnikowski #define TIME_SYNC_PIN_INDEX		4
283325b2064SMaciej Machnikowski #define N_EXT_TS_E810			3
284325b2064SMaciej Machnikowski #define N_PER_OUT_E810			4
285325b2064SMaciej Machnikowski #define N_PER_OUT_E810T			3
28643c4958aSArkadiusz Kubalewski #define N_PER_OUT_NO_SMA_E810T		2
28743c4958aSArkadiusz Kubalewski #define N_EXT_TS_NO_SMA_E810T		2
2883a749623SJacob Keller #define ETH_GLTSYN_ENA(_i)		(0x03000348 + ((_i) * 4))
289172db5f9SMaciej Machnikowski 
29006c16d89SJacob Keller #if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
291*fcd2c1e3SMichal Michalik int ice_ptp_clock_index(struct ice_pf *pf);
29206c16d89SJacob Keller struct ice_pf;
29377a78115SJacob Keller int ice_ptp_set_ts_config(struct ice_pf *pf, struct ifreq *ifr);
29477a78115SJacob Keller int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr);
29548096710SKarol Kolacinski void ice_ptp_cfg_timestamp(struct ice_pf *pf, bool ena);
296ea9b847cSJacob Keller 
2976e8b2c88SKarol Kolacinski void ice_ptp_extts_event(struct ice_pf *pf);
298ea9b847cSJacob Keller s8 ice_ptp_request_ts(struct ice_ptp_tx *tx, struct sk_buff *skb);
299ae39eb42SJacob Keller enum ice_tx_tstamp_work ice_ptp_process_ts(struct ice_pf *pf);
300ea9b847cSJacob Keller 
30177a78115SJacob Keller void
302e72bba21SMaciej Fijalkowski ice_ptp_rx_hwtstamp(struct ice_rx_ring *rx_ring,
30377a78115SJacob Keller 		    union ice_32b_rx_flex_desc *rx_desc, struct sk_buff *skb);
30448096710SKarol Kolacinski void ice_ptp_reset(struct ice_pf *pf);
30548096710SKarol Kolacinski void ice_ptp_prepare_for_reset(struct ice_pf *pf);
30606c16d89SJacob Keller void ice_ptp_init(struct ice_pf *pf);
30706c16d89SJacob Keller void ice_ptp_release(struct ice_pf *pf);
3086b1ff5d3SJacob Keller void ice_ptp_link_change(struct ice_pf *pf, u8 port, bool linkup);
30906c16d89SJacob Keller #else /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
31077a78115SJacob Keller static inline int ice_ptp_set_ts_config(struct ice_pf *pf, struct ifreq *ifr)
31177a78115SJacob Keller {
31277a78115SJacob Keller 	return -EOPNOTSUPP;
31377a78115SJacob Keller }
31477a78115SJacob Keller 
31577a78115SJacob Keller static inline int ice_ptp_get_ts_config(struct ice_pf *pf, struct ifreq *ifr)
31677a78115SJacob Keller {
31777a78115SJacob Keller 	return -EOPNOTSUPP;
31877a78115SJacob Keller }
31977a78115SJacob Keller 
32048096710SKarol Kolacinski static inline void ice_ptp_cfg_timestamp(struct ice_pf *pf, bool ena) { }
32177a78115SJacob Keller 
3226e8b2c88SKarol Kolacinski static inline void ice_ptp_extts_event(struct ice_pf *pf) { }
3234d7f75feSLorenzo Bianconi static inline s8
324ea9b847cSJacob Keller ice_ptp_request_ts(struct ice_ptp_tx *tx, struct sk_buff *skb)
325ea9b847cSJacob Keller {
326ea9b847cSJacob Keller 	return -1;
327ea9b847cSJacob Keller }
328ea9b847cSJacob Keller 
3291229b339SKarol Kolacinski static inline bool ice_ptp_process_ts(struct ice_pf *pf)
3301229b339SKarol Kolacinski {
3311229b339SKarol Kolacinski 	return true;
3321229b339SKarol Kolacinski }
33377a78115SJacob Keller static inline void
334e72bba21SMaciej Fijalkowski ice_ptp_rx_hwtstamp(struct ice_rx_ring *rx_ring,
33577a78115SJacob Keller 		    union ice_32b_rx_flex_desc *rx_desc, struct sk_buff *skb) { }
33648096710SKarol Kolacinski static inline void ice_ptp_reset(struct ice_pf *pf) { }
33748096710SKarol Kolacinski static inline void ice_ptp_prepare_for_reset(struct ice_pf *pf) { }
33806c16d89SJacob Keller static inline void ice_ptp_init(struct ice_pf *pf) { }
33906c16d89SJacob Keller static inline void ice_ptp_release(struct ice_pf *pf) { }
3406b1ff5d3SJacob Keller static inline void ice_ptp_link_change(struct ice_pf *pf, u8 port, bool linkup)
3416b1ff5d3SJacob Keller {
3426b1ff5d3SJacob Keller }
343*fcd2c1e3SMichal Michalik 
344*fcd2c1e3SMichal Michalik static inline int ice_ptp_clock_index(struct ice_pf *pf)
345*fcd2c1e3SMichal Michalik {
346*fcd2c1e3SMichal Michalik 	return -1;
347*fcd2c1e3SMichal Michalik }
34806c16d89SJacob Keller #endif /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
34906c16d89SJacob Keller #endif /* _ICE_PTP_H_ */
350