[PATCH net-next v1 0/3] r8169: add PTP support for RTL8127a
From: javen
Date: Sun Nov 08 2026 - 21:33:15 EST
From: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
This series adds IEEE 1588 PTP support to r8169 for RTL8127a
(RTL_GIGA_MAC_VER_80): a PTP hardware clock and hardware TX/RX
timestamping of PTPv2 event messages. PPS and other auxiliary
functions are intentionally left out.
The PTP block is accessed through the PHY OCP interface, which may now
be used from atomic context, so patch 1 converts the GPHY_OCP access to
an atomic poll and serializes it with a dedicated spinlock.
Patch 2 registers the PHC (adjfine, adjtime, gettimex64, settime64)
while the interface is up.
Patch 3 adds hardware timestamping via ndo_hwtstamp_get/set, reports
the capabilities via get_ts_info and the TX timestamp counters via
get_ts_stats.
Javen Xu (3):
r8169: make PHY OCP access safe in atomic context
r8169: add PTP hardware clock support for RTL8127a
r8169: add hardware timestamping support for RTL8127a
drivers/net/ethernet/realtek/Kconfig | 1 +
drivers/net/ethernet/realtek/Makefile | 2 +-
drivers/net/ethernet/realtek/r8169.h | 2 +
drivers/net/ethernet/realtek/r8169_main.c | 113 ++++-
drivers/net/ethernet/realtek/r8169_ptp.c | 556 ++++++++++++++++++++++
drivers/net/ethernet/realtek/r8169_ptp.h | 58 +++
6 files changed, 722 insertions(+), 10 deletions(-)
create mode 100644 drivers/net/ethernet/realtek/r8169_ptp.c
create mode 100644 drivers/net/ethernet/realtek/r8169_ptp.h
--
2.43.0