Skip to contentSkip to conversation

Query for status of timestamping for XCAN driver and possible project

DISCUSSION Pavel Pisa 2 participants 2 messages Oct 20, 2021 CAN network drivers

lore
Share & tools
lore

Pavel Pisa

author
#0 lore raw

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?

Our intention is to implement feature in state ready for mainlining and we hope that with your feedback we succeed this time.

Best wishes,

                Pavel Pisa
    phone:      +420 603531357
    e-mail:     [email protected]
    Department of Control Engineering FEE CVUT
    Karlovo namesti 13, 121 35, Prague 2
    university: http://dce.fel.cvut.cz/
    personal:   http://cmp.felk.cvut.cz/~pisa
    projects:   https://www.openhub.net/accounts/ppisa
    CAN related:http://canbus.pages.fel.cvut.cz/
#1 lore raw
Quoted 17 lines · Pavel Pisa

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.

Quoted 5 lines

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.

Quoted 3 lines

Our intention is to implement feature in state ready for mainlining and we hope that with your feedback we succeed this time.

regards,
Marc

Signature · 4 lines
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 |