Subject: Re: [PATCH] net: mscc: ocelot: support PPS signal generation

From: Richard Cochran <[email-masked]>
Date: Thu, 26 Dec 2019 18:08:20 -0800

On Thu, Dec 26, 2019 at 11:17:26AM +0000, Y.b. Lu wrote:
> > -----Original Message-----
> > From: Vladimir Oltean <[email-masked]>
> > 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.

Bonus points for making the signal fully programmable!

Thanks,
Richard