]> git.baikalelectronics.ru Git - kernel.git/commit
can: mcp251xfd: add HW timestamp infrastructure
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 2 Mar 2021 14:58:18 +0000 (15:58 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 30 Mar 2021 09:14:50 +0000 (11:14 +0200)
commit92226532ee2334cbfef87bd98291e942f468bbfa
tree6ef8f9f08f4c3042b2c29179ecea7c37f1c7149b
parent173099d1b3ce0bd79594fe9cb4ae145c567ac760
can: mcp251xfd: add HW timestamp infrastructure

This patch add the HW timestamping infrastructure. The mcp251xfd has a
free running timer of 32 bit width, running at max 40MHz, which wraps
around every 107 seconds. The current timestamp is latched into RX and
TEF objects automatically be the CAN controller.

This patch sets up a cyclecounter, timecounter and delayed worker
infrastructure (which runs every 45 seconds) to convert the timer into
a proper 64 bit based ns timestamp.

Link: https://lore.kernel.org/r/20210304160328.2752293-6-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/Makefile
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-timestamp.c [new file with mode: 0644]
drivers/net/can/spi/mcp251xfd/mcp251xfd.h