Skip to content

Commit 5e91c72

Browse files
christopher-s-hallanguy11
authored andcommitted
igc: Fix PPS delta between two synchronized end-points
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 <[email protected]> Signed-off-by: Muhammad Husaini Zulkifli <[email protected]> Acked-by: Sasha Neftin <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent b93fb44 commit 5e91c72

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@
475475
#define IGC_TSAUXC_EN_TT0 BIT(0) /* Enable target time 0. */
476476
#define IGC_TSAUXC_EN_TT1 BIT(1) /* Enable target time 1. */
477477
#define IGC_TSAUXC_EN_CLK0 BIT(2) /* Enable Configurable Frequency Clock 0. */
478+
#define IGC_TSAUXC_ST0 BIT(4) /* Start Clock 0 Toggle on Target Time 0. */
478479
#define IGC_TSAUXC_EN_CLK1 BIT(5) /* Enable Configurable Frequency Clock 1. */
480+
#define IGC_TSAUXC_ST1 BIT(7) /* Start Clock 1 Toggle on Target Time 1. */
479481
#define IGC_TSAUXC_EN_TS0 BIT(8) /* Enable hardware timestamp 0. */
480482
#define IGC_TSAUXC_AUTT0 BIT(9) /* Auxiliary Timestamp Taken. */
481483
#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
@@ -322,7 +322,7 @@ static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp,
322322
ts = ns_to_timespec64(ns);
323323
if (rq->perout.index == 1) {
324324
if (use_freq) {
325-
tsauxc_mask = IGC_TSAUXC_EN_CLK1;
325+
tsauxc_mask = IGC_TSAUXC_EN_CLK1 | IGC_TSAUXC_ST1;
326326
tsim_mask = 0;
327327
} else {
328328
tsauxc_mask = IGC_TSAUXC_EN_TT1;
@@ -333,7 +333,7 @@ static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp,
333333
freqout = IGC_FREQOUT1;
334334
} else {
335335
if (use_freq) {
336-
tsauxc_mask = IGC_TSAUXC_EN_CLK0;
336+
tsauxc_mask = IGC_TSAUXC_EN_CLK0 | IGC_TSAUXC_ST0;
337337
tsim_mask = 0;
338338
} else {
339339
tsauxc_mask = IGC_TSAUXC_EN_TT0;
@@ -347,10 +347,12 @@ static int igc_ptp_feature_enable_i225(struct ptp_clock_info *ptp,
347347
tsauxc = rd32(IGC_TSAUXC);
348348
tsim = rd32(IGC_TSIM);
349349
if (rq->perout.index == 1) {
350-
tsauxc &= ~(IGC_TSAUXC_EN_TT1 | IGC_TSAUXC_EN_CLK1);
350+
tsauxc &= ~(IGC_TSAUXC_EN_TT1 | IGC_TSAUXC_EN_CLK1 |
351+
IGC_TSAUXC_ST1);
351352
tsim &= ~IGC_TSICR_TT1;
352353
} else {
353-
tsauxc &= ~(IGC_TSAUXC_EN_TT0 | IGC_TSAUXC_EN_CLK0);
354+
tsauxc &= ~(IGC_TSAUXC_EN_TT0 | IGC_TSAUXC_EN_CLK0 |
355+
IGC_TSAUXC_ST0);
354356
tsim &= ~IGC_TSICR_TT0;
355357
}
356358
if (on) {

0 commit comments

Comments
 (0)