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 const struct ice_phy_reg_info_eth56g eth56g_phy_res[NUM_ETH56G_PHY_RES] = {
13 /* ETH56G_PHY_REG_PTP */
26 /* ETH56G_PHY_MEM_PTP */
39 /* ETH56G_PHY_REG_XPCS */
52 /* ETH56G_PHY_REG_MAC */
65 /* ETH56G_PHY_REG_GPCS */
81 struct ice_eth56g_mac_reg_cfg eth56g_mac_cfg[NUM_ICE_ETH56G_LNK_SPD] = {
82 [ICE_ETH56G_LNK_SPD_1G] = {
83 .tx_mode = { .def = 6, },
84 .rx_mode = { .def = 6, },
86 .blktime = 0x4000, /* 32 */
88 .serdes = 0x6666, /* 51.2 */
89 .no_fec = 0xd066, /* 104.2 */
90 .sfd = 0x3000, /* 24 */
91 .onestep = 0x30000 /* 384 */
94 .serdes = 0xffffc59a, /* -29.2 */
95 .no_fec = 0xffff0a80, /* -122.75 */
96 .sfd = 0x2c00, /* 22 */
97 .bs_ds = 0x19a /* 0.8 */
98 /* Dynamic bitslip 0 equals to 10 */
101 [ICE_ETH56G_LNK_SPD_2_5G] = {
102 .tx_mode = { .def = 6, },
103 .rx_mode = { .def = 6, },
105 .blktime = 0x199a, /* 12.8 */
107 .serdes = 0x28f6, /* 20.48 */
108 .no_fec = 0x53b8, /* 41.86 */
109 .sfd = 0x1333, /* 9.6 */
110 .onestep = 0x13333 /* 153.6 */
113 .serdes = 0xffffe8a4, /* -11.68 */
114 .no_fec = 0xffff9a76, /* -50.77 */
115 .sfd = 0xf33, /* 7.6 */
116 .bs_ds = 0xa4 /* 0.32 */
119 [ICE_ETH56G_LNK_SPD_10G] = {
120 .tx_mode = { .def = 1, },
121 .rx_mode = { .def = 1, },
123 .blktime = 0x666, /* 3.2 */
125 .serdes = 0x234c, /* 17.6484848 */
126 .no_fec = 0x8e80, /* 71.25 */
127 .fc = 0xb4a4, /* 90.32 */
128 .sfd = 0x4a4, /* 2.32 */
129 .onestep = 0x4ccd /* 38.4 */
132 .serdes = 0xffffeb27, /* -10.42424 */
133 .no_fec = 0xffffcccd, /* -25.6 */
134 .fc = 0xfffe0014, /* -255.96 */
135 .sfd = 0x4a4, /* 2.32 */
136 .bs_ds = 0x32 /* 0.0969697 */
139 [ICE_ETH56G_LNK_SPD_25G] = {
162 .blktime = 0x28f, /* 1.28 */
163 .mktime = 0x147b, /* 10.24, only if RS-FEC enabled */
165 .serdes = 0xe1e, /* 7.0593939 */
166 .no_fec = 0x3857, /* 28.17 */
167 .fc = 0x48c3, /* 36.38 */
168 .rs = 0x8100, /* 64.5 */
169 .sfd = 0x1dc, /* 0.93 */
170 .onestep = 0x1eb8 /* 15.36 */
173 .serdes = 0xfffff7a9, /* -4.1697 */
174 .no_fec = 0xffffe71a, /* -12.45 */
175 .fc = 0xfffe894d, /* -187.35 */
176 .rs = 0xfffff8cd, /* -3.6 */
177 .sfd = 0x1dc, /* 0.93 */
178 .bs_ds = 0x14 /* 0.0387879, RS-FEC 0 */
181 [ICE_ETH56G_LNK_SPD_40G] = {
182 .tx_mode = { .def = 3 },
188 .rx_mode = { .def = 4 },
189 .rx_mk_dly = { .def = 1 },
190 .rx_cw_dly = { .def = 1 },
191 .blktime = 0x333, /* 1.6 */
192 .mktime = 0xccd, /* 6.4 */
194 .serdes = 0x234c, /* 17.6484848 */
195 .no_fec = 0x5a8a, /* 45.27 */
196 .fc = 0x81b8, /* 64.86 */
197 .sfd = 0x4a4, /* 2.32 */
198 .onestep = 0x1333 /* 9.6 */
201 .serdes = 0xffffeb27, /* -10.42424 */
202 .no_fec = 0xfffff594, /* -5.21 */
203 .fc = 0xfffe3080, /* -231.75 */
204 .sfd = 0x4a4, /* 2.32 */
205 .bs_ds = 0xccd /* 6.4 */
208 [ICE_ETH56G_LNK_SPD_50G] = {
209 .tx_mode = { .def = 5 },
215 .rx_mode = { .def = 5 },
216 .rx_mk_dly = { .def = 1 },
217 .rx_cw_dly = { .def = 1 },
218 .blktime = 0x28f, /* 1.28 */
219 .mktime = 0xa3d, /* 5.12 */
221 .serdes = 0x13ba, /* 9.86353 */
222 .rs = 0x5400, /* 42 */
223 .sfd = 0xe6, /* 0.45 */
224 .onestep = 0xf5c /* 7.68 */
227 .serdes = 0xfffff7e8, /* -4.04706 */
228 .rs = 0xfffff994, /* -3.21 */
229 .sfd = 0xe6 /* 0.45 */
232 [ICE_ETH56G_LNK_SPD_50G2] = {
246 .rx_mk_dly = { .def = 1 },
247 .rx_cw_dly = { .def = 1 },
248 .blktime = 0x28f, /* 1.28 */
249 .mktime = 0xa3d, /* 5.12 */
251 .serdes = 0xe1e, /* 7.0593939 */
252 .no_fec = 0x3d33, /* 30.6 */
253 .rs = 0x5057, /* 40.17 */
254 .sfd = 0x1dc, /* 0.93 */
255 .onestep = 0xf5c /* 7.68 */
258 .serdes = 0xfffff7a9, /* -4.1697 */
259 .no_fec = 0xfffff8cd, /* -3.6 */
260 .rs = 0xfffff21a, /* -6.95 */
261 .sfd = 0x1dc, /* 0.93 */
262 .bs_ds = 0xa3d /* 5.12, RS-FEC 0x633 (3.1) */
265 [ICE_ETH56G_LNK_SPD_100G] = {
279 .rx_mk_dly = { .def = 5 },
280 .rx_cw_dly = { .def = 5 },
282 .blktime = 0x148, /* 0.64 */
283 .mktime = 0x199a, /* 12.8 */
285 .serdes = 0xe1e, /* 7.0593939 */
286 .no_fec = 0x67ec, /* 51.96 */
287 .rs = 0x44fb, /* 34.49 */
288 .sfd = 0x1dc, /* 0.93 */
289 .onestep = 0xf5c /* 7.68 */
292 .serdes = 0xfffff7a9, /* -4.1697 */
293 .no_fec = 0xfffff5a9, /* -5.17 */
294 .rs = 0xfffff6e6, /* -4.55 */
295 .sfd = 0x1dc, /* 0.93 */
296 .bs_ds = 0x199a /* 12.8, RS-FEC 0x31b (1.552) */
299 [ICE_ETH56G_LNK_SPD_100G2] = {
300 .tx_mode = { .def = 5 },
306 .rx_mode = { .def = 5 },
307 .rx_mk_dly = { .def = 5 },
308 .rx_cw_dly = { .def = 5 },
310 .blktime = 0x148, /* 0.64 */
311 .mktime = 0x199a, /* 12.8 */
313 .serdes = 0x13ba, /* 9.86353 */
314 .rs = 0x460a, /* 35.02 */
315 .sfd = 0xe6, /* 0.45 */
316 .onestep = 0xf5c /* 7.68 */
319 .serdes = 0xfffff7e8, /* -4.04706 */
320 .rs = 0xfffff548, /* -5.36 */
321 .sfd = 0xe6, /* 0.45 */
322 .bs_ds = 0x303 /* 1.506 */
327 /* struct ice_time_ref_info_e82x
329 * E822 hardware can use different sources as the reference for the PTP
330 * hardware clock. Each clock has different characteristics such as a slightly
331 * different frequency, etc.
333 * This lookup table defines several constants that depend on the current time
334 * reference. See the struct ice_time_ref_info_e82x for information about the
335 * meaning of each constant.
337 const struct ice_time_ref_info_e82x e82x_time_ref[NUM_ICE_TIME_REF_FREQ] = {
338 /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */
341 823437500, /* 823.4375 MHz PLL */
348 /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */
351 783360000, /* 783.36 MHz */
358 /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */
361 796875000, /* 796.875 MHz */
368 /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */
371 816000000, /* 816 MHz */
378 /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */
381 830078125, /* 830.78125 MHz */
388 /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */
391 783360000, /* 783.36 MHz */
399 const struct ice_cgu_pll_params_e82x e822_cgu_params[NUM_ICE_TIME_REF_FREQ] = {
400 /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */
412 /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */
424 /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */
436 /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */
448 /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */
460 /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */
474 struct ice_cgu_pll_params_e825c e825c_cgu_params[NUM_ICE_TIME_REF_FREQ] = {
475 /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */
477 /* tspll_ck_refclkfreq */
479 /* tspll_ndivratio */
481 /* tspll_fbdiv_intgr */
483 /* tspll_fbdiv_frac */
489 /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */
491 /* tspll_ck_refclkfreq */
493 /* tspll_ndivratio */
495 /* tspll_fbdiv_intgr */
497 /* tspll_fbdiv_frac */
503 /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */
505 /* tspll_ck_refclkfreq */
507 /* tspll_ndivratio */
509 /* tspll_fbdiv_intgr */
511 /* tspll_fbdiv_frac */
517 /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */
519 /* tspll_ck_refclkfreq */
521 /* tspll_ndivratio */
523 /* tspll_fbdiv_intgr */
525 /* tspll_fbdiv_frac */
531 /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */
533 /* tspll_ck_refclkfreq */
535 /* tspll_ndivratio */
537 /* tspll_fbdiv_intgr */
539 /* tspll_fbdiv_frac */
545 /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */
547 /* tspll_ck_refclkfreq */
549 /* tspll_ndivratio */
551 /* tspll_fbdiv_intgr */
553 /* tspll_fbdiv_frac */
560 /* struct ice_vernier_info_e82x
562 * E822 hardware calibrates the delay of the timestamp indication from the
563 * actual packet transmission or reception during the initialization of the
564 * PHY. To do this, the hardware mechanism uses some conversions between the
565 * various clocks within the PHY block. This table defines constants used to
566 * calculate the correct conversion ratios in the PHY registers.
568 * Many of the values relate to the PAR/PCS clock conversion registers. For
569 * these registers, a value of 0 means that the associated register is not
570 * used by this link speed, and that the register should be cleared by writing
571 * 0. Other values specify the clock frequency in Hz.
573 const struct ice_vernier_info_e82x e822_vernier[NUM_ICE_PTP_LNK_SPD] = {
574 /* ICE_PTP_LNK_SPD_1G */
577 31250000, /* 31.25 MHz */
579 31250000, /* 31.25 MHz */
581 125000000, /* 125 MHz */
583 125000000, /* 125 MHz */
584 /* tx_desk_rsgb_par */
586 /* rx_desk_rsgb_par */
588 /* tx_desk_rsgb_pcs */
590 /* rx_desk_rsgb_pcs */
594 /* pmd_adj_divisor */
599 /* ICE_PTP_LNK_SPD_10G */
602 257812500, /* 257.8125 MHz */
604 257812500, /* 257.8125 MHz */
606 156250000, /* 156.25 MHz */
608 156250000, /* 156.25 MHz */
609 /* tx_desk_rsgb_par */
611 /* rx_desk_rsgb_par */
613 /* tx_desk_rsgb_pcs */
615 /* rx_desk_rsgb_pcs */
619 /* pmd_adj_divisor */
624 /* ICE_PTP_LNK_SPD_25G */
627 644531250, /* 644.53125 MHZ */
629 644531250, /* 644.53125 MHz */
631 390625000, /* 390.625 MHz */
633 390625000, /* 390.625 MHz */
634 /* tx_desk_rsgb_par */
636 /* rx_desk_rsgb_par */
638 /* tx_desk_rsgb_pcs */
640 /* rx_desk_rsgb_pcs */
644 /* pmd_adj_divisor */
649 /* ICE_PTP_LNK_SPD_25G_RS */
659 /* tx_desk_rsgb_par */
660 161132812, /* 162.1328125 MHz Reed Solomon gearbox */
661 /* rx_desk_rsgb_par */
662 161132812, /* 162.1328125 MHz Reed Solomon gearbox */
663 /* tx_desk_rsgb_pcs */
664 97656250, /* 97.62625 MHz Reed Solomon gearbox */
665 /* rx_desk_rsgb_pcs */
666 97656250, /* 97.62625 MHz Reed Solomon gearbox */
669 /* pmd_adj_divisor */
674 /* ICE_PTP_LNK_SPD_40G */
681 156250000, /* 156.25 MHz */
683 156250000, /* 156.25 MHz */
684 /* tx_desk_rsgb_par */
686 /* rx_desk_rsgb_par */
687 156250000, /* 156.25 MHz deskew clock */
688 /* tx_desk_rsgb_pcs */
690 /* rx_desk_rsgb_pcs */
691 156250000, /* 156.25 MHz deskew clock */
694 /* pmd_adj_divisor */
699 /* ICE_PTP_LNK_SPD_50G */
702 644531250, /* 644.53125 MHZ */
704 644531250, /* 644.53125 MHZ */
706 390625000, /* 390.625 MHz */
708 390625000, /* 390.625 MHz */
709 /* tx_desk_rsgb_par */
711 /* rx_desk_rsgb_par */
712 195312500, /* 193.3125 MHz deskew clock */
713 /* tx_desk_rsgb_pcs */
715 /* rx_desk_rsgb_pcs */
716 195312500, /* 193.3125 MHz deskew clock */
719 /* pmd_adj_divisor */
724 /* ICE_PTP_LNK_SPD_50G_RS */
729 644531250, /* 644.53125 MHz */
733 644531250, /* 644.53125 MHz */
734 /* tx_desk_rsgb_par */
735 322265625, /* 322.265625 MHz Reed Solomon gearbox */
736 /* rx_desk_rsgb_par */
737 322265625, /* 322.265625 MHz Reed Solomon gearbox */
738 /* tx_desk_rsgb_pcs */
739 644531250, /* 644.53125 MHz Reed Solomon gearbox */
740 /* rx_desk_rsgb_pcs */
741 644531250, /* 644.53125 MHz Reed Solomon gearbox */
744 /* pmd_adj_divisor */
749 /* ICE_PTP_LNK_SPD_100G_RS */
754 644531250, /* 644.53125 MHz */
758 644531250, /* 644.53125 MHz */
759 /* tx_desk_rsgb_par */
760 644531250, /* 644.53125 MHz Reed Solomon gearbox */
761 /* rx_desk_rsgb_par */
762 644531250, /* 644.53125 MHz Reed Solomon gearbox */
763 /* tx_desk_rsgb_pcs */
764 644531250, /* 644.53125 MHz Reed Solomon gearbox */
765 /* rx_desk_rsgb_pcs */
766 644531250, /* 644.53125 MHz Reed Solomon gearbox */
769 /* pmd_adj_divisor */
776 #endif /* _ICE_PTP_CONSTS_H_ */