]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: rswitch: Move definition of S4 gPTP offset
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tue, 4 Nov 2025 22:24:14 +0000 (23:24 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 7 Nov 2025 01:38:25 +0000 (17:38 -0800)
The files rcar_gen4_ptp.{c,h} implements an abstraction of the gPTP
support implemented together with different other IP blocks. The first
device added which supported this was RSWITCH on R-Car S4.

While doing so the RSWITCH R-Car S4 specific offset was added to the
generic Gen4 gPTP header file. Move it to the RSWITCH driver to make it
clear it only applies to this driver.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://patch.msgid.link/20251104222420.882731-2-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/renesas/rcar_gen4_ptp.h
drivers/net/ethernet/renesas/rswitch_main.c

index f77e79e4735726008cbd4e01cf39b1c9bbb42bb8..536badd798ccefd21301c7c710b94fccfcca2f5b 100644 (file)
@@ -9,8 +9,6 @@
 
 #include <linux/ptp_clock_kernel.h>
 
-#define RCAR_GEN4_GPTP_OFFSET_S4       0x00018000
-
 /* driver's definitions */
 #define RCAR_GEN4_RXTSTAMP_ENABLED             BIT(0)
 #define RCAR_GEN4_RXTSTAMP_TYPE_V2_L2_EVENT    BIT(1)
index f21a814aa9d114c0bcd12b2ba8445b41847ebb2b..24ed33ac4bcd8c8e6c2fd4b927f258345cfc28f1 100644 (file)
@@ -30,6 +30,8 @@
 #include "rswitch.h"
 #include "rswitch_l2.h"
 
+#define RSWITCH_GPTP_OFFSET_S4 0x00018000
+
 static int rswitch_reg_wait(void __iomem *addr, u32 offs, u32 mask, u32 expected)
 {
        u32 val;
@@ -2175,7 +2177,7 @@ static int renesas_eth_sw_probe(struct platform_device *pdev)
        if (IS_ERR(priv->addr))
                return PTR_ERR(priv->addr);
 
-       priv->ptp_priv->addr = priv->addr + RCAR_GEN4_GPTP_OFFSET_S4;
+       priv->ptp_priv->addr = priv->addr + RSWITCH_GPTP_OFFSET_S4;
 
        ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40));
        if (ret < 0) {