netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next 0/6] net: renesas: Cleanup usage of gPTP flags
@ 2025-09-16 10:10 Niklas Söderlund
  2025-09-16 10:10 ` [net-next 1/6] net: rswitch: Move definition of S4 gPTP offset Niklas Söderlund
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Niklas Söderlund @ 2025-09-16 10:10 UTC (permalink / raw)
  To: Paul Barker, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Yoshihiro Shimoda,
	Geert Uytterhoeven, Magnus Damm, Richard Cochran, netdev,
	linux-renesas-soc
  Cc: Niklas Söderlund

Hello,

This series aim is to prepare for future work that will enable the use 
of gPTP on R-Car RAVB on Gen4. Currently RAVB have a dedicated gPTP 
implementation supported on Gen2 and Gen3 (ravb_ptp.c). For Gen4 a new 
implementation that is already upstream (rcar_gen4_ptp.c) and used by 
other Gen4 devices such as RTSN and RSWITCH is needed.

Unfortunately the design of the Gen2/Gen3 RAVB driver where driver 
specific flags to control gPTP behavior have been mimicked in RTSN and 
RSWITCH. This was OK as there was no overlap between the two gPTP 
implementations. Now that RAVB needs to be able to use both having to 
translate between driver specific flags and common net code flags 
becomes even more cumbersome as there are two sets of driver specific 
flags to pick from.

This series cleans this up for all Renesas drivers using gPTP by 
removing all driver specific flags and using the common flags directly.  
This simplifies drivers while at the same time prepare RAVB to be 
extended with Gen4 support.

Patch 1/6 is a drive by patch where RSWITCH specific define was added in 
the wrong header. Patch 2/6 removes a short-cut used in RTSN and RSWITCH 
that prevents extending Gen4 support to RAVB without fuss. While patch 
3/6 to 6/6 rework the Renesas drivers to use the common flags instead of 
driver specific ones.

There is no intentional behavior change and only a small rework in logic 
in the RAVB driver. Looking at patch 3/6, 4/6 and 6/6 one can clearly 
see how the code have been copied from RAVB to the later implementations 
in RTSN and RSWITCH.

Niklas Söderlund (6):
  net: rswitch: Move definition of S4 gPTP offset
  net: rcar_gen4_ptp: Move control fields to users
  net: rswitch: Use common defines for time stamping control
  net: rtsn: Use common defines for time stamping control
  net: rcar_gen4_ptp: Remove unused defines
  net: ravb: Use common defines for time stamping control

 drivers/net/ethernet/renesas/ravb.h          | 14 +----
 drivers/net/ethernet/renesas/ravb_main.c     | 62 +++++++++-----------
 drivers/net/ethernet/renesas/rcar_gen4_ptp.h | 13 ----
 drivers/net/ethernet/renesas/rswitch.h       |  3 +
 drivers/net/ethernet/renesas/rswitch_main.c  | 41 ++++---------
 drivers/net/ethernet/renesas/rtsn.c          | 47 ++++-----------
 6 files changed, 59 insertions(+), 121 deletions(-)

-- 
2.51.0


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

end of thread, other threads:[~2025-09-16 20:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 10:10 [net-next 0/6] net: renesas: Cleanup usage of gPTP flags Niklas Söderlund
2025-09-16 10:10 ` [net-next 1/6] net: rswitch: Move definition of S4 gPTP offset Niklas Söderlund
2025-09-16 12:16   ` Andrew Lunn
2025-09-16 12:20     ` Niklas Söderlund
2025-09-16 10:10 ` [net-next 2/6] net: rcar_gen4_ptp: Move control fields to users Niklas Söderlund
2025-09-16 12:22   ` Andrew Lunn
2025-09-16 10:10 ` [net-next 3/6] net: rswitch: Use common defines for time stamping control Niklas Söderlund
2025-09-16 12:31   ` Andrew Lunn
2025-09-16 13:09     ` Niklas Söderlund
2025-09-16 10:10 ` [net-next 4/6] net: rtsn: " Niklas Söderlund
2025-09-16 10:10 ` [net-next 5/6] net: rcar_gen4_ptp: Remove unused defines Niklas Söderlund
2025-09-16 12:32   ` Andrew Lunn
2025-09-16 10:10 ` [net-next 6/6] net: ravb: Use common defines for time stamping control Niklas Söderlund
2025-09-16 12:38   ` Andrew Lunn
2025-09-16 13:08     ` Niklas Söderlund
2025-09-16 14:49       ` Andrew Lunn
2025-09-16 20:53         ` 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).