All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/3] net: dsa: mv88e6xxx: fix MV88E6393X PHC frequency on internal clock
@ 2024-09-29 10:19 Shenghao Yang
  2024-09-29 10:19 ` [PATCH net 1/3] net: dsa: mv88e6xxx: group cycle counter coefficients Shenghao Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Shenghao Yang @ 2024-09-29 10:19 UTC (permalink / raw)
  To: netdev
  Cc: Shenghao Yang, f.fainelli, olteanv, pavana.sharma, ashkan.boldaji,
	kabel, andrew

The MV88E6393X family of switches can additionally run their cycle
counters using a 250MHz internal clock instead of the usual 125MHz
externa clock [1].

The driver currently assumes all designs utilize that external clock,
but MikroTik's RB5009 uses the internal source - causing the PHC to be
seen running at 2x real time in userspace, making synchronization
with ptp4l impossible.

This series adds support for reading off the cycle counter frequency
known to the hardware in the TAI_CLOCK_PERIOD register and picking an
appropriate set of scaling coefficients instead of using a fixed set
for each switch family.

Patch 1 groups those cycle counter coefficients into a new structure to
make it easier to pass those around.

Patch 2 modifies PTP initialization to probe TAI_CLOCK_PERIOD and
use an appropriate set of coefficients.

Patch 3 adds support for 4000ps cycle counter periods.

Thanks,

Shenghao

[1] https://lore.kernel.org/netdev/d6622575-bf1b-445a-b08f-2739e3642aae@lunn.ch/

Shenghao Yang (3):
  net: dsa: mv88e6xxx: group cycle counter coefficients
  net: dsa: mv88e6xxx: read cycle counter period from hardware
  net: dsa: mv88e6xxx: support 4000ps cycle counter periods

 drivers/net/dsa/mv88e6xxx/chip.h |   7 +--
 drivers/net/dsa/mv88e6xxx/ptp.c  | 105 +++++++++++++++++++++----------
 2 files changed, 75 insertions(+), 37 deletions(-)

-- 
2.46.1

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

end of thread, other threads:[~2024-10-05 11:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-29 10:19 [PATCH net 0/3] net: dsa: mv88e6xxx: fix MV88E6393X PHC frequency on internal clock Shenghao Yang
2024-09-29 10:19 ` [PATCH net 1/3] net: dsa: mv88e6xxx: group cycle counter coefficients Shenghao Yang
2024-09-30 15:14   ` Andrew Lunn
2024-09-29 10:19 ` [PATCH net 2/3] net: dsa: mv88e6xxx: read cycle counter period from hardware Shenghao Yang
2024-09-30 15:31   ` Andrew Lunn
2024-10-05 11:17     ` Shenghao Yang
2024-10-01  4:17   ` kernel test robot
2024-09-29 10:19 ` [PATCH net 3/3] net: dsa: mv88e6xxx: support 4000ps cycle counter period Shenghao Yang
2024-10-01  7:32   ` kernel test robot
2024-09-30 14:51 ` [PATCH net 0/3] net: dsa: mv88e6xxx: fix MV88E6393X PHC frequency on internal clock Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.