On 20.10.2021 13:17:50, Pavel Pisa wrote: > Hello Oliver and Marc, > > our student, Matej Vasilevski, has chosen to continue > on CAN latency tester which we done for Oliver years > ago. > > We want to continue on the CAN-BENCH project started > by Martin Jerabek > > https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top/-/wikis/home > > https://gitlab.fel.cvut.cz/canbus/zynq/zynq-can-sja1000-top/-/wikis/uploads/56b4d27d8f81ae390fc98bdce803398f/F3-BP-2016-Jerabek-Martin-Jerabek-thesis-2016.pd > > We want to use XCAN on Xilinx Zynq 7010 with timestamping > in the first iteration, then switch to our CTU CAN FD core > and add timestamping to its driver. > > Is there some more recent attempt to add timestamping > to XCAN driver than that original work of Martin Jerabek? > > Is there some suggestion which driver is the right > example to implement timestamping now? I recently added HW timestamp support to the mcp251xfd driver. It makes use of the timecounter + cyclecounter helpers. These take care of wrap arounds and conversion of the timer value to nanoseconds. https://elixir.bootlin.com/linux/v5.14/source/drivers/net/can/spi/mcp251xfd/mcp251xfd-timestamp.c A worker is setup to regularly read the free running time stamp register to deal with the wrap around. You probably don't need this, if you have a 64 bit timestamp register. If your hardware directly provides 64 bit timestamp in ns or µs, you don't even need the timecounter/cyclecounter. To set the HW timestamp on the skb, it's | mcp251xfd_skb_set_timestamp() with timestamp provided by the CAN core that's done on RX and TX-completion. > Our intention is to implement feature in state ready > for mainlining and we hope that with your feedback > we succeed this time. regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: PGP signature