linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
To: "Marc Kleine-Budde" <mkl@pengutronix.de>, Rob Herring <robh@kernel.org>
Cc: Matej Vasilevski <matej.vasilevski@seznam.cz>,
	linux-can@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, ondrej.ille@gmail.com,
	martin.jerabek01@gmail.com
Subject: Re: [RFC PATCH 2/3] dt-bindings: can: ctucanfd: add properties for HW timestamping
Date: Mon, 16 May 2022 21:21:42 +0200	[thread overview]
Message-ID: <202205162121.42800.pisa@cmp.felk.cvut.cz> (raw)
In-Reply-To: <20220516163445.qxz3xlohuquqwbwl@pengutronix.de>

Hello Rob and Marc,

thanks for comment and help.

This patch is marked as RFC and not intended for direct
application. We plan to gather feetback, adjust code
and probably even IP core HDL based on suggestions,
then we plan more testing and when we will be ready and
time allows, new version with plea for merge will provided. 

On Monday 16 of May 2022 18:34:45 Marc Kleine-Budde wrote:
> On 16.05.2022 11:02:50, Rob Herring wrote:
> > On Fri, May 13, 2022 at 01:27:06AM +0200, Matej Vasilevski wrote:
> > > Extend dt-bindings for CTU CAN-FD IP core with necessary properties
> > > to enable HW timestamping for platform devices. Since the timestamping
> > > counter is provided by the system integrator usign those IP cores in
> > > their FPGA design, we need to have the properties specified in device
> > > tree.
> > >
> > > Signed-off-by: Matej Vasilevski <matej.vasilevski@seznam.cz>
> > > ---
> > >  .../bindings/net/can/ctu,ctucanfd.yaml        | 34 +++++++++++++++++--
> > >  1 file changed, 31 insertions(+), 3 deletions(-)
> >
> > What's the base for this patch? Doesn't apply for me.

It is based on the series of complete CTU CAN FD support
which has been accepted into net-next.
The DTC part has gone through your review and has been
ACKed longer time ago. We have spent considerable time
to resolve suggested driver changes - headers files generation
from HDL tool chain, etc.

We inline to version when most of the info will be directly
provided by the core HW except for optional second clocks
probably.

Best wishes,

Pavel

> > > diff --git
> > > a/Documentation/devicetree/bindings/net/can/ctu,ctucanfd.yaml
> > > b/Documentation/devicetree/bindings/net/can/ctu,ctucanfd.yaml index
> > > fb34d971dcb3..c3693dadbcd8 100644
> > > --- a/Documentation/devicetree/bindings/net/can/ctu,ctucanfd.yaml
> > > +++ b/Documentation/devicetree/bindings/net/can/ctu,ctucanfd.yaml
> > > @@ -41,9 +41,35 @@ properties:
> > >
> > >    clocks:
> > >      description: |
> > > -      phandle of reference clock (100 MHz is appropriate
> > > -      for FPGA implementation on Zynq-7000 system).
> > > +      Phandle of reference clock (100 MHz is appropriate for FPGA
> > > +      implementation on Zynq-7000 system). If you wish to use
> > > timestamps +      from the core, add a second phandle with the clock
> > > used for timestamping +      (can be the same as the first clock).
> > > +    maxItems: 2
> >
> > With more than 1, you have to define what each entry is. IOW, use
> > 'items'.
> >
> > > +
> > > +  clock-names:
> > > +    description: |
> > > +      Specify clock names for the "clocks" property. The first clock
> > > name +      doesn't matter, the second has to be "ts_clk". Timestamping
> > > frequency +      is then obtained from the "ts_clk" clock. This takes
> > > precedence over +      the ts-frequency property.
> > > +      You can omit this property if you don't need timestamps.
> > > +    maxItems: 2
> >
> > You must define what the names are as a schema.
> >
> > > +
> > > +  ts-used-bits:
> > > +    description: width of the timestamping counter
> > > +    maxItems: 1
> > > +    items:
> >
> > Not an array, so you don't need maxItems nor items.
> >
> > > +      minimum: 8
> > > +      maximum: 64
> > > +
> > > +  ts-frequency:
> >
> > Use a standard unit suffix.
> >
> > > +    description: |
> > > +      Frequency of the timestamping counter. Set this if you want to
> > > get +      timestamps, but you didn't set the timestamping clock in
> > > clocks property. maxItems: 1
> > > +    items:
> >
> > Not an array.
> >
> >
> > Is timestamping a common feature for CAN or is this specific to this
> > controller? In the latter case, you need vendor prefixes on these
> > properties. In the former case, you need to define them in a common
> > schema.
>
> This property describes the usable with of the free running timer and
> the timestamps generated by it. This is similar to the free running
> timer and time stamps as found on PTP capable Ethernet NICs. But the
> ctucanfd comes in a hardware description language that can be
> parametrized and synthesized into your own FPGA.
>
> To answer your question, timestamping is common in newer CAN cores, but
> the width of the timestamping register is usually fixed and thus hard
> coded in the driver.
>
> regards,
> Marc


  reply	other threads:[~2022-05-16 19:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 23:27 [RFC] can: ctucanfd: RX timestamping implementation Matej Vasilevski
2022-05-12 23:27 ` [RFC PATCH 1/3] can: ctucanfd: add HW timestamps to RX and error CAN frames Matej Vasilevski
2022-05-13 11:41   ` Marc Kleine-Budde
2022-05-13 19:02     ` Pavel Pisa
2022-05-14 19:36       ` Marc Kleine-Budde
2022-05-14  9:18     ` Matej Vasilevski
2022-05-14 20:13       ` Marc Kleine-Budde
2022-05-14 20:31       ` Marc Kleine-Budde
2022-05-12 23:27 ` [RFC PATCH 2/3] dt-bindings: can: ctucanfd: add properties for HW timestamping Matej Vasilevski
2022-05-16 16:02   ` Rob Herring
2022-05-16 16:34     ` Marc Kleine-Budde
2022-05-16 19:21       ` Pavel Pisa [this message]
2022-05-12 23:27 ` [RFC PATCH 3/3] doc: ctucanfd: RX frames timestamping for platform devices Matej Vasilevski

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=202205162121.42800.pisa@cmp.felk.cvut.cz \
    --to=pisa@cmp.felk.cvut.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=martin.jerabek01@gmail.com \
    --cc=matej.vasilevski@seznam.cz \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=ondrej.ille@gmail.com \
    --cc=robh@kernel.org \
    /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).