[PATCH v2 0/2] Add PTP support for TJA1103
From: Radu Pirea (NXP OSS) <hidden>
Date: 2021-05-10 15:35:02
Also in:
lkml
Hi, This is the PTP support for TJA1103. The RX timestamp is found in the reserved2 field of the PTP package. The TX timestamp has to be read from the phy registers. Reading of the timestamp works with interrupts or with polling(that starts when .nxp_c45_txtstamp is called). The implementation of .adjtime is done by read modify write because there is no way to atomically add/subtract a constant from the clock value. I've moved scaled_ppm_to_ppb function from ptp_clock.c to ptp_clock_kernel.h in order to be able to build the driver without PTP_1588_CLOCK=y. Radu P. Changes v2: - added unlocked version for the functions nxp_c45_ptp_settime64 and nxp_c45_ptp_gettimex64 - use only one lock for .gettimex64 and .settime64 - added the same lock for .adjfine, .adjtime and nxp_c45_get_hwtxts - moved the reading of the hw ts outside of the loop where the RX ts are reconstructed Radu Pirea (NXP OSS) (2): ptp: ptp_clock: make scaled_ppm_to_ppb static inline phy: nxp-c45-tja11xx: add timestamping support drivers/net/phy/nxp-c45-tja11xx.c | 531 +++++++++++++++++++++++++++++- drivers/ptp/ptp_clock.c | 21 -- include/linux/ptp_clock_kernel.h | 34 +- 3 files changed, 556 insertions(+), 30 deletions(-) -- 2.31.1