public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add PTP support for TJA1103
@ 2021-05-10 15:34 Radu Pirea (NXP OSS)
  2021-05-10 15:34 ` [PATCH v2 1/2] ptp: ptp_clock: make scaled_ppm_to_ppb static inline Radu Pirea (NXP OSS)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Radu Pirea (NXP OSS) @ 2021-05-10 15:34 UTC (permalink / raw)
  To: andrew, hkallweit1, linux, davem, kuba, richardcochran
  Cc: netdev, linux-kernel, Radu Pirea (NXP OSS)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-10 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-10 15:34 [PATCH v2 0/2] Add PTP support for TJA1103 Radu Pirea (NXP OSS)
2021-05-10 15:34 ` [PATCH v2 1/2] ptp: ptp_clock: make scaled_ppm_to_ppb static inline Radu Pirea (NXP OSS)
2021-05-10 15:34 ` [PATCH v2 2/2] phy: nxp-c45-tja11xx: add timestamping support Radu Pirea (NXP OSS)
2021-05-10 22:20 ` [PATCH v2 0/2] Add PTP support for TJA1103 patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox