diff options
| author | Ederson de Souza <[email protected]> | 2021-02-19 01:31:03 +0000 |
|---|---|---|
| committer | Tony Nguyen <[email protected]> | 2021-04-16 20:15:45 +0000 |
| commit | 64433e5bf40abf893c7edbc60899bdcdd7c70b76 (patch) | |
| tree | 7f8f7cd05b12c5c84f9eb902bdde5e4c595b50f9 /drivers/net/ethernet/intel/igc/igc_main.c | |
| parent | igb: Add double-check MTA_REGISTER for i210 and i211 (diff) | |
| download | kernel-64433e5bf40abf893c7edbc60899bdcdd7c70b76.tar.gz kernel-64433e5bf40abf893c7edbc60899bdcdd7c70b76.zip | |
igc: Enable internal i225 PPS
The i225 device can produce one interrupt on the full second, much
like i210 - from where this patch is inspired.
This patch sets up the full second interruption on the i225 and when
receiving it, it sends a PPS event to PTP (Precision Time Protocol)
kernel subsystem.
The PTP subsystem exposes the PPS events via ioctl and sysfs, and one
can use the `testptp` tool (tools/testing/selftests/ptp) to check that
the events are being generated.
Signed-off-by: Ederson de Souza <[email protected]>
Tested-by: Dvora Fuxbrumer <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
| -rw-r--r-- | drivers/net/ethernet/intel/igc/igc_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 10765491e357..ac93c0e1b618 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -4251,9 +4251,17 @@ igc_features_check(struct sk_buff *skb, struct net_device *dev, static void igc_tsync_interrupt(struct igc_adapter *adapter) { struct igc_hw *hw = &adapter->hw; + struct ptp_clock_event event; u32 tsicr = rd32(IGC_TSICR); u32 ack = 0; + if (tsicr & IGC_TSICR_SYS_WRAP) { + event.type = PTP_CLOCK_PPS; + if (adapter->ptp_caps.pps) + ptp_clock_event(adapter->ptp_clock, &event); + ack |= IGC_TSICR_SYS_WRAP; + } + if (tsicr & IGC_TSICR_TXTS) { /* retrieve hardware timestamp */ schedule_work(&adapter->ptp_tx_work); |
