octeontx2-pf: Enable PTP PPS output support
authorHariprasad Kelam <hkelam@marvell.com>
Tue, 12 Sep 2023 17:51:16 +0000 (23:21 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Sep 2023 09:35:07 +0000 (10:35 +0100)
commit35293cb392e6823e35917229c2a9ea01f3176d96
tree5a2030b7f7c2a8fd11be6537e6f2a20a7b9b908a
parente73d5fb75d67538b13fe04d14a55f32ea4efe227
octeontx2-pf: Enable PTP PPS output support

PTP block supports generating PPS output signal on GPIO pin. This patch
adds the support in the PTP PHC driver using standard periodic output
interface.

User can enable/disable/configure PPS by writing to the below sysfs entry

echo perout.index start.sec start.nsec period.sec period.nsec >
/sys/class/ptp/ptp0/period

Example to generate 50% duty cycle PPS signal:
echo 0 0 0 0 500000000 >  /sys/class/ptp/ptp0/period

Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/mbox.h
drivers/net/ethernet/marvell/octeontx2/af/ptp.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c