[PATCH net-next v2 0/3] ptp: Add driver for R-Car Gen4 gPTP timer
From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Date: 2026-06-12 09:29:10
Also in:
linux-devicetree, linux-renesas-soc, lkml
Hello, This series is the first part cleaning up how PTP timer support is implemented on R-Car Gen4. Currently there is partial support for it in some of the Ethernet devices that can use it, but not all. The partial support have been implemented by hacking the gPTP module directly into the first Ethernet device driver that used it, RTSN for V4H and RSWITCH for S4. This is understandable as earlier R-Car generations had a dedicated gPTP timer for each Ethernet device, but on Gen4 there is a single system-wide PTP timer shared by all. The current implementation makes it impossible for other Ethernet devices on the platform to use the PTP timer without messing around with other Ethernet device drivers. The effort to clean this up starts with this series which adds the system-wide gPTP timer as its own driver and device tree node. This series will then be followed by work to add proper PTP support to the R-Car RAVB Gen4 driver, which currently advertises to user-space it supports PTP but which implementation is broken and does not work. This will in turn be followed by work to the RTSN and RSWITCH drivers will be be switched from its current partial support by mapping the gPTP address space directly to instead use this driver. Having both this and RTSN/RSWITCH described and enabled (!) in device tree will not work as they will try to use the same memory region. For this reason this new solution will only be enabled on platforms after all user's of the gPTP clock have moved to only use the new centralized timer. But in the interim both devices will be described (but not enabled) in the platforms base dtsi file. For some platforms this is straight forward, such as V4H Sparrow Hawk, which only have the RAVB Ethernet interface. This platform currently have no users of the PTP timer, but still advertise it supports it. This and the soon to be posted RAVB patches solves that. As the RAVB patches depends on this series the device tree node for the gPTP clock is added in this series but will be enabled and linked to consumers in the RAVB gPTP series for platforms where it will not conflict with RTSN and RSWITCH. And further enabled as more of this is cleaned up. The gPTP driver itself is heavily influence by the existing partial support for gPTP in the RTSN and RSWITCH drivers and the Renesas BSP. Niklas Söderlund (3): dt-bindings: ptp: renesas,rcar-gen4-gptp: Add R-Car Gen4 ptp: Add driver for R-Car Gen4 arm64: dts: renesas: r8a779g0: Add gPTP node .../bindings/ptp/renesas,rcar-gen4-gptp.yaml | 64 +++++ MAINTAINERS | 7 + arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 9 + drivers/ptp/Kconfig | 12 + drivers/ptp/Makefile | 1 + drivers/ptp/ptp_rcar_gen4.c | 219 ++++++++++++++++++ 6 files changed, 312 insertions(+) create mode 100644 Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml create mode 100644 drivers/ptp/ptp_rcar_gen4.c -- 2.54.0