Commit Graph

66 Commits (6e7f845a6886d69e14b6fb3796673dd1efd217e0)

Author SHA1 Message Date
Ramesh Shanmugasundaram c689803204 can-calc-bit-timing: add support for rcar_can
Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2016-02-29 11:27:05 +01:00
Marc Kleine-Budde 58716c1c29 can-calc-bit-timing: add some more timings for mscan and flexcan
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-30 21:04:13 +02:00
Wolfgang Grandegger 67a2bdcd33 can-calc-bit-timing: add a proper GNU license agreement
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2014-02-27 22:08:04 +01:00
Brennan Ashton 31936b5a17 can-calc-bit-timing: fix MCP251x bit rate calculation
This patch adds the missing -1 to "bt->brp", as correctly used in the kernel
driver.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2014-01-06 10:35:45 +01:00
Uwe Kleine-König 03c1bacfde can-utils: trivial: fix typos concerning "separation" and "useful"
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2013-08-15 21:09:27 +02:00
Marc Kleine-Budde ddef031408 can-calc-bit-timing: add support for ti_hecc
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-11-26 21:57:57 +01:00
Marc Kleine-Budde 423f018b30 can-calc-bit-timing: add 66.66 MHz mscan refclock
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-11-26 21:57:54 +01:00
Marc Kleine-Budde 3c89d3ab55 can-calc-bit-timing: add 24 and 66 MHz flexcan ref clock
as found on some imx boards.

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-11-26 21:57:52 +01:00
Oliver Hartkopp 589fa16c27 removed unused variable warnings by removing the variables
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2012-11-14 20:43:55 +01:00
Marc Kleine-Budde f5576a9833 can-calc-bit-timing: remove rtcantl1
No one can verify the timing parameters to be correct.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 14:10:38 +00:00
Marc Kleine-Budde 5c74d8d806 can-calc-bit-timing: add more can controller definitions and ref clocks
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 13:43:20 +00:00
Marc Kleine-Budde b9f9cd0c62 can-calc-bit-timing: calculate bit timings for all known controllers by default
When testing or improving the bit timing algorithm, you're probably
interested in the values of all can controllers. Further you might not
know the all reference clocks of the controllers.

This patch add a "ref_clock" member to the "struct can_bittiming_const"
that holds the reference clock of the controller in Hz.

By default now the bit timing is calculated for all known can
controllers with the default ref_clock defined in "can_bittiming_const".

It's still possible to overwrite the ref clock with the command line
option "-c".

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 13:43:16 +00:00
Marc Kleine-Budde 26488b16e6 can-calc-bit-timing: improve printing of bit timing parameters
This patch adds additional fields when printing the bit timing
parameters. Now the real bitrate the nominal and the real sample point
as well as the error of the sample point is displayed.

The output now looks like this:

Bit timing parameters for at91 with 100.000000 MHz ref clock
nominal                                 real Bitrt   nom  real SampP
Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error     CAN_BR
1000000     50   7    7    5   1   5 1000000  0.0% 75.0% 75.0%  0.0% 0x00040664
 800000     50   8    8    8   1   5  800000  0.0% 80.0% 68.0% 15.0% 0x00040777
 500000    100   8    8    3   1  10  500000  0.0% 87.5% 85.0%  2.9% 0x00090772
 250000    250   6    7    2   1  25  250000  0.0% 87.5% 87.5%  0.0% 0x00180561
 125000    500   6    7    2   1  50  125000  0.0% 87.5% 87.5%  0.0% 0x00310561
 100000    500   8    8    3   1  50  100000  0.0% 87.5% 85.0%  2.9% 0x00310772
  50000   1250   6    7    2   1 125   50000  0.0% 87.5% 87.5%  0.0% 0x007c0561
  20000 ***bitrate not possible***
  10000 ***bitrate not possible***

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 13:43:12 +00:00
Marc Kleine-Budde ccd199739e can-calc-bit-timing: use algorithm from the kernel
This patch copies the algorithm functions (can_update_spt and
can_calc_bittiming) from the kernel. Then some glue code is added that
these functions compile in userspace.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 13:43:08 +00:00
Marc Kleine-Budde daed6be029 can-calc-bit-timing: fix indention
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 13:43:04 +00:00
Marc Kleine-Budde fa9c05021c add can-calc-bit-timing
Add the tool as sent by Wolfgang via email
(<4BE152D2.6060306@grandegger.com>).

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-07-20 13:42:57 +00:00