1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2018-2021, Intel Corporation. */
4 #ifndef _ICE_PTP_CONSTS_H_
5 #define _ICE_PTP_CONSTS_H_
7 /* Constant definitions related to the hardware clock used for PTP 1588
8 * features and functionality.
10 /* Constants defined for the PTP 1588 clock hardware. */
12 /* struct ice_time_ref_info_e822
14 * E822 hardware can use different sources as the reference for the PTP
15 * hardware clock. Each clock has different characteristics such as a slightly
16 * different frequency, etc.
18 * This lookup table defines several constants that depend on the current time
19 * reference. See the struct ice_time_ref_info_e822 for information about the
20 * meaning of each constant.
22 const struct ice_time_ref_info_e822 e822_time_ref[NUM_ICE_TIME_REF_FREQ] = {
23 /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */
26 823437500, /* 823.4375 MHz PLL */
33 /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */
36 783360000, /* 783.36 MHz */
43 /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */
46 796875000, /* 796.875 MHz */
53 /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */
56 816000000, /* 816 MHz */
63 /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */
66 830078125, /* 830.78125 MHz */
73 /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */
76 783360000, /* 783.36 MHz */
84 const struct ice_cgu_pll_params_e822 e822_cgu_params[NUM_ICE_TIME_REF_FREQ] = {
85 /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */
97 /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */
109 /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */
121 /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */
133 /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */
145 /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */
158 /* struct ice_vernier_info_e822
160 * E822 hardware calibrates the delay of the timestamp indication from the
161 * actual packet transmission or reception during the initialization of the
162 * PHY. To do this, the hardware mechanism uses some conversions between the
163 * various clocks within the PHY block. This table defines constants used to
164 * calculate the correct conversion ratios in the PHY registers.
166 * Many of the values relate to the PAR/PCS clock conversion registers. For
167 * these registers, a value of 0 means that the associated register is not
168 * used by this link speed, and that the register should be cleared by writing
169 * 0. Other values specify the clock frequency in Hz.
171 const struct ice_vernier_info_e822 e822_vernier[NUM_ICE_PTP_LNK_SPD] = {
172 /* ICE_PTP_LNK_SPD_1G */
175 31250000, /* 31.25 MHz */
177 31250000, /* 31.25 MHz */
179 125000000, /* 125 MHz */
181 125000000, /* 125 MHz */
182 /* tx_desk_rsgb_par */
184 /* rx_desk_rsgb_par */
186 /* tx_desk_rsgb_pcs */
188 /* rx_desk_rsgb_pcs */
192 /* pmd_adj_divisor */
197 /* ICE_PTP_LNK_SPD_10G */
200 257812500, /* 257.8125 MHz */
202 257812500, /* 257.8125 MHz */
204 156250000, /* 156.25 MHz */
206 156250000, /* 156.25 MHz */
207 /* tx_desk_rsgb_par */
209 /* rx_desk_rsgb_par */
211 /* tx_desk_rsgb_pcs */
213 /* rx_desk_rsgb_pcs */
217 /* pmd_adj_divisor */
222 /* ICE_PTP_LNK_SPD_25G */
225 644531250, /* 644.53125 MHZ */
227 644531250, /* 644.53125 MHz */
229 390625000, /* 390.625 MHz */
231 390625000, /* 390.625 MHz */
232 /* tx_desk_rsgb_par */
234 /* rx_desk_rsgb_par */
236 /* tx_desk_rsgb_pcs */
238 /* rx_desk_rsgb_pcs */
242 /* pmd_adj_divisor */
247 /* ICE_PTP_LNK_SPD_25G_RS */
257 /* tx_desk_rsgb_par */
258 161132812, /* 162.1328125 MHz Reed Solomon gearbox */
259 /* rx_desk_rsgb_par */
260 161132812, /* 162.1328125 MHz Reed Solomon gearbox */
261 /* tx_desk_rsgb_pcs */
262 97656250, /* 97.62625 MHz Reed Solomon gearbox */
263 /* rx_desk_rsgb_pcs */
264 97656250, /* 97.62625 MHz Reed Solomon gearbox */
267 /* pmd_adj_divisor */
272 /* ICE_PTP_LNK_SPD_40G */
279 156250000, /* 156.25 MHz */
281 156250000, /* 156.25 MHz */
282 /* tx_desk_rsgb_par */
284 /* rx_desk_rsgb_par */
285 156250000, /* 156.25 MHz deskew clock */
286 /* tx_desk_rsgb_pcs */
288 /* rx_desk_rsgb_pcs */
289 156250000, /* 156.25 MHz deskew clock */
292 /* pmd_adj_divisor */
297 /* ICE_PTP_LNK_SPD_50G */
300 644531250, /* 644.53125 MHZ */
302 644531250, /* 644.53125 MHZ */
304 390625000, /* 390.625 MHz */
306 390625000, /* 390.625 MHz */
307 /* tx_desk_rsgb_par */
309 /* rx_desk_rsgb_par */
310 195312500, /* 193.3125 MHz deskew clock */
311 /* tx_desk_rsgb_pcs */
313 /* rx_desk_rsgb_pcs */
314 195312500, /* 193.3125 MHz deskew clock */
317 /* pmd_adj_divisor */
322 /* ICE_PTP_LNK_SPD_50G_RS */
327 644531250, /* 644.53125 MHz */
331 644531250, /* 644.53125 MHz */
332 /* tx_desk_rsgb_par */
333 322265625, /* 322.265625 MHz Reed Solomon gearbox */
334 /* rx_desk_rsgb_par */
335 322265625, /* 322.265625 MHz Reed Solomon gearbox */
336 /* tx_desk_rsgb_pcs */
337 644531250, /* 644.53125 MHz Reed Solomon gearbox */
338 /* rx_desk_rsgb_pcs */
339 644531250, /* 644.53125 MHz Reed Solomon gearbox */
342 /* pmd_adj_divisor */
347 /* ICE_PTP_LNK_SPD_100G_RS */
352 644531250, /* 644.53125 MHz */
356 644531250, /* 644.53125 MHz */
357 /* tx_desk_rsgb_par */
358 644531250, /* 644.53125 MHz Reed Solomon gearbox */
359 /* rx_desk_rsgb_par */
360 644531250, /* 644.53125 MHz Reed Solomon gearbox */
361 /* tx_desk_rsgb_pcs */
362 644531250, /* 644.53125 MHz Reed Solomon gearbox */
363 /* rx_desk_rsgb_pcs */
364 644531250, /* 644.53125 MHz Reed Solomon gearbox */
367 /* pmd_adj_divisor */
374 #endif /* _ICE_PTP_CONSTS_H_ */