netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support
@ 2023-11-21 15:53 Niklas Söderlund
  2023-11-21 15:53 ` [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Niklas Söderlund @ 2023-11-21 15:53 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev
  Cc: linux-renesas-soc, Niklas Söderlund

Hello,

This small series prepares the rcar_gen4_ptp to be useable both on both
R-Car S4 and V4H. The only in-tree driver that make use of this is
rswtich on S4. A new Ethernet (R-Car Ethernet TSN) driver for V4H is on
it's way that also will make use of rcar_gen4_ptp functionality.

Patch 1-2 are small improvements to the existing driver. While patch 3-4
adds V4H support. Finally patch 5 turns rcar_gen4_ptp into a separate
module to allow the gPTP functionality to be shared between the two
users without having to duplicate the code in each.

See each patch for changelog.

Niklas Söderlund (5):
  net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment
  net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout
  net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register
    layout
  net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock
    rate
  net: ethernet: renesas: rcar_gen4_ptp: Break out to module

 drivers/net/ethernet/renesas/Kconfig         |  9 +++++
 drivers/net/ethernet/renesas/Makefile        |  5 ++-
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 40 ++++++++++++++++----
 drivers/net/ethernet/renesas/rcar_gen4_ptp.h |  9 ++---
 drivers/net/ethernet/renesas/rswitch.c       |  4 +-
 5 files changed, 49 insertions(+), 18 deletions(-)

-- 
2.42.1


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

* [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment
  2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
@ 2023-11-21 15:53 ` Niklas Söderlund
  2023-11-22 20:32   ` Simon Horman
  2023-11-21 15:53 ` [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Niklas Söderlund @ 2023-11-21 15:53 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev
  Cc: linux-renesas-soc, Niklas Söderlund, Wolfram Sang

The comments intent was to indicates which function uses the enum. While
upstreaming rcar_gen4_ptp the function was renamed but this comment was
left with the old function name.

Instead of correcting the comment remove it, it adds little value.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
* Changes since v2
- No change.

* Changes since v1
- Added review tag from Wolfram.
---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
index b1bbea8d3a52..9f148110df66 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
@@ -13,7 +13,6 @@
 #define RCAR_GEN4_PTP_CLOCK_S4		PTPTIVC_INIT
 #define RCAR_GEN4_GPTP_OFFSET_S4	0x00018000
 
-/* for rcar_gen4_ptp_init */
 enum rcar_gen4_ptp_reg_layout {
 	RCAR_GEN4_PTP_REG_LAYOUT_S4
 };
-- 
2.42.1


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

* [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout
  2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
  2023-11-21 15:53 ` [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
@ 2023-11-21 15:53 ` Niklas Söderlund
  2023-11-22 20:32   ` Simon Horman
  2023-11-21 15:53 ` [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Niklas Söderlund @ 2023-11-21 15:53 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev
  Cc: linux-renesas-soc, Niklas Söderlund, Wolfram Sang

Instead of printing a warning and proceeding with an unknown register
layout return an error. The only call site is already prepared to
propagate the error.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
* Changes since v2
- No change.

* Changes since v1
- Added review tag from Wolfram.
---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index c007e33c47e1..443ca5a18703 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -130,23 +130,30 @@ static struct ptp_clock_info rcar_gen4_ptp_info = {
 	.enable = rcar_gen4_ptp_enable,
 };
 
-static void rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv,
-				   enum rcar_gen4_ptp_reg_layout layout)
+static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv,
+				  enum rcar_gen4_ptp_reg_layout layout)
 {
-	WARN_ON(layout != RCAR_GEN4_PTP_REG_LAYOUT_S4);
+	if (layout != RCAR_GEN4_PTP_REG_LAYOUT_S4)
+		return -EINVAL;
 
 	ptp_priv->offs = &s4_offs;
+
+	return 0;
 }
 
 int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
 			   enum rcar_gen4_ptp_reg_layout layout, u32 clock)
 {
+	int ret;
+
 	if (ptp_priv->initialized)
 		return 0;
 
 	spin_lock_init(&ptp_priv->lock);
 
-	rcar_gen4_ptp_set_offs(ptp_priv, layout);
+	ret = rcar_gen4_ptp_set_offs(ptp_priv, layout);
+	if (ret)
+		return ret;
 
 	ptp_priv->default_addend = clock;
 	iowrite32(ptp_priv->default_addend, ptp_priv->addr + ptp_priv->offs->increment);
-- 
2.42.1


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

* [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register layout
  2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
  2023-11-21 15:53 ` [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
  2023-11-21 15:53 ` [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
@ 2023-11-21 15:53 ` Niklas Söderlund
  2023-11-22 20:32   ` Simon Horman
  2023-11-21 15:53 ` [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate Niklas Söderlund
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Niklas Söderlund @ 2023-11-21 15:53 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev
  Cc: linux-renesas-soc, Niklas Söderlund, Wolfram Sang

All known R-Car Gen4 SoC share the same register layout, rename the
R-Car S4 specific identifiers so they can be shared with the upcoming
R-Car V4H support.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
* Changes since v2
- No change.

* Changes since v1
- Fix spelling in commit message.
- Added review tag from Wolfram.
---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 6 +++---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 4 ++--
 drivers/net/ethernet/renesas/rswitch.c       | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index 443ca5a18703..59f6351e9ae9 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -14,7 +14,7 @@
 #include "rcar_gen4_ptp.h"
 #define ptp_to_priv(ptp)	container_of(ptp, struct rcar_gen4_ptp_private, info)
 
-static const struct rcar_gen4_ptp_reg_offset s4_offs = {
+static const struct rcar_gen4_ptp_reg_offset gen4_offs = {
 	.enable = PTPTMEC,
 	.disable = PTPTMDC,
 	.increment = PTPTIVC0,
@@ -133,10 +133,10 @@ static struct ptp_clock_info rcar_gen4_ptp_info = {
 static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv,
 				  enum rcar_gen4_ptp_reg_layout layout)
 {
-	if (layout != RCAR_GEN4_PTP_REG_LAYOUT_S4)
+	if (layout != RCAR_GEN4_PTP_REG_LAYOUT)
 		return -EINVAL;
 
-	ptp_priv->offs = &s4_offs;
+	ptp_priv->offs = &gen4_offs;
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
index 9f148110df66..35664d1dc472 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
@@ -14,7 +14,7 @@
 #define RCAR_GEN4_GPTP_OFFSET_S4	0x00018000
 
 enum rcar_gen4_ptp_reg_layout {
-	RCAR_GEN4_PTP_REG_LAYOUT_S4
+	RCAR_GEN4_PTP_REG_LAYOUT
 };
 
 /* driver's definitions */
@@ -27,7 +27,7 @@ enum rcar_gen4_ptp_reg_layout {
 
 #define PTPRO				0
 
-enum rcar_gen4_ptp_reg_s4 {
+enum rcar_gen4_ptp_reg {
 	PTPTMEC		= PTPRO + 0x0010,
 	PTPTMDC		= PTPRO + 0x0014,
 	PTPTIVC0	= PTPRO + 0x0020,
diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
index 43a7795d6591..e1e29a2caf22 100644
--- a/drivers/net/ethernet/renesas/rswitch.c
+++ b/drivers/net/ethernet/renesas/rswitch.c
@@ -1828,7 +1828,7 @@ static int rswitch_init(struct rswitch_private *priv)
 
 	rswitch_fwd_init(priv);
 
-	err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT_S4,
+	err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT,
 				     RCAR_GEN4_PTP_CLOCK_S4);
 	if (err < 0)
 		goto err_ptp_register;
-- 
2.42.1


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

* [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate
  2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
                   ` (2 preceding siblings ...)
  2023-11-21 15:53 ` [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
@ 2023-11-21 15:53 ` Niklas Söderlund
  2023-11-22 20:33   ` Simon Horman
  2023-11-21 15:53 ` [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
  2023-11-23 11:10 ` [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support patchwork-bot+netdevbpf
  5 siblings, 1 reply; 12+ messages in thread
From: Niklas Söderlund @ 2023-11-21 15:53 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev
  Cc: linux-renesas-soc, Niklas Söderlund, Geert Uytterhoeven

Instead of using hard coded clock increment values for each SoC derive
the clock increment from the module clock. This is done in preparation
to support a second platform, R-Car V4H that uses a 200Mhz clock
compared with the 320Mhz clock used on R-Car S4.

Tested on both SoCs,

S4 reports a clock of 320000000Hz which gives a value of 0x19000000.
Documentation says a 320Mhz clock is used and the correct increment for
that clock is 0x19000000.

V4H reports a clock of 199999992Hz which gives a value of 0x2800001a.
Documentation says a 200Mhz clock is used and the correct increment for
that clock is 0x28000000.

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- No change.

* Changes since v1
- New in v2. In v1 a patch adding a new hard coded value for V4H was
  present, that patch have been dropped in favor of this approach.
---
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 14 ++++++++++++--
 drivers/net/ethernet/renesas/rcar_gen4_ptp.h |  4 +---
 drivers/net/ethernet/renesas/rswitch.c       |  2 +-
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index 59f6351e9ae9..9583894634ae 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -141,8 +141,18 @@ static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv,
 	return 0;
 }
 
+static s64 rcar_gen4_ptp_rate_to_increment(u32 rate)
+{
+	/* Timer increment in ns.
+	 * bit[31:27] - integer
+	 * bit[26:0]  - decimal
+	 * increment[ns] = perid[ns] * 2^27 => (1ns * 2^27) / rate[hz]
+	 */
+	return div_s64(1000000000LL << 27, rate);
+}
+
 int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
-			   enum rcar_gen4_ptp_reg_layout layout, u32 clock)
+			   enum rcar_gen4_ptp_reg_layout layout, u32 rate)
 {
 	int ret;
 
@@ -155,7 +165,7 @@ int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
 	if (ret)
 		return ret;
 
-	ptp_priv->default_addend = clock;
+	ptp_priv->default_addend = rcar_gen4_ptp_rate_to_increment(rate);
 	iowrite32(ptp_priv->default_addend, ptp_priv->addr + ptp_priv->offs->increment);
 	ptp_priv->clock = ptp_clock_register(&ptp_priv->info, NULL);
 	if (IS_ERR(ptp_priv->clock))
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
index 35664d1dc472..e22da5acd53d 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
@@ -9,8 +9,6 @@
 
 #include <linux/ptp_clock_kernel.h>
 
-#define PTPTIVC_INIT			0x19000000	/* 320MHz */
-#define RCAR_GEN4_PTP_CLOCK_S4		PTPTIVC_INIT
 #define RCAR_GEN4_GPTP_OFFSET_S4	0x00018000
 
 enum rcar_gen4_ptp_reg_layout {
@@ -64,7 +62,7 @@ struct rcar_gen4_ptp_private {
 };
 
 int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
-			   enum rcar_gen4_ptp_reg_layout layout, u32 clock);
+			   enum rcar_gen4_ptp_reg_layout layout, u32 rate);
 int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv);
 struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev);
 
diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
index e1e29a2caf22..d6089429f654 100644
--- a/drivers/net/ethernet/renesas/rswitch.c
+++ b/drivers/net/ethernet/renesas/rswitch.c
@@ -1829,7 +1829,7 @@ static int rswitch_init(struct rswitch_private *priv)
 	rswitch_fwd_init(priv);
 
 	err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT,
-				     RCAR_GEN4_PTP_CLOCK_S4);
+				     clk_get_rate(priv->clk));
 	if (err < 0)
 		goto err_ptp_register;
 
-- 
2.42.1


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

* [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
  2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
                   ` (3 preceding siblings ...)
  2023-11-21 15:53 ` [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate Niklas Söderlund
@ 2023-11-21 15:53 ` Niklas Söderlund
  2023-11-22 20:33   ` Simon Horman
  2023-11-23 11:10 ` [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support patchwork-bot+netdevbpf
  5 siblings, 1 reply; 12+ messages in thread
From: Niklas Söderlund @ 2023-11-21 15:53 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev
  Cc: linux-renesas-soc, Niklas Söderlund

The Gen4 gPTP support will be shared between the existing Renesas
Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In
preparation for this break out the gPTP support to its own module.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- Drop the unneeded 'depends on' line from Kconfig symbol
  RENESAS_GEN4_PTP.

* Changes since v1
- s/Gen3/Gen4/ in commit message.
- Add missing MODULE_AUTHOR() and MODULE_DESCRIPTION() definitions.
- Make Kconfig tristate depend on COMPILE_TEST. All drivers that make
  use of the shared code auto selects this anyhow.
---
 drivers/net/ethernet/renesas/Kconfig         | 9 +++++++++
 drivers/net/ethernet/renesas/Makefile        | 5 +++--
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 7 +++++++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 8ef5b0241e64..733cbb6eb3ed 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -44,7 +44,16 @@ config RENESAS_ETHER_SWITCH
 	select CRC32
 	select MII
 	select PHYLINK
+	select RENESAS_GEN4_PTP
 	help
 	  Renesas Ethernet Switch device driver.
 
+config RENESAS_GEN4_PTP
+	tristate "Renesas R-Car Gen4 gPTP support" if COMPILE_TEST
+	select CRC32
+	select MII
+	select PHYLIB
+	help
+	  Renesas R-Car Gen4 gPTP device driver.
+
 endif # NET_VENDOR_RENESAS
diff --git a/drivers/net/ethernet/renesas/Makefile b/drivers/net/ethernet/renesas/Makefile
index e8fd85b5fe8f..9070acfd6aaf 100644
--- a/drivers/net/ethernet/renesas/Makefile
+++ b/drivers/net/ethernet/renesas/Makefile
@@ -8,5 +8,6 @@ obj-$(CONFIG_SH_ETH) += sh_eth.o
 ravb-objs := ravb_main.o ravb_ptp.o
 obj-$(CONFIG_RAVB) += ravb.o
 
-rswitch_drv-objs := rswitch.o rcar_gen4_ptp.o
-obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch_drv.o
+obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch.o
+
+obj-$(CONFIG_RENESAS_GEN4_PTP) += rcar_gen4_ptp.o
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index 9583894634ae..72e7fcc56693 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -176,6 +176,7 @@ int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_register);
 
 int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv)
 {
@@ -183,6 +184,7 @@ int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv)
 
 	return ptp_clock_unregister(ptp_priv->clock);
 }
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_unregister);
 
 struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
 {
@@ -196,3 +198,8 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
 
 	return ptp;
 }
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
+
+MODULE_AUTHOR("Yoshihiro Shimoda");
+MODULE_DESCRIPTION("Renesas R-Car Gen4 gPTP driver");
+MODULE_LICENSE("GPL");
-- 
2.42.1


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

* Re: [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment
  2023-11-21 15:53 ` [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
@ 2023-11-22 20:32   ` Simon Horman
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-11-22 20:32 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev, linux-renesas-soc, Wolfram Sang

On Tue, Nov 21, 2023 at 04:53:02PM +0100, Niklas Söderlund wrote:
> The comments intent was to indicates which function uses the enum. While
> upstreaming rcar_gen4_ptp the function was renamed but this comment was
> left with the old function name.
> 
> Instead of correcting the comment remove it, it adds little value.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout
  2023-11-21 15:53 ` [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
@ 2023-11-22 20:32   ` Simon Horman
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-11-22 20:32 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev, linux-renesas-soc, Wolfram Sang

On Tue, Nov 21, 2023 at 04:53:03PM +0100, Niklas Söderlund wrote:
> Instead of printing a warning and proceeding with an unknown register
> layout return an error. The only call site is already prepared to
> propagate the error.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register layout
  2023-11-21 15:53 ` [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
@ 2023-11-22 20:32   ` Simon Horman
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-11-22 20:32 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev, linux-renesas-soc, Wolfram Sang

On Tue, Nov 21, 2023 at 04:53:04PM +0100, Niklas Söderlund wrote:
> All known R-Car Gen4 SoC share the same register layout, rename the
> R-Car S4 specific identifiers so they can be shared with the upcoming
> R-Car V4H support.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate
  2023-11-21 15:53 ` [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate Niklas Söderlund
@ 2023-11-22 20:33   ` Simon Horman
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-11-22 20:33 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev, linux-renesas-soc, Geert Uytterhoeven

On Tue, Nov 21, 2023 at 04:53:05PM +0100, Niklas Söderlund wrote:
> Instead of using hard coded clock increment values for each SoC derive
> the clock increment from the module clock. This is done in preparation
> to support a second platform, R-Car V4H that uses a 200Mhz clock
> compared with the 320Mhz clock used on R-Car S4.
> 
> Tested on both SoCs,
> 
> S4 reports a clock of 320000000Hz which gives a value of 0x19000000.
> Documentation says a 320Mhz clock is used and the correct increment for
> that clock is 0x19000000.
> 
> V4H reports a clock of 199999992Hz which gives a value of 0x2800001a.
> Documentation says a 200Mhz clock is used and the correct increment for
> that clock is 0x28000000.
> 
> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
  2023-11-21 15:53 ` [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
@ 2023-11-22 20:33   ` Simon Horman
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-11-22 20:33 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Richard Cochran, netdev, linux-renesas-soc

On Tue, Nov 21, 2023 at 04:53:06PM +0100, Niklas Söderlund wrote:
> The Gen4 gPTP support will be shared between the existing Renesas
> Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In
> preparation for this break out the gPTP support to its own module.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support
  2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
                   ` (4 preceding siblings ...)
  2023-11-21 15:53 ` [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
@ 2023-11-23 11:10 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-11-23 11:10 UTC (permalink / raw)
  To: =?utf-8?q?Niklas_S=C3=B6derlund_=3Cniklas=2Esoderlund+renesas=40ragnatech=2E?=,
	=?utf-8?q?se=3E?=
  Cc: davem, edumazet, kuba, pabeni, richardcochran, netdev, linux-renesas-soc

Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue, 21 Nov 2023 16:53:01 +0100 you wrote:
> Hello,
> 
> This small series prepares the rcar_gen4_ptp to be useable both on both
> R-Car S4 and V4H. The only in-tree driver that make use of this is
> rswtich on S4. A new Ethernet (R-Car Ethernet TSN) driver for V4H is on
> it's way that also will make use of rcar_gen4_ptp functionality.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment
    https://git.kernel.org/netdev/net-next/c/d73dcff9eb0d
  - [net-next,v3,2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout
    https://git.kernel.org/netdev/net-next/c/9f3995707e35
  - [net-next,v3,3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register layout
    https://git.kernel.org/netdev/net-next/c/46c361a04635
  - [net-next,v3,4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate
    https://git.kernel.org/netdev/net-next/c/be5f81d37f79
  - [net-next,v3,5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
    https://git.kernel.org/netdev/net-next/c/8c1c66235e03

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-11-23 11:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
2023-11-21 15:53 ` [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
2023-11-22 20:32   ` Simon Horman
2023-11-21 15:53 ` [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
2023-11-22 20:32   ` Simon Horman
2023-11-21 15:53 ` [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
2023-11-22 20:32   ` Simon Horman
2023-11-21 15:53 ` [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate Niklas Söderlund
2023-11-22 20:33   ` Simon Horman
2023-11-21 15:53 ` [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
2023-11-22 20:33   ` Simon Horman
2023-11-23 11:10 ` [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support 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;
as well as URLs for NNTP newsgroup(s).