All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Y.b. Lu" <yangbo.lu@nxp.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Subject: RE: [PATCH] net: mscc: ocelot: support PPS signal generation
Date: Fri, 27 Dec 2019 03:51:08 +0000	[thread overview]
Message-ID: <AM7PR04MB68858E4814EB85A8860FA48FF82A0@AM7PR04MB6885.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20191227020820.GA6970@localhost>

> -----Original Message-----
> From: Richard Cochran <richardcochran@gmail.com>
> Sent: Friday, December 27, 2019 10:08 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: Vladimir Oltean <olteanv@gmail.com>; netdev <netdev@vger.kernel.org>;
> David S . Miller <davem@davemloft.net>; Claudiu Manoil
> <claudiu.manoil@nxp.com>; Vladimir Oltean <vladimir.oltean@nxp.com>;
> Alexandre Belloni <alexandre.belloni@bootlin.com>; Microchip Linux Driver
> Support <UNGLinuxDriver@microchip.com>
> Subject: Re: [PATCH] net: mscc: ocelot: support PPS signal generation
> 
> On Thu, Dec 26, 2019 at 11:17:26AM +0000, Y.b. Lu wrote:
> > > -----Original Message-----
> > > From: Vladimir Oltean <olteanv@gmail.com>
> > > Also, I think what you have implemented here is periodic output
> > > (PTP_CLK_REQ_PEROUT) not PPS [input] (PTP_CLK_REQ_PPS). I have found
> > > the PTP documentation to be rather confusing on what PTP_CLK_REQ_PPS
> > > means, so I'm adding Richard in the hope that he may clarify (also
> > > what's different between PTP_CLK_REQ_PPS and PTP_CLK_REQ_PPS).
> 
> The PTP_CLK_REQ_PPS is for generating events for the kernel's PPS
> subsystem.  (See drivers/pps).  This has nothing to do with actual PPS
> signals.
> 
> > My understand is PTP_CLK_REQ_PEROUT is for periodical output,
> 
> Yes.
> 
> > and PTP_CLK_REQ_PPS is for PPS event handling.
> 
> No.
> 
> Some cards generate an interrupt at the full second roll over.  The
> interrupt service routine can feed a system time stamp into the
> kernel's pps subsystem for use by NTP.
> 
> If your device is generating an actual PPS output signal, then you
> should implement the PTP_CLK_REQ_PEROUT method.
> 

I'm a little confused.
It seems PTP_CLK_REQ_PEROUT method needs req.perout.start and req.perout.period to generate periodical *clock* signal, while PPS is *pulse* signal every second.
For the two cases (1Hz clock signal and 1 pulse very second), how to configure with PTP_CLK_REQ_PEROUT method?


> Bonus points for making the signal fully programmable!

For some hardware, each pin has fixed function. And some hardware, each pin could be programable for function.
The Ocelot PTP pin is programable, but initially the software author may plan to set fixed function for each pin.
Do you suggest we make all pins function programable?

In include/soc/mscc/ocelot.h,
enum ocelot_clk_pins {
        ALT_PPS_PIN     = 1,
        EXT_CLK_PIN,
        ALT_LDST_PIN,
        TOD_ACC_PIN
};

BTW, current ptp clock code is embedded in ocelot.c.
More and more functions will be added in the future, and the interrupt implementation in SoC is different between Ocelot and VSC9959.
Do you think it's proper to separate common code as a single PTP driver?
Thanks.

> 
> Thanks,
> Richard

  reply	other threads:[~2019-12-27  3:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26  9:58 [PATCH] net: mscc: ocelot: support PPS signal generation Yangbo Lu
2019-12-26 10:49 ` Vladimir Oltean
2019-12-26 10:50   ` Vladimir Oltean
2019-12-26 11:21     ` Y.b. Lu
2019-12-26 11:17   ` Y.b. Lu
2019-12-26 11:44     ` Vladimir Oltean
2019-12-27  2:08     ` Richard Cochran
2019-12-27  3:51       ` Y.b. Lu [this message]
2019-12-27 15:12         ` Richard Cochran
2019-12-26 10:58 ` Andrew Lunn
2019-12-26 11:22   ` Y.b. Lu

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=AM7PR04MB68858E4814EB85A8860FA48FF82A0@AM7PR04MB6885.eurprd04.prod.outlook.com \
    --to=yangbo.lu@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.