Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net: lan969x: skew the core clock by 200 ppm
@ 2026-11-13 10:19 Daniel Machon
  2026-11-13 10:19 ` [PATCH net-next 1/4] net: lan969x: add the core PLL registers Daniel Machon
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Daniel Machon @ 2026-11-13 10:19 UTC (permalink / raw)
  To: UNGLinuxDriver, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Steen Hegelund, Philipp Zabel,
	Richard Cochran
  Cc: netdev, linux-arm-kernel, linux-kernel

At its 328.125 MHz default, the lan969x core clock is too close to the
line clock frequencies for the high accuracy phase detectors to work as
intended, which degrades PTP accuracy. The core clock should therefore
be skewed about 200 ppm up. The PTP time of day (TOD) increment is
already set up for the skewed rate, but the driver leaves the core PLL
at its default, so the TOD and the clock that drives the scheduler run
200 ppm apart.

This series programs the core PLL to the skewed rate, and reworks the
PTP frequency adjustment to scale the nominal increment directly. It is
not a fix as such, but an improvement: nothing breaks at the default
rate, and this moves lan969x to the core clock configuration
recommended for PTP.

The difference can be seen with taprio: timestamping the frames released
by a schedule with a 1 ms cycle time shows the gates opening about every
1000.2 us instead of every 1000 us.

Patch 1 adds the CHIP_TOP registers and maps the target.

Patch 2 enables the switch core only after the core clock is
configured, so the PLL is not reprogrammed underneath a running queue
system.

Patch 3 programs the core PLL.

Patch 4 makes the PTP frequency adjustment scale the nominal increment
instead of using a separate one ppm table.

Tested on lan969x and sparx5.

---
Daniel Machon (4):
      net: lan969x: add the core PLL registers
      net: sparx5/lan969x: enable the switch core after clock setup
      net: lan969x: configure the core PLL
      net: sparx5/lan969x: scale the nominal TOD increment in adjfine

 .../ethernet/microchip/sparx5/lan969x/lan969x.c    |   1 +
 .../net/ethernet/microchip/sparx5/sparx5_main.c    | 123 ++++++++++++++++++++-
 .../net/ethernet/microchip/sparx5/sparx5_main.h    |   7 ++
 .../ethernet/microchip/sparx5/sparx5_main_regs.h   |  82 ++++++++++++++
 drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c |  54 +--------
 5 files changed, 217 insertions(+), 50 deletions(-)
---
base-commit: 676f3aace662fbbc180b3898b190a372fa2a516b
change-id: 20261022-lan969x-core-skew-ff5155ead4be

Best regards,
-- 
Daniel Machon <daniel.machon@microchip.com>


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

end of thread, other threads:[~2026-11-16 13:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 10:19 [PATCH net-next 0/4] net: lan969x: skew the core clock by 200 ppm Daniel Machon
2026-11-13 10:19 ` [PATCH net-next 1/4] net: lan969x: add the core PLL registers Daniel Machon
2026-11-13 10:19 ` [PATCH net-next 2/4] net: sparx5/lan969x: enable the switch core after clock setup Daniel Machon
2026-11-13 10:19 ` [PATCH net-next 3/4] net: lan969x: configure the core PLL Daniel Machon
2026-11-16 13:22   ` netdev-bot+sashiko
2026-11-13 10:19 ` [PATCH net-next 4/4] net: sparx5/lan969x: scale the nominal TOD increment in adjfine Daniel Machon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox