net: mvpp2: ptp: add support for receive timestamping
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 9 Sep 2020 16:25:55 +0000 (17:25 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Sep 2020 21:22:42 +0000 (14:22 -0700)
commitce3497e2072e2c6120cea80cb49a5fee9d1245d3
tree01539643a690023d3c2baf8675e08e4eb9af72fb
parent91dd71950bd714163e338fe6b8b60be5b76e8e2a
net: mvpp2: ptp: add support for receive timestamping

Add support for receive timestamping. When enabled, the hardware adds
a timestamp into the receive queue descriptor for all received packets
with no filtering. Hence, we can only support NONE or ALL receive
filter modes.

The timestamp in the receive queue contains two bit sof seconds and
the full nanosecond timestamp. This has to be merged with the remainder
of the seconds from the TAI clock to arrive at a full timestamp before
we can convert it to a ktime for the skb hardware timestamp field.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2.h
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_tai.c