Skip to content

Commit cfd5978

Browse files
christopher-s-hallgregkh
authored andcommitted
igc: Fix PPS delta between two synchronized end-points
[ Upstream commit 5e91c72 ] This patch fix the pulse per second output delta between two synchronized end-points. Based on Intel Discrete I225 Software User Manual Section 4.2.15 TimeSync Auxiliary Control Register, ST0[Bit 4] and ST1[Bit 7] must be set to ensure that clock output will be toggles based on frequency value defined. This is to ensure that output of the PPS is aligned with the clock. How to test: 1) Running time synchronization on both end points. Ex: ptp4l --step_threshold=1 -m -f gPTP.cfg -i <interface name> 2) Configure PPS output using below command for both end-points Ex: SDP0 on I225 REV4 SKU variant ./testptp -d /dev/ptp0 -L 0,2 ./testptp -d /dev/ptp0 -p 1000000000 3) Measure the output using analyzer for both end-points Fixes: 8793885 ("igc: enable auxiliary PHC functions for the i225") Signed-off-by: Christopher S Hall <christopher.s.hall@intel.com> Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com> Acked-by: Sasha Neftin <sasha.neftin@intel.com> Tested-by: Naama Meir <naamax.meir@linux.intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0bf5260 commit cfd5978

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

drivers/net/ethernet/intel/igc/igc_defines.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,9 @@
469469
#define IGC_TSAUXC_EN_TT0 BIT(0) /* Enable target time 0. */
470470
#define IGC_TSAUXC_EN_TT1 BIT(1) /* Enable target time 1. */
471471
#define IGC_TSAUXC_EN_CLK0 BIT(2) /* Enable Configurable Frequency Clock 0. */
472+
#define IGC_TSAUXC_ST0 BIT(4) /* Start Clock 0 Toggle on Target Time 0. */
472473
#define IGC_TSAUXC_EN_CLK1 BIT(5) /* Enable Configurable Frequency Clock 1. */
474+
#define IGC_TSAUXC_ST1 BIT(7) /* Start Clock 1 Toggle on Target Time 1. */
473475
#define IGC_TSAUXC_EN_TS0 BIT(8) /* Enable hardware timestamp 0. */
474476
#define IGC_TSAUXC_AUTT0 BIT(9) /* Auxiliary Timestamp Taken. */
475477
#define IGC_TSAUXC_EN_TS1 BIT(10) /* Enable hardware timestamp 0. */

drivers/net/ethernet/intel/igc/igc_ptp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp,
323323
ts = ns_to_timespec64(ns);
324324
if (rq->perout.index == 1) {
325325
if (use_freq) {
326-
tsauxc_mask = IGC_TSAUXC_EN_CLK1;
326+
tsauxc_mask = IGC_TSAUXC_EN_CLK1 | IGC_TSAUXC_ST1;
327327
tsim_mask = 0;
328328
} else {
329329
tsauxc_mask = IGC_TSAUXC_EN_TT1;
@@ -334,7 +334,7 @@ static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp,
334334
freqout = IGC_FREQOUT1;
335335
} else {
336336
if (use_freq) {
337-
tsauxc_mask = IGC_TSAUXC_EN_CLK0;
337+
tsauxc_mask = IGC_TSAUXC_EN_CLK0 | IGC_TSAUXC_ST0;
338338
tsim_mask = 0;
339339
} else {
340340
tsauxc_mask = IGC_TSAUXC_EN_TT0;
@@ -348,10 +348,12 @@ static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp,
348348
tsauxc = rd32(IGC_TSAUXC);
349349
tsim = rd32(IGC_TSIM);
350350
if (rq->perout.index == 1) {
351-
tsauxc &= ~(IGC_TSAUXC_EN_TT1 | IGC_TSAUXC_EN_CLK1);
351+
tsauxc &= ~(IGC_TSAUXC_EN_TT1 | IGC_TSAUXC_EN_CLK1 |
352+
IGC_TSAUXC_ST1);
352353
tsim &= ~IGC_TSICR_TT1;
353354
} else {
354-
tsauxc &= ~(IGC_TSAUXC_EN_TT0 | IGC_TSAUXC_EN_CLK0);
355+
tsauxc &= ~(IGC_TSAUXC_EN_TT0 | IGC_TSAUXC_EN_CLK0 |
356+
IGC_TSAUXC_ST0);
355357
tsim &= ~IGC_TSICR_TT0;
356358
}
357359
if (on) {

0 commit comments

Comments
 (0)