linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
	wg@grandegger.com
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH] can-calc-bit-timing: add support for rcar_can
Date: Mon, 29 Feb 2016 11:29:19 +0100	[thread overview]
Message-ID: <56D41D7F.2020705@pengutronix.de> (raw)
In-Reply-To: <1456741125-50017-1-git-send-email-ramesh.shanmugasundaram@bp.renesas.com>

[-- Attachment #1: Type: text/plain, Size: 2283 bytes --]

On 02/29/2016 11:18 AM, Ramesh Shanmugasundaram wrote:
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> Hi Mark,
> 
>    This patch is generated on top of can-utils master
> 
>    commit:
>    cda6117 can: avoid using timeval for uapi
> 
>    in response to https://www.mail-archive.com/netdev@vger.kernel.org/msg99549.html
> 
>  can-calc-bit-timing.c | 35 +++++++++++++++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
> 
> diff --git a/can-calc-bit-timing.c b/can-calc-bit-timing.c
> index 9031a78..b6236f0 100644
> --- a/can-calc-bit-timing.c
> +++ b/can-calc-bit-timing.c
> @@ -219,6 +219,26 @@ static void printf_btr_ti_hecc(struct can_bittiming *bt, int hdr)
>  	}
>  }
>  
> +static void printf_btr_rcar_can(struct can_bittiming *bt, int hdr)
> +{
> +	if (hdr) {
> +		printf("%10s", "CiBCR");
> +	} else {
> +		uint32_t bcr;
> +#define RCAR_CAN_BCR_TSEG1(x)   (((x) & 0x0f) << 20)
> +#define RCAR_CAN_BCR_BPR(x)     (((x) & 0x3ff) << 8)
> +#define RCAR_CAN_BCR_SJW(x)     (((x) & 0x3) << 4)
> +#define RCAR_CAN_BCR_TSEG2(x)   ((x) & 0x07)
> +
> +		bcr = RCAR_CAN_BCR_TSEG1(bt->phase_seg1 + bt->prop_seg - 1) |
> +			RCAR_CAN_BCR_BPR(bt->brp - 1) |
> +			RCAR_CAN_BCR_SJW(bt->sjw - 1) |
> +			RCAR_CAN_BCR_TSEG2(bt->phase_seg2 - 1);
> +
> +		printf("0x%08x", bcr<<8);
> +	}
> +}
> +
>  static struct can_bittiming_const can_calc_consts[] = {
>  	{
>  		.name = "sja1000",
> @@ -472,6 +492,21 @@ static struct can_bittiming_const can_calc_consts[] = {
>  
>  		.ref_clk = 13000000,
>  		.printf_btr = printf_btr_ti_hecc,
> +	},
> +	{
> +		.name = "rcar_can",
> +		.tseg1_min = 4,
> +		.tseg1_max = 16,
> +		.tseg2_min = 2,
> +		.tseg2_max = 8,
> +		.sjw_max = 4,
> +		.brp_min = 1,
> +		.brp_max = 1024,
> +		.brp_inc = 1,
> +
> +		.ref_clk = 65000000,
> +		.printf_btr = printf_btr_rcar_can,
> +	},
>  	}
       ^^^

This doesn't look right, fixed while applying.

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   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2016-02-29 10:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 10:18 [PATCH] can-calc-bit-timing: add support for rcar_can Ramesh Shanmugasundaram
2016-02-29 10:29 ` Marc Kleine-Budde [this message]
2016-02-29 10:41   ` [PATCH v2] " Ramesh Shanmugasundaram
2016-02-29 10:50     ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D41D7F.2020705@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).