From: Marc Kleine-Budde <hidden> Date: 2016-02-29 09:38:45
On 02/29/2016 10:21 AM, Ramesh Shanmugasundaram wrote:
Added r8a7795 SoC support.
For smoother bit timing calculation, the rounded clock frequency is used.
Why this? From my point of view this introduces a clock error.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: 2016-02-29 10:00:09
On 02/29/2016 10:56 AM, Ramesh Shanmugasundaram wrote:
quoted
On 02/29/2016 10:21 AM, Ramesh Shanmugasundaram wrote:
quoted
Added r8a7795 SoC support.
For smoother bit timing calculation, the rounded clock frequency is
used.
Why this? From my point of view this introduces a clock error.
Thanks for the comments.
Without the rounded clock, can_calc_bittiming returns different BRP
values and reports high sampling error percentage. However, the
rounded clock shows no such issues and it works fine for all
bitrates.
Below is an e.g. from my board for an input clock differs by 2Hz.
I think it's better to fix the algorithm. I'll look into it.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Can you send me the patches to support the rcar_can. On the linux-can ML
or github pull request.
Thanks,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
But I've to port the algorithm from can-calc-bit-timing to the kernel.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
I think, it should be correct. Can I have the patch please(can-utils or kernel)? I'll give it a go.
Manual e.g. shows, for 1Mbps and 40MHz clock, two settings are possible
10Tq -> BRP 4
20Tq -> BRP 2
Condition is TSEG1 > TSEG2 >= SJW & bitrate = clock freq/(brp * number of Tq)
Your e.g. satisfies the condition and hopefully it should be OK.
Thanks,
Ramesh