net: dsa: microchip: ptp: add periodic output signal
authorChristian Eggers <ceggers@arri.de>
Tue, 10 Jan 2023 08:49:27 +0000 (14:19 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Jan 2023 08:40:41 +0000 (08:40 +0000)
commit1f12ae5b67608f63596642774129abfafa95e9d8
tree6ef3de03ae38cf456c4336994737c3a9f3b014fa
parenta32190b154bde4a3bf2fddb9367aec49be09b15d
net: dsa: microchip: ptp: add periodic output signal

LAN937x and KSZ PTP supported switches has Three Trigger output unit.
This TOU can used to generate the periodic signal for PTP. TOU has the
cycle width register of 32 bit in size and period width register of 24
bit, each value is of 8ns so the pulse width can be maximum 125ms.

Tested using ./testptp -d /dev/ptp0 -p 1000000000 -w 100000000 for
generating the 10ms pulse width

Signed-off-by: Christian Eggers <ceggers@arri.de>
Co-developed-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz_common.h
drivers/net/dsa/microchip/ksz_ptp.c
drivers/net/dsa/microchip/ksz_ptp.h
drivers/net/dsa/microchip/ksz_ptp_reg.h