Thread (11 messages) 11 messages, 2 authors, 2021-02-26

Re: can, tcan4x5x: look to merge rpi support into rpi kernel tree

From: Torin Cooper-Bennun <hidden>
Date: 2021-02-26 16:15:36

Possibly related (same subject, not in this thread)

On Fri, Feb 26, 2021 at 05:01:35PM +0100, Marc Kleine-Budde wrote:
quoted
Is timestamp-wrapping a concern for rx-offloading?
No, as long as you provide a proper u32 timestamp, which means wrap
around at 0xffffffff to 0x0. As the tcan4x5x has only a 16 bit
timestamp, shift it to full 32 bit, like this:

https://elixir.bootlin.com/linux/v5.11/source/drivers/net/can/flexcan.c#L805

On the mcp with true 32 bit timestamp there's a wraparound every 107
seconds at 40 MHz external clock (0xffffffff / 40000000).

The tcan has the TSS.TCP as a prescaler and increments in bit time,
which is 5MHz max. This results in a wrap around every 13ms (0xffff /
5000000) with a prescaler of 1. With a prescaler of 16, you can increase
this to 209ms (0xffff / 5000000 * 16), which gives an accuracy of 2
bytes.
Nice, thank you, that all sounds good. I'll get to work. :)

--
Regards,

Torin Cooper-Bennun
Software Engineer | maxiluxsystems.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help