* [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support
@ 2023-11-17 16:43 Niklas Söderlund
2023-11-17 16:43 ` [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
` (4 more replies)
0 siblings, 5 replies; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 16:43 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.
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: Add V4H clock setting
net: ethernet: renesas: rcar_gen4_ptp: Break out to module
drivers/net/ethernet/renesas/Kconfig | 10 ++++++++
drivers/net/ethernet/renesas/Makefile | 5 ++--
drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 24 +++++++++++++++-----
drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 13 +++++++----
drivers/net/ethernet/renesas/rswitch.c | 2 +-
5 files changed, 40 insertions(+), 14 deletions(-)
--
2.42.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment
2023-11-17 16:43 [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
@ 2023-11-17 16:43 ` Niklas Söderlund
2023-11-17 17:49 ` Wolfram Sang
2023-11-17 16:43 ` [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
` (3 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 16:43 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev
Cc: linux-renesas-soc, Niklas Söderlund
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>
---
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] 16+ messages in thread
* [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout
2023-11-17 16:43 [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
2023-11-17 16:43 ` [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
@ 2023-11-17 16:43 ` Niklas Söderlund
2023-11-17 17:52 ` Wolfram Sang
2023-11-17 16:43 ` [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
` (2 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 16:43 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev
Cc: linux-renesas-soc, Niklas Söderlund
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>
---
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] 16+ messages in thread
* [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register layout
2023-11-17 16:43 [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
2023-11-17 16:43 ` [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
2023-11-17 16:43 ` [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
@ 2023-11-17 16:43 ` Niklas Söderlund
2023-11-17 17:56 ` Wolfram Sang
2023-11-17 16:43 ` [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting Niklas Söderlund
2023-11-17 16:43 ` [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
4 siblings, 1 reply; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 16:43 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev
Cc: linux-renesas-soc, Niklas Söderlund
All know 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>
---
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] 16+ messages in thread
* [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting
2023-11-17 16:43 [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
` (2 preceding siblings ...)
2023-11-17 16:43 ` [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
@ 2023-11-17 16:43 ` Niklas Söderlund
2023-11-17 18:00 ` Wolfram Sang
2023-11-18 11:16 ` Geert Uytterhoeven
2023-11-17 16:43 ` [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
4 siblings, 2 replies; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 16:43 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev
Cc: linux-renesas-soc, Niklas Söderlund
The gPTP clock is different between R-Car S4 and R-Car V4H. In
preparation of adding R-Car V4H support define the clock setting.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
index 35664d1dc472..b83a209e9845 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
@@ -9,8 +9,12 @@
#include <linux/ptp_clock_kernel.h>
-#define PTPTIVC_INIT 0x19000000 /* 320MHz */
-#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT
+#define PTPTIVC_INIT_200MHZ 0x28000000 /* 200MHz */
+#define PTPTIVC_INIT_320MHZ 0x19000000 /* 320MHz */
+
+#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT_320MHZ
+#define RCAR_GEN4_PTP_CLOCK_V4H PTPTIVC_INIT_200MHZ
+
#define RCAR_GEN4_GPTP_OFFSET_S4 0x00018000
enum rcar_gen4_ptp_reg_layout {
--
2.42.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
2023-11-17 16:43 [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
` (3 preceding siblings ...)
2023-11-17 16:43 ` [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting Niklas Söderlund
@ 2023-11-17 16:43 ` Niklas Söderlund
2023-11-18 11:20 ` Geert Uytterhoeven
4 siblings, 1 reply; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 16:43 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev
Cc: linux-renesas-soc, Niklas Söderlund
The Gen3 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>
---
drivers/net/ethernet/renesas/Kconfig | 10 ++++++++++
drivers/net/ethernet/renesas/Makefile | 5 +++--
drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 5 +++++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 8ef5b0241e64..4e7d8546abe2 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -44,7 +44,17 @@ 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"
+ depends on ARCH_RENESAS || 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 59f6351e9ae9..22552a8f5430 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -166,6 +166,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)
{
@@ -173,6 +174,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)
{
@@ -186,3 +188,6 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
return ptp;
}
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
+
+MODULE_LICENSE("GPL");
--
2.42.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment
2023-11-17 16:43 ` [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
@ 2023-11-17 17:49 ` Wolfram Sang
0 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2023-11-17 17:49 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
On Fri, Nov 17, 2023 at 05:43:28PM +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>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout
2023-11-17 16:43 ` [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
@ 2023-11-17 17:52 ` Wolfram Sang
0 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2023-11-17 17:52 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 380 bytes --]
On Fri, Nov 17, 2023 at 05:43:29PM +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>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared register layout
2023-11-17 16:43 ` [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
@ 2023-11-17 17:56 ` Wolfram Sang
0 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2023-11-17 17:56 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 412 bytes --]
On Fri, Nov 17, 2023 at 05:43:30PM +0100, Niklas Söderlund wrote:
> All know R-Car Gen4 SoC share the same register layout, rename the R-Car
"known"
> 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>
Other than that:
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting
2023-11-17 16:43 ` [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting Niklas Söderlund
@ 2023-11-17 18:00 ` Wolfram Sang
2023-11-17 18:51 ` Niklas Söderlund
2023-11-18 11:16 ` Geert Uytterhoeven
1 sibling, 1 reply; 16+ messages in thread
From: Wolfram Sang @ 2023-11-17 18:00 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 135 bytes --]
> +#define RCAR_GEN4_PTP_CLOCK_V4H PTPTIVC_INIT_200MHZ
Is this easier right now or could it be added together with the TSN
driver?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting
2023-11-17 18:00 ` Wolfram Sang
@ 2023-11-17 18:51 ` Niklas Söderlund
2023-11-17 21:21 ` Wolfram Sang
0 siblings, 1 reply; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-17 18:51 UTC (permalink / raw)
To: Wolfram Sang, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Richard Cochran, netdev, linux-renesas-soc
Hi Wolfram,
Thanks for your review.
On 2023-11-17 13:00:42 -0500, Wolfram Sang wrote:
>
> > +#define RCAR_GEN4_PTP_CLOCK_V4H PTPTIVC_INIT_200MHZ
>
> Is this easier right now or could it be added together with the TSN
> driver?
>
I could not make up my mind, I think ether is fine. I opted to put it in
this series to group all gPTP changes in one series. If you think it's
better moved to the upcoming TSN series I can move it there.
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting
2023-11-17 18:51 ` Niklas Söderlund
@ 2023-11-17 21:21 ` Wolfram Sang
0 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2023-11-17 21:21 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
> I could not make up my mind, I think ether is fine. I opted to put it in
> this series to group all gPTP changes in one series. If you think it's
> better moved to the upcoming TSN series I can move it there.
No, I also think either is fine.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting
2023-11-17 16:43 ` [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting Niklas Söderlund
2023-11-17 18:00 ` Wolfram Sang
@ 2023-11-18 11:16 ` Geert Uytterhoeven
2023-11-18 15:56 ` Niklas Söderlund
1 sibling, 1 reply; 16+ messages in thread
From: Geert Uytterhoeven @ 2023-11-18 11:16 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
Hi Niklas,
On Fri, Nov 17, 2023 at 5:45 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The gPTP clock is different between R-Car S4 and R-Car V4H. In
> preparation of adding R-Car V4H support define the clock setting.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Thanks for your patch!
> --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
> +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
> @@ -9,8 +9,12 @@
>
> #include <linux/ptp_clock_kernel.h>
>
> -#define PTPTIVC_INIT 0x19000000 /* 320MHz */
> -#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT
> +#define PTPTIVC_INIT_200MHZ 0x28000000 /* 200MHz */
> +#define PTPTIVC_INIT_320MHZ 0x19000000 /* 320MHz */
> +
> +#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT_320MHZ
> +#define RCAR_GEN4_PTP_CLOCK_V4H PTPTIVC_INIT_200MHZ
I think the gPTP Timer Increment Value Configuration value should be
calculated from the module clock rate instead (rsw2 runs at 320 MHz
on R-Car S4, S0D4_HSC and tsn run at 200 MHz on R-Car V4H).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
2023-11-17 16:43 ` [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
@ 2023-11-18 11:20 ` Geert Uytterhoeven
2023-11-18 15:58 ` Niklas Söderlund
0 siblings, 1 reply; 16+ messages in thread
From: Geert Uytterhoeven @ 2023-11-18 11:20 UTC (permalink / raw)
To: Niklas Söderlund
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
Hi Niklas,
Thanks for your patch!
On Fri, Nov 17, 2023 at 5:45 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The Gen3 gPTP support will be shared between the existing Renesas
Gen4
> 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>
> --- a/drivers/net/ethernet/renesas/Kconfig
> +++ b/drivers/net/ethernet/renesas/Kconfig
> @@ -44,7 +44,17 @@ 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"
> + depends on ARCH_RENESAS || COMPILE_TEST
Perhaps
tristate "Renesas R-Car Gen4 gPTP support" if COMPILE_TEST
?
The driver is already auto-selected when needed.
> + select CRC32
> + select MII
> + select PHYLIB
> + help
> + Renesas R-Car Gen4 gPTP device driver.
> +
> endif # NET_VENDOR_RENESAS
> --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
> +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
> @@ -186,3 +188,6 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
>
> return ptp;
> }
> +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
> +
> +MODULE_LICENSE("GPL");
Please add the other MODULE_*() definitions,too.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting
2023-11-18 11:16 ` Geert Uytterhoeven
@ 2023-11-18 15:56 ` Niklas Söderlund
0 siblings, 0 replies; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-18 15:56 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
Hi Geert,
Thanks for your review.
On 2023-11-18 12:16:51 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
>
> On Fri, Nov 17, 2023 at 5:45 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > The gPTP clock is different between R-Car S4 and R-Car V4H. In
> > preparation of adding R-Car V4H support define the clock setting.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
>
> Thanks for your patch!
>
> > --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
> > +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.h
> > @@ -9,8 +9,12 @@
> >
> > #include <linux/ptp_clock_kernel.h>
> >
> > -#define PTPTIVC_INIT 0x19000000 /* 320MHz */
> > -#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT
> > +#define PTPTIVC_INIT_200MHZ 0x28000000 /* 200MHz */
> > +#define PTPTIVC_INIT_320MHZ 0x19000000 /* 320MHz */
> > +
> > +#define RCAR_GEN4_PTP_CLOCK_S4 PTPTIVC_INIT_320MHZ
> > +#define RCAR_GEN4_PTP_CLOCK_V4H PTPTIVC_INIT_200MHZ
>
> I think the gPTP Timer Increment Value Configuration value should be
> calculated from the module clock rate instead (rsw2 runs at 320 MHz
> on R-Car S4, S0D4_HSC and tsn run at 200 MHz on R-Car V4H).
This is a great idea, I will do so for v2.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
2023-11-18 11:20 ` Geert Uytterhoeven
@ 2023-11-18 15:58 ` Niklas Söderlund
0 siblings, 0 replies; 16+ messages in thread
From: Niklas Söderlund @ 2023-11-18 15:58 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev, linux-renesas-soc
Hi Geert,
Thanks for your review.
On 2023-11-18 12:20:41 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
>
> Thanks for your patch!
>
> On Fri, Nov 17, 2023 at 5:45 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > The Gen3 gPTP support will be shared between the existing Renesas
>
> Gen4
>
> > 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>
>
> > --- a/drivers/net/ethernet/renesas/Kconfig
> > +++ b/drivers/net/ethernet/renesas/Kconfig
> > @@ -44,7 +44,17 @@ 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"
> > + depends on ARCH_RENESAS || COMPILE_TEST
>
> Perhaps
>
> tristate "Renesas R-Car Gen4 gPTP support" if COMPILE_TEST
>
> ?
>
> The driver is already auto-selected when needed.
Good idea, will do for v2.
>
> > + select CRC32
> > + select MII
> > + select PHYLIB
> > + help
> > + Renesas R-Car Gen4 gPTP device driver.
> > +
> > endif # NET_VENDOR_RENESAS
>
> > --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
> > +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
>
> > @@ -186,3 +188,6 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
> >
> > return ptp;
> > }
> > +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
> > +
> > +MODULE_LICENSE("GPL");
>
> Please add the other MODULE_*() definitions,too.
Wops, checkpatch only complained about MODULE_LICENSE, will fix for v2.
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2023-11-18 15:58 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17 16:43 [net-next 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
2023-11-17 16:43 ` [net-next 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
2023-11-17 17:49 ` Wolfram Sang
2023-11-17 16:43 ` [net-next 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
2023-11-17 17:52 ` Wolfram Sang
2023-11-17 16:43 ` [net-next 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
2023-11-17 17:56 ` Wolfram Sang
2023-11-17 16:43 ` [net-next 4/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H clock setting Niklas Söderlund
2023-11-17 18:00 ` Wolfram Sang
2023-11-17 18:51 ` Niklas Söderlund
2023-11-17 21:21 ` Wolfram Sang
2023-11-18 11:16 ` Geert Uytterhoeven
2023-11-18 15:56 ` Niklas Söderlund
2023-11-17 16:43 ` [net-next 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Niklas Söderlund
2023-11-18 11:20 ` Geert Uytterhoeven
2023-11-18 15:58 ` 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;
as well as URLs for NNTP newsgroup(s).