net: ti: icssg-prueth: add packet timestamping and ptp support
authorRoger Quadros <rogerq@ti.com>
Thu, 24 Aug 2023 11:46:17 +0000 (17:16 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 27 Aug 2023 06:13:23 +0000 (07:13 +0100)
commit186734c158865747f7160b461afcabfaab8f9bca
tree28dc2b47216609615fbc55b56d8de4bfc676e6ef
parentc1e0230eeaab26984f6e5c5575486e96a63e2e48
net: ti: icssg-prueth: add packet timestamping and ptp support

Add packet timestamping TS and PTP PHC clock support.

For AM65x and AM64x:
 - IEP1 is not used
 - IEP0 is configured in shadow mode with 1ms cycle and shared between
Linux and FW. It provides time and TS in number cycles, so special
conversation in ns is required.
 - IEP0 shared between PRUeth ports.
 - IEP0 supports PPS, periodic output.
 - IEP0 settime() and enabling PPS required FW interraction.
 - RX TS provided with each packet in CPPI5 descriptor.
 - TX TS returned through separate ICSSG hw queues for each port. TX TS
readiness is signaled by INTC IRQ. Only one packet at time can be requested
for TX TS.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Co-developed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/Kconfig
drivers/net/ethernet/ti/icssg/icss_iep.h
drivers/net/ethernet/ti/icssg/icssg_ethtool.c
drivers/net/ethernet/ti/icssg/icssg_prueth.c
drivers/net/ethernet/ti/icssg/icssg_prueth.h