Netdev List
 help / color / mirror / Atom feed
* [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer
@ 2026-06-09 21:57 Niklas Söderlund
  2026-06-09 21:57 ` [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4 Niklas Söderlund
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Niklas Söderlund @ 2026-06-09 21:57 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, Richard Cochran, Andrew Lunn,
	DavidS. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-renesas-soc, devicetree, linux-kernel, netdev
  Cc: Niklas Söderlund

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.

While having both this driver and the "direct accessing of registers by 
the user driver" in operation at the same time works, but it is not 
recommended. It works by chance due to how both the RTSN and RSWITCH 
drivers internal workings.

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.

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 binding for 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


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

end of thread, other threads:[~2026-06-10  9:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 21:57 [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer Niklas Söderlund
2026-06-09 21:57 ` [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4 Niklas Söderlund
2026-06-10  6:54   ` Krzysztof Kozlowski
2026-06-10  8:53     ` Niklas Söderlund
2026-06-10  9:01       ` Krzysztof Kozlowski
2026-06-10  9:14         ` Niklas Söderlund
2026-06-09 21:57 ` [net-next 2/3] ptp: Add driver " Niklas Söderlund
2026-06-09 21:57 ` [net-next 3/3] arm64: dts: renesas: r8a779g0: Add gPTP node Niklas Söderlund
2026-06-10  5:02 ` [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer Michael Dege
2026-06-10  7:14   ` Niklas Söderlund

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