Devicetree
 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

* [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4
  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 ` Niklas Söderlund
  2026-06-10  6:54   ` Krzysztof Kozlowski
  2026-06-09 21:57 ` [net-next 2/3] ptp: Add driver " Niklas Söderlund
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 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

Add bindings for the R-Car Gen4 gPTP timer. The timer enables accurate
synchronization of the clock in the control system. The timer is
system-wide and used by different Ethernet devices on each Gen4 platform.

  - On R-Car S4 it is shared between RSWITCH and RAVB.

  - On R-Car V4H it is shared between RTSN and RAVB.

  - On R-Car V4M it is only used by RAVB.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 .../bindings/ptp/renesas,rcar-gen4-gptp.yaml  | 64 +++++++++++++++++++
 MAINTAINERS                                   |  6 ++
 2 files changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml

diff --git a/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml b/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
new file mode 100644
index 000000000000..99e6e3ca73b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+# Copyright (C) 2026 Renesas Electronics Corp.
+# Copyright (C) 2026 Niklas Söderlund <niklas.soderlund@ragnatech.se>
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ptp/renesas,rcar-gen4-gptp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas R-Car Gen4 gPTP timer
+
+maintainers:
+  - Niklas Söderlund <niklas.soderlund@ragnatech.se>
+
+description:
+  The R-Car Gen4 gPTP timer enables accurate synchronization of the clock in
+  the control system. The timer is system-wide and used by different Ethernet
+  devices on each Gen4 platform.
+
+    - On R-Car S4 it is shared between RSWITCH and RAVB.
+    - On R-Car V4H it is shared between RTSN and RAVB.
+    - On R-Car V4M it is only used by RAVB.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r8a779f0-gptp # S4-8
+          - renesas,r8a779g0-gptp # V4H
+          - renesas,r8a779h0-gptp # V4M
+      - const: renesas,rcar-gen4-gptp # Generic R-Car Gen4
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - power-domains
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
+    #include <dt-bindings/power/r8a779g0-sysc.h>
+
+    gptp: gptp@e6449000 {
+            compatible = "renesas,r8a779g0-gptp", "renesas,rcar-gen4-gptp";
+            reg = <0xe6449000 0x500>;
+            clocks = <&cpg CPG_MOD 2723>;
+            power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+            resets = <&cpg 2723>;
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index cf7e92d9e6db..e934bcb8c7c9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22664,6 +22664,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/mtd/renesas-nandc.yaml
 F:	drivers/mtd/nand/raw/renesas-nand-controller.c
 
+RENESAS R-CAR GEN4 GPTP DRIVER
+M:	Niklas Söderlund <niklas.soderlund@ragnatech.se>
+L:	linux-renesas-soc@vger.kernel.org
+S:	Supported
+F:	Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
+
 RENESAS R-CAR GYROADC DRIVER
 M:	Marek Vasut <marek.vasut@gmail.com>
 L:	linux-iio@vger.kernel.org
-- 
2.54.0


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

* [net-next 2/3] ptp: Add driver for R-Car Gen4
  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-09 21:57 ` 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
  3 siblings, 0 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

Add driver for the gPTP timer found on R-Car Gen4 devices. The timer is
system-wide and shared by different Ethernet devices on each Gen4
platform. The operation of the timer is however not completely in
depended of the systems Ethernet devices.

  - On R-Car S4 is gated by the RSWITCH Ethernet module clock.

  - On R-Car V4H is gated by the RTSN Ethernet module clock.

  - On R-Car V4M is gated by its own module clock, the system have
    neither RTSN or RSWITCH device. But the module clock is the same as
    RTSN on V4H and the documentation referees to it as tsn (EtherTSN).

The gPTP device do have its own register space on all three platforms.
But on S4 and V4H it will share its clock and reset property with
RSWITCH or RTSN, respectively.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 MAINTAINERS                 |   1 +
 drivers/ptp/Kconfig         |  12 ++
 drivers/ptp/Makefile        |   1 +
 drivers/ptp/ptp_rcar_gen4.c | 219 ++++++++++++++++++++++++++++++++++++
 4 files changed, 233 insertions(+)
 create mode 100644 drivers/ptp/ptp_rcar_gen4.c

diff --git a/MAINTAINERS b/MAINTAINERS
index e934bcb8c7c9..0075bef8b2d8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22669,6 +22669,7 @@ M:	Niklas Söderlund <niklas.soderlund@ragnatech.se>
 L:	linux-renesas-soc@vger.kernel.org
 S:	Supported
 F:	Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
+F:	drivers/ptp/ptp_rcar_gen4.c
 
 RENESAS R-CAR GYROADC DRIVER
 M:	Marek Vasut <marek.vasut@gmail.com>
diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
index b93640ca08b7..3593fd9da92a 100644
--- a/drivers/ptp/Kconfig
+++ b/drivers/ptp/Kconfig
@@ -263,4 +263,16 @@ config PTP_NETC_V4_TIMER
 	  synchronization. It also supports periodic output signal (e.g. PPS)
 	  and external trigger timestamping.
 
+config PTP_RCAR_GEN4
+	tristate "Renesas R-Car Gen4 PTP Driver"
+	depends on ARCH_RENESAS || COMPILE_TEST
+	depends on PTP_1588_CLOCK
+	help
+	  This driver adds support for using the Renesas R-Car Gen4 gPTP timer
+	  as a PTP clock, the clock can then be used by Gen4 Ethernet drivers
+	  for PTP time synchronization.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called ptp_rcar_gen4.
+
 endmenu
diff --git a/drivers/ptp/Makefile b/drivers/ptp/Makefile
index bdc47e284f14..0464a586bed2 100644
--- a/drivers/ptp/Makefile
+++ b/drivers/ptp/Makefile
@@ -22,3 +22,4 @@ obj-$(CONFIG_PTP_1588_CLOCK_OCP)	+= ptp_ocp.o
 obj-$(CONFIG_PTP_DFL_TOD)		+= ptp_dfl_tod.o
 obj-$(CONFIG_PTP_S390)			+= ptp_s390.o
 obj-$(CONFIG_PTP_NETC_V4_TIMER)		+= ptp_netc.o
+obj-$(CONFIG_PTP_RCAR_GEN4)		+= ptp_rcar_gen4.o
diff --git a/drivers/ptp/ptp_rcar_gen4.c b/drivers/ptp/ptp_rcar_gen4.c
new file mode 100644
index 000000000000..ab0be2431be8
--- /dev/null
+++ b/drivers/ptp/ptp_rcar_gen4.c
@@ -0,0 +1,219 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Renesas R-Car Gen4 gPTP device driver
+ *
+ * Copyright (C) 2026 Renesas Electronics Corporation
+ * Copyright (C) 2026 Niklas Söderlund <niklas.soderlund@ragnatech.se>
+ */
+
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/ptp_clock_kernel.h>
+#include <linux/types.h>
+
+#define PTPTMEC_REG		0x0010
+#define PTPTMDC_REG		0x0014
+#define PTPTIVC0_REG		0x0020
+#define PTPTOVC00_REG		0x0030
+#define PTPTOVC10_REG		0x0034
+#define PTPTOVC20_REG		0x0038
+#define PTPGPTPTM00_REG		0x0050
+#define PTPGPTPTM10_REG		0x0054
+#define PTPGPTPTM20_REG		0x0058
+
+struct ptp_rcar_gen4_priv {
+	void __iomem *base;
+	struct clk *clk;
+
+	struct ptp_clock *clock;
+	struct ptp_clock_info info;
+
+	spinlock_t lock;	/* Registers access. */
+	s64 default_addend;
+};
+
+#define ptp_to_priv(ptp) container_of(ptp, struct ptp_rcar_gen4_priv, info)
+
+static int ptp_rcar_gen4_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
+{
+	struct ptp_rcar_gen4_priv *priv = ptp_to_priv(ptp);
+	s64 addend = priv->default_addend;
+	bool neg_adj = scaled_ppm < 0;
+	unsigned long flags;
+	s64 diff;
+
+	if (neg_adj)
+		scaled_ppm = -scaled_ppm;
+	diff = div_s64(addend * scaled_ppm_to_ppb(scaled_ppm), NSEC_PER_SEC);
+	addend = neg_adj ? addend - diff : addend + diff;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	iowrite32(addend, priv->base + PTPTIVC0_REG);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return 0;
+}
+
+static void _ptp_rcar_gen4_gettime(struct ptp_clock_info *ptp,
+				   struct timespec64 *ts)
+{
+	struct ptp_rcar_gen4_priv *priv = ptp_to_priv(ptp);
+
+	lockdep_assert_held(&priv->lock);
+
+	ts->tv_nsec = ioread32(priv->base + PTPGPTPTM00_REG);
+	ts->tv_sec = ioread32(priv->base + PTPGPTPTM10_REG) |
+		((s64)ioread32(priv->base + PTPGPTPTM20_REG) << 32);
+}
+
+static int ptp_rcar_gen4_gettime(struct ptp_clock_info *ptp,
+				 struct timespec64 *ts)
+{
+	struct ptp_rcar_gen4_priv *priv = ptp_to_priv(ptp);
+	unsigned long flags;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	_ptp_rcar_gen4_gettime(ptp, ts);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return 0;
+}
+
+static void _ptp_rcar_gen4_settime(struct ptp_clock_info *ptp,
+				   const struct timespec64 *ts)
+{
+	struct ptp_rcar_gen4_priv *priv = ptp_to_priv(ptp);
+
+	lockdep_assert_held(&priv->lock);
+
+	iowrite32(1, priv->base + PTPTMDC_REG);
+	iowrite32(0, priv->base + PTPTOVC20_REG);
+	iowrite32(0, priv->base + PTPTOVC10_REG);
+	iowrite32(0, priv->base + PTPTOVC00_REG);
+	iowrite32(1, priv->base + PTPTMEC_REG);
+	iowrite32(ts->tv_sec >> 32, priv->base + PTPTOVC20_REG);
+	iowrite32(ts->tv_sec, priv->base + PTPTOVC10_REG);
+	iowrite32(ts->tv_nsec, priv->base + PTPTOVC00_REG);
+}
+
+static int ptp_rcar_gen4_settime(struct ptp_clock_info *ptp,
+				 const struct timespec64 *ts)
+{
+	struct ptp_rcar_gen4_priv *priv = ptp_to_priv(ptp);
+	unsigned long flags;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	_ptp_rcar_gen4_settime(ptp, ts);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return 0;
+}
+
+static int ptp_rcar_gen4_adjtime(struct ptp_clock_info *ptp, s64 delta)
+{
+	struct ptp_rcar_gen4_priv *priv = ptp_to_priv(ptp);
+	struct timespec64 ts;
+	unsigned long flags;
+	s64 now;
+
+	spin_lock_irqsave(&priv->lock, flags);
+	_ptp_rcar_gen4_gettime(ptp, &ts);
+	now = ktime_to_ns(timespec64_to_ktime(ts));
+	ts = ns_to_timespec64(now + delta);
+	_ptp_rcar_gen4_settime(ptp, &ts);
+	spin_unlock_irqrestore(&priv->lock, flags);
+
+	return 0;
+}
+
+static struct ptp_clock_info ptp_rcar_gen4_info = {
+	.owner = THIS_MODULE,
+	.name = "R-Car Gen4 gPTP",
+	.max_adj = 50000000,
+	.adjfine = ptp_rcar_gen4_adjfine,
+	.adjtime = ptp_rcar_gen4_adjtime,
+	.gettime64 = ptp_rcar_gen4_gettime,
+	.settime64 = ptp_rcar_gen4_settime,
+};
+
+static int ptp_rcar_gen4_probe(struct platform_device *pdev)
+{
+	struct ptp_rcar_gen4_priv *priv;
+	struct device *dev = &pdev->dev;
+
+	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+	if (!priv)
+		return -ENOMEM;
+
+	platform_set_drvdata(pdev, priv);
+
+	priv->base = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(priv->base))
+		return PTR_ERR(priv->base);
+
+	priv->clk = devm_clk_get(dev, NULL);
+	if (IS_ERR(priv->clk))
+		return PTR_ERR(priv->clk);
+
+	spin_lock_init(&priv->lock);
+
+	priv->info = ptp_rcar_gen4_info;
+
+	/* Default timer increment in ns.
+	 * bit[31:27] - integer
+	 * bit[26:0]  - decimal
+	 * increment[ns] = perid[ns] * 2^27 => (1ns * 2^27) / rate[hz]
+	 */
+	priv->default_addend =
+		div_s64(1000000000LL << 27, clk_get_rate(priv->clk));
+
+	pm_runtime_enable(dev);
+	pm_runtime_get_sync(dev);
+
+	iowrite32(priv->default_addend, priv->base + PTPTIVC0_REG);
+
+	priv->clock = ptp_clock_register(&priv->info, dev);
+	if (IS_ERR(priv->clock))
+		return PTR_ERR(priv->clock);
+
+	iowrite32(1, priv->base + PTPTMEC_REG);
+
+	return 0;
+}
+
+static void ptp_rcar_gen4_remove(struct platform_device *pdev)
+{
+	struct ptp_rcar_gen4_priv *priv = platform_get_drvdata(pdev);
+	struct device *dev = &pdev->dev;
+
+	ptp_clock_unregister(priv->clock);
+
+	iowrite32(1, priv->base + PTPTMDC_REG);
+
+	pm_runtime_put_sync(dev);
+	pm_runtime_disable(dev);
+}
+
+static const struct of_device_id ptp_rcar_gen4_of_match[] = {
+	{ .compatible = "renesas,rcar-gen4-gptp", },
+	{ /* Sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, ptp_rcar_gen4_of_match);
+
+static struct platform_driver ptp_rcar_gen4_driver = {
+	.driver = {
+		.name = "ptp-rcar-gen4",
+		.of_match_table = ptp_rcar_gen4_of_match,
+	},
+	.probe    = ptp_rcar_gen4_probe,
+	.remove   = ptp_rcar_gen4_remove,
+};
+module_platform_driver(ptp_rcar_gen4_driver);
+
+MODULE_AUTHOR("Niklas Söderlund");
+MODULE_DESCRIPTION("Renesas R-Car Gen4 gPTP driver");
+MODULE_LICENSE("GPL");
-- 
2.54.0


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

* [net-next 3/3] arm64: dts: renesas: r8a779g0: Add gPTP node
  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-09 21:57 ` [net-next 2/3] ptp: Add driver " Niklas Söderlund
@ 2026-06-09 21:57 ` Niklas Söderlund
  2026-06-10  5:02 ` [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer Michael Dege
  3 siblings, 0 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

The gPTP module is shared between the RAVB and RTSN Ethernet devices on
the SoC.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
index 82a7278836e5..758c4ca0ae5f 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
@@ -603,6 +603,15 @@ tsn0: ethernet@e6460000 {
 			status = "disabled";
 		};
 
+		gptp: gptp@e6449000 {
+			compatible = "renesas,r8a779g0-gptp", "renesas,rcar-gen4-gptp";
+			reg = <0 0xe6449000 0 0x500>;
+			clocks = <&cpg CPG_MOD 2723>;
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 2723>;
+			status = "disabled";
+		};
+
 		i2c0: i2c@e6500000 {
 			compatible = "renesas,i2c-r8a779g0",
 				     "renesas,rcar-gen4-i2c";
-- 
2.54.0


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

* RE: [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer
  2026-06-09 21:57 [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer Niklas Söderlund
                   ` (2 preceding siblings ...)
  2026-06-09 21:57 ` [net-next 3/3] arm64: dts: renesas: r8a779g0: Add gPTP node Niklas Söderlund
@ 2026-06-10  5:02 ` Michael Dege
  2026-06-10  7:14   ` Niklas Söderlund
  3 siblings, 1 reply; 10+ messages in thread
From: Michael Dege @ 2026-06-10  5:02 UTC (permalink / raw)
  To: Niklas Söderlund, 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@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org

Hello Niklas,

Thank you for your effort to clean this driver up.

> -----Original Message-----
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Sent: Tuesday, June 9, 2026 11:57 PM
> To: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
> <conor+dt@kernel.org>; Geert Uytterhoeven <geert+renesas@glider.be>; magnus.damm
> <magnus.damm@gmail.com>; Richard Cochran <richardcochran@gmail.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; DavidS. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>;
> Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; linux-renesas-soc@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; netdev@vger.kernel.org
> Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Subject: [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer
> 
> 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
> 
Are you aware, that Gen5 is on the horizon? The first patches for X5H have been up-streamed. X5H will
be using the same gPTP driver. I think it would be a good idea to make this driver generic, meaning
leave out the references to Gen4. What do you think?

Best regards,

Michael

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

* Re: [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-10  6:54 UTC (permalink / raw)
  To: Niklas Söderlund, 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

On 09/06/2026 23:57, Niklas Söderlund wrote:
> Add bindings for the R-Car Gen4 gPTP timer. The timer enables accurate
> synchronization of the clock in the control system. The timer is
> system-wide and used by different Ethernet devices on each Gen4 platform.

A nit, subject: drop second/last, redundant "binding for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18


> 
>   - On R-Car S4 it is shared between RSWITCH and RAVB.
> 
>   - On R-Car V4H it is shared between RTSN and RAVB.
> 
>   - On R-Car V4M it is only used by RAVB.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  .../bindings/ptp/renesas,rcar-gen4-gptp.yaml  | 64 +++++++++++++++++++
>  MAINTAINERS                                   |  6 ++
>  2 files changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
> 
> diff --git a/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml b/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
> new file mode 100644
> index 000000000000..99e6e3ca73b6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
> @@ -0,0 +1,64 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +# Copyright (C) 2026 Renesas Electronics Corp.
> +# Copyright (C) 2026 Niklas Söderlund <niklas.soderlund@ragnatech.se>
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ptp/renesas,rcar-gen4-gptp.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas R-Car Gen4 gPTP timer
> +
> +maintainers:
> +  - Niklas Söderlund <niklas.soderlund@ragnatech.se>
> +
> +description:
> +  The R-Car Gen4 gPTP timer enables accurate synchronization of the clock in
> +  the control system. The timer is system-wide and used by different Ethernet
> +  devices on each Gen4 platform.
> +
> +    - On R-Car S4 it is shared between RSWITCH and RAVB.
> +    - On R-Car V4H it is shared between RTSN and RAVB.
> +    - On R-Car V4M it is only used by RAVB.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - renesas,r8a779f0-gptp # S4-8
> +          - renesas,r8a779g0-gptp # V4H
> +          - renesas,r8a779h0-gptp # V4M
> +      - const: renesas,rcar-gen4-gptp # Generic R-Car Gen4

Please drop comment or drop generic compatible and make it specific.
Generic compatibles are discouraged, so don't advertise that. Look how
other RECENT Renesas bindings do it.

> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - power-domains
> +  - resets
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
> +    #include <dt-bindings/power/r8a779g0-sysc.h>
> +
> +    gptp: gptp@e6449000 {

Drop unused label. Node name usually is "phc". Could be "ptp", but not
"gptp". What is gptp in generic names?

>  L:	linux-iio@vger.kernel.org


Best regards,
Krzysztof

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

* Re: [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer
  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
  0 siblings, 0 replies; 10+ messages in thread
From: Niklas Söderlund @ 2026-06-10  7:14 UTC (permalink / raw)
  To: Michael Dege
  Cc: 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@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org

Hi Michael,

Thanks for your feedback.

On 2026-06-10 05:02:48 +0000, Michael Dege wrote:
> Hello Niklas,
> 
> Thank you for your effort to clean this driver up.
> 
> > -----Original Message-----
> > From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Sent: Tuesday, June 9, 2026 11:57 PM
> > To: Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor Dooley
> > <conor+dt@kernel.org>; Geert Uytterhoeven <geert+renesas@glider.be>; magnus.damm
> > <magnus.damm@gmail.com>; Richard Cochran <richardcochran@gmail.com>; Andrew Lunn
> > <andrew+netdev@lunn.ch>; DavidS. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>;
> > Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; linux-renesas-soc@vger.kernel.org;
> > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; netdev@vger.kernel.org
> > Cc: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Subject: [net-next 0/3] ptp: Add driver for R-Car Gen4 gPTP timer
> > 
> > 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
> > 
> Are you aware, that Gen5 is on the horizon? The first patches for X5H have been up-streamed. X5H will
> be using the same gPTP driver. I think it would be a good idea to make this driver generic, meaning
> leave out the references to Gen4. What do you think?

Ideally we should have a module name or such from the gPTP module itself 
we could use as the kernel module name, unfortunately we don't. All we 
know is this is the gPTP module first used on Gen4.

I don't want to name the module ptp_rcar as that is too generic IMHO and 
risk confusion when Gen N will be released which will have a completely 
new PTP hardware module.

Having a name with gen4 do in no way make it impossible to also use on 
Gen5 devices. We just add more compatible values. There is some 
precedence to this behavior, see the R-Car thermal drivers for example.

  $ find drivers/thermal/renesas -name \*rcar\* -exec grep \.compatible {} +
  .../rcar_thermal.c:		.compatible = "renesas,rcar-thermal",
  .../rcar_thermal.c:		.compatible = "renesas,rcar-gen2-thermal",
  .../rcar_thermal.c:		.compatible = "renesas,thermal-r8a774c0",
  .../rcar_thermal.c:		.compatible = "renesas,thermal-r8a77970",
  .../rcar_thermal.c:		.compatible = "renesas,thermal-r8a77990",
  .../rcar_thermal.c:		.compatible = "renesas,thermal-r8a77995",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a774a1-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a774b1-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a774e1-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a7795-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a7796-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a77961-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a77965-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a77980-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a779a0-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a779f0-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a779g0-thermal",
  .../rcar_gen3_thermal.c:		.compatible = "renesas,r8a779h0-thermal",

Here rcar_thermal started as the first thermal driver covering Gen1 
(ish) and later Gen2 devices. When Gen3 was released with a completely 
new thermal hardware module a new rcar_gen3_thermal driver was created 
to support it.

The thermal module supported by the rcar_gen3_thermal driver was later 
extended to also support Gen4, as the thermal hardware was used on all 
Gen4 devices too.

tl;dr, I like to give the driver a "version" designation so in future if 
more R-Car PTP hardware emerges we can distinguish them. We don't have a 
version/name of the gPTP module itself so all we know and can use is
that it was first used on Gen4 devices. So I use that like we have done 
for other R-Car hardware modules.

> 
> Best regards,
> 
> Michael

-- 
Kind Regards,
Niklas Söderlund

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

* Re: [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4
  2026-06-10  6:54   ` Krzysztof Kozlowski
@ 2026-06-10  8:53     ` Niklas Söderlund
  2026-06-10  9:01       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 10+ messages in thread
From: Niklas Söderlund @ 2026-06-10  8:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: 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

Hi Krzysztof,

Thanks for your comments.

On 2026-06-10 08:54:06 +0200, Krzysztof Kozlowski wrote:
> On 09/06/2026 23:57, Niklas Söderlund wrote:
> > Add bindings for the R-Car Gen4 gPTP timer. The timer enables accurate
> > synchronization of the clock in the control system. The timer is
> > system-wide and used by different Ethernet devices on each Gen4 platform.
> 
> A nit, subject: drop second/last, redundant "binding for". The
> "dt-bindings" prefix is already stating that these are bindings.

Thanks, will fix.

> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

Not sure I follow this one, L18 reads,

  "Few subsystems, like ASoC, media, regulators and SPI, expect reverse 
  order of the prefixes::"

But 'git log Documentation/devicetree/bindings/ptp/' shows all commits 
in that directory use the 'dt-bindings: ptp:' prefix.

> 
> 
> > 
> >   - On R-Car S4 it is shared between RSWITCH and RAVB.
> > 
> >   - On R-Car V4H it is shared between RTSN and RAVB.
> > 
> >   - On R-Car V4M it is only used by RAVB.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > ---
> >  .../bindings/ptp/renesas,rcar-gen4-gptp.yaml  | 64 +++++++++++++++++++
> >  MAINTAINERS                                   |  6 ++
> >  2 files changed, 70 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml b/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
> > new file mode 100644
> > index 000000000000..99e6e3ca73b6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/ptp/renesas,rcar-gen4-gptp.yaml
> > @@ -0,0 +1,64 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +# Copyright (C) 2026 Renesas Electronics Corp.
> > +# Copyright (C) 2026 Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/ptp/renesas,rcar-gen4-gptp.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Renesas R-Car Gen4 gPTP timer
> > +
> > +maintainers:
> > +  - Niklas Söderlund <niklas.soderlund@ragnatech.se>
> > +
> > +description:
> > +  The R-Car Gen4 gPTP timer enables accurate synchronization of the clock in
> > +  the control system. The timer is system-wide and used by different Ethernet
> > +  devices on each Gen4 platform.
> > +
> > +    - On R-Car S4 it is shared between RSWITCH and RAVB.
> > +    - On R-Car V4H it is shared between RTSN and RAVB.
> > +    - On R-Car V4M it is only used by RAVB.
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - enum:
> > +          - renesas,r8a779f0-gptp # S4-8
> > +          - renesas,r8a779g0-gptp # V4H
> > +          - renesas,r8a779h0-gptp # V4M
> > +      - const: renesas,rcar-gen4-gptp # Generic R-Car Gen4
> 
> Please drop comment or drop generic compatible and make it specific.
> Generic compatibles are discouraged, so don't advertise that. Look how
> other RECENT Renesas bindings do it.

Thanks, I will drop the 'Generic R-Car Gen4' comment. The reason is to 
reduce cruft in the driver. My current view is that there are no 
platform specific quirks needed, but experience show this sometimes 
happens.

Looking at RECENT Renesas bindings this seems to be the way.

> 
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +
> > +  power-domains:
> > +    maxItems: 1
> > +
> > +  resets:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +  - power-domains
> > +  - resets
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
> > +    #include <dt-bindings/power/r8a779g0-sysc.h>
> > +
> > +    gptp: gptp@e6449000 {
> 
> Drop unused label. Node name usually is "phc". Could be "ptp", but not
> "gptp". What is gptp in generic names?

Wops, thanks. Indeed there should be no label and the node named ptp.  
gptp is the name used in the R-Car documentation and I must have typed 
it from muscle memory, my bad.

> 
> >  L:	linux-iio@vger.kernel.org
> 
> 
> Best regards,
> Krzysztof

-- 
Kind Regards,
Niklas Söderlund

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

* Re: [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4
  2026-06-10  8:53     ` Niklas Söderlund
@ 2026-06-10  9:01       ` Krzysztof Kozlowski
  2026-06-10  9:14         ` Niklas Söderlund
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-10  9:01 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: 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

On 10/06/2026 10:53, Niklas Söderlund wrote:
> Hi Krzysztof,
> 
> Thanks for your comments.
> 
> On 2026-06-10 08:54:06 +0200, Krzysztof Kozlowski wrote:
>> On 09/06/2026 23:57, Niklas Söderlund wrote:
>>> Add bindings for the R-Car Gen4 gPTP timer. The timer enables accurate
>>> synchronization of the clock in the control system. The timer is
>>> system-wide and used by different Ethernet devices on each Gen4 platform.
>>
>> A nit, subject: drop second/last, redundant "binding for". The
>> "dt-bindings" prefix is already stating that these are bindings.
> 
> Thanks, will fix.
> 
>> See also:
>> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> 
> Not sure I follow this one, L18 reads,
> 
>   "Few subsystems, like ASoC, media, regulators and SPI, expect reverse 
>   order of the prefixes::"
> 
> But 'git log Documentation/devicetree/bindings/ptp/' shows all commits 
> in that directory use the 'dt-bindings: ptp:' prefix.

5 lines below.
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L23


Best regards,
Krzysztof

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

* Re: [net-next 1/3] dt-bindings: ptp: renesas,rcar-gen4-gptp: Add binding for R-Car Gen4
  2026-06-10  9:01       ` Krzysztof Kozlowski
@ 2026-06-10  9:14         ` Niklas Söderlund
  0 siblings, 0 replies; 10+ messages in thread
From: Niklas Söderlund @ 2026-06-10  9:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: 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

On 2026-06-10 11:01:27 +0200, Krzysztof Kozlowski wrote:
> On 10/06/2026 10:53, Niklas Söderlund wrote:
> > Hi Krzysztof,
> > 
> > Thanks for your comments.
> > 
> > On 2026-06-10 08:54:06 +0200, Krzysztof Kozlowski wrote:
> >> On 09/06/2026 23:57, Niklas Söderlund wrote:
> >>> Add bindings for the R-Car Gen4 gPTP timer. The timer enables accurate
> >>> synchronization of the clock in the control system. The timer is
> >>> system-wide and used by different Ethernet devices on each Gen4 platform.
> >>
> >> A nit, subject: drop second/last, redundant "binding for". The
> >> "dt-bindings" prefix is already stating that these are bindings.
> > 
> > Thanks, will fix.
> > 
> >> See also:
> >> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> > 
> > Not sure I follow this one, L18 reads,
> > 
> >   "Few subsystems, like ASoC, media, regulators and SPI, expect reverse 
> >   order of the prefixes::"
> > 
> > But 'git log Documentation/devicetree/bindings/ptp/' shows all commits 
> > in that directory use the 'dt-bindings: ptp:' prefix.
> 
> 5 lines below.
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L23

Ahh, thanks.

> 
> 
> Best regards,
> Krzysztof

-- 
Kind Regards,
Niklas Söderlund

^ 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