mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mario Hüttel" <mario.huettel@gmx.net>
To: Oliver Hartkopp <socketcan@hartkopp.net>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Sekhar Nori <nsekhar@ti.com>,
	Franklin S Cooper Jr <fcooper@ti.com>,
	"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 21:54:54 +0200	[thread overview]
Message-ID: <4b53c9ff-395f-670f-b55c-38ccfb37ac30@gmx.net> (raw)
In-Reply-To: <f651ffd4-826c-ee20-aebf-e3c2c1b89ecf@hartkopp.net>


[-- Attachment #1.1: Type: text/plain, Size: 3128 bytes --]


On 10/19/2017 08:35 PM, Oliver Hartkopp wrote:
> 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().
>
Actually I need some clarification. The sample point of the can core is
between the two time segments.
I always thought that the "sample point" options of the ip tool are used
in the internal
calculation of the two timing segments and is therefore no individual value.

>>>> 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


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

  reply	other threads:[~2017-10-19 19:55 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
2017-10-19 19:54                             ` Mario Hüttel [this message]
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=4b53c9ff-395f-670f-b55c-38ccfb37ac30@gmx.net \
    --to=mario.huettel@gmx.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=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=rogerq@ti.com \
    --cc=socketcan@hartkopp.net \
    --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®