mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: "Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Sekhar Nori" <nsekhar@ti.com>,
	"Franklin S Cooper Jr" <fcooper@ti.com>,
	"Mario Hüttel" <mario.huettel@gmx.net>,
	"Yang, Wenyou" <Wenyou.Yang@Microchip.com>,
	wg@grandegger.com, quentin.schulz@free-electrons.com,
	edumazet@google.com, linux-can@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Wenyou Yang <wenyou.yang@atmel.com>,
	Dong Aisheng <b29396@freescale.com>,
	"Quadros, Roger" <rogerq@ti.com>
Subject: Re: [RFC PATCH] can: m_can: Support higher speed CAN-FD bitrates
Date: Thu, 19 Oct 2017 20:35:07 +0200	[thread overview]
Message-ID: <f651ffd4-826c-ee20-aebf-e3c2c1b89ecf@hartkopp.net> (raw)
In-Reply-To: <0099eefa-32c8-a818-761c-667239d9ec3b@pengutronix.de>

Hi Marc,

On 10/19/2017 01:26 PM, Marc Kleine-Budde wrote:
> On 10/19/2017 01:14 PM, Oliver Hartkopp wrote:
>>>>>> Since we have a netlink socket interface to configure sample point, I
>>>>>> wonder if that should be extended to configure SSP too (or at least the
>>>>>> offset part of SSP)?
>>
>> +1 too
> 
> The struct can_bittiming in defined in uapi, so we have to keep ABI
> compatibility in mind.
> 

Oh, this is fortunately NO problem ;-)

struct can_bittiming {
         __u32 bitrate;          /* Bit-rate in bits/second */
         __u32 sample_point;     /* Sample point in one-tenth of a 
percent */
         __u32 tq;               /* Time quanta (TQ) in nanoseconds */
         __u32 prop_seg;         /* Propagation segment in TQs */
         __u32 phase_seg1;       /* Phase buffer segment 1 in TQs */
         __u32 phase_seg2;       /* Phase buffer segment 2 in TQs */
         __u32 sjw;              /* Synchronisation jump width in TQs */
         __u32 brp;              /* Bit-rate prescaler */
};

So we have two of these: One for the arbitration bitrate and one 
sample_point for the data bitrate -> the 'secondary' SP -> SSP

:-)

We already have this 'dsample-point' implemented in the ip tool:

$ ip link set vcan0 type can help
Usage: ip link set DEVICE type can
	[ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
	[ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
  	  phase-seg2 PHASE-SEG2 [ sjw SJW ] ]

	[ dbitrate BITRATE [ dsample-point SAMPLE-POINT] ] |  <<-- here!
	[ dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1
  	  dphase-seg2 PHASE-SEG2 [ dsjw SJW ] ]

But AFAIK m_can is not using that value in m_can_set_bittiming().

>>> If good default values are transceiver and board specific, they can go
>>> into the DT. We need a generic (this means driver agnostic) binding for
>>> this. If this table needs to be tweaked for special purpose, then we can
>>> add a netlink interface for this as well. >
>>> Comments?
>>
>> By now we calculate reasonable default values (e.g. for SP and SJW), you
>> can override by setting alternative values via netlink configuration.
>>
>> I would tend to stay on this approach and not hide these things in DTs -
>> just because of someone wants to initialize his specific interface 'easier'.
> 
> If the values are not board specific, then it makes no sense to put them
> into the DT.

When they are NOT(?) board specific?

Thinking about non-SoC CAN adapters with PCI and USB pushing the SSP to 
the DT looks wrong to me.

Best,
Oliver

  reply	other threads:[~2017-10-19 18:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 19:39 Franklin S Cooper Jr
2017-09-13 21:58 ` Franklin S Cooper Jr
2017-09-14  5:06   ` Sekhar Nori
2017-09-18  3:47     ` Yang, Wenyou
2017-09-20 20:19       ` Franklin S Cooper Jr
2017-09-20 21:37         ` Mario Hüttel
2017-09-21  0:48           ` Franklin S Cooper Jr
2017-10-18 12:44             ` Marc Kleine-Budde
2017-10-18 13:24               ` Sekhar Nori
2017-10-18 14:17                 ` Franklin S Cooper Jr
2017-10-19  5:07                   ` Sekhar Nori
2017-10-19  9:13                     ` Marc Kleine-Budde
2017-10-19 11:09                       ` Sekhar Nori
2017-10-19 11:32                         ` Marc Kleine-Budde
2017-10-19 13:54                           ` Franklin S Cooper Jr
2017-10-19 14:55                             ` Marc Kleine-Budde
2017-10-19 15:40                               ` Franklin S Cooper Jr
2017-10-20 12:14                               ` Sekhar Nori
2017-10-19 11:14                       ` Oliver Hartkopp
2017-10-19 11:26                         ` Marc Kleine-Budde
2017-10-19 18:35                           ` Oliver Hartkopp [this message]
2017-10-19 19:54                             ` Mario Hüttel
2017-10-19 20:17                               ` Oliver Hartkopp
2017-10-19  8:04                 ` Ramesh Shanmugasundaram
2017-10-19  9:21                   ` 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=f651ffd4-826c-ee20-aebf-e3c2c1b89ecf@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=Wenyou.Yang@Microchip.com \
    --cc=b29396@freescale.com \
    --cc=edumazet@google.com \
    --cc=fcooper@ti.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.huettel@gmx.net \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=rogerq@ti.com \
    --cc=wenyou.yang@atmel.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

all inboxes | Powered by JetHome®