All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: davem@davemloft.net, f.fainelli@gmail.com,
	vivien.didelot@gmail.com, andrew@lunn.ch,
	christian.herber@nxp.com, yangbo.lu@nxp.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next 4/4] net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT
Date: Mon, 23 Mar 2020 16:26:48 -0700	[thread overview]
Message-ID: <20200323232648.GC9140@localhost> (raw)
In-Reply-To: <20200323225924.14347-5-olteanv@gmail.com>

On Tue, Mar 24, 2020 at 12:59:24AM +0200, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> The SJA1105 switch family has a PTP_CLK pin which emits a signal with
> fixed 50% duty cycle, but variable frequency and programmable start time.
> 
> On the second generation (P/Q/R/S) switches, this pin supports even more
> functionality. The use case described by the hardware documents talks
> about synchronization via oneshot pulses: given 2 sja1105 switches,
> arbitrarily designated as a master and a slave, the master emits a
> single pulse on PTP_CLK, while the slave is configured to timestamp this
> pulse received on its PTP_CLK pin (which must obviously be configured as
> input). The difference between the timestamps then exactly becomes the
> slave offset to the master.
> 
> The only trouble with the above is that the hardware is very much tied
> into this use case only, and not very generic beyond that:
>  - When emitting a oneshot pulse, instead of being told when to emit it,
>    the switch just does it "now" and tells you later what time it was,
>    via the PTPSYNCTS register. [ Incidentally, this is the same register
>    that the slave uses to collect the ext_ts timestamp from, too. ]
>  - On the sync slave, there is no interrupt mechanism on reception of a
>    new extts, and no FIFO to buffer them, because in the foreseen use
>    case, software is in control of both the master and the slave pins,
>    so it "knows" when there's something to collect.
> 
> These 2 problems mean that:
>  - We don't support (at least yet) the quirky oneshot mode exposed by
>    the hardware, just normal periodic output.
>  - We abuse the hardware a little bit when we expose generic extts.
>    Because there's no interrupt mechanism, we need to poll at double the
>    frequency we expect to receive a pulse. Currently that means a
>    non-configurable "twice a second".
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Acked-by: Richard Cochran <richardcochran@gmail.com>

  reply	other threads:[~2020-03-23 23:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 22:59 [PATCH net-next 0/4] PTP_CLK pin configuration for SJA1105 DSA driver Vladimir Oltean
2020-03-23 22:59 ` [PATCH net-next 1/4] net: dsa: sja1105: unconditionally set DESTMETA and SRCMETA in AVB table Vladimir Oltean
2020-03-23 22:59 ` [PATCH net-next 2/4] net: dsa: sja1105: make future_base_time a common helper Vladimir Oltean
2020-03-23 22:59 ` [PATCH net-next 3/4] net: dsa: sja1105: make the AVB table dynamically reconfigurable Vladimir Oltean
2020-03-23 22:59 ` [PATCH net-next 4/4] net: dsa: sja1105: configure the PTP_CLK pin as EXT_TS or PER_OUT Vladimir Oltean
2020-03-23 23:26   ` Richard Cochran [this message]
2020-03-24  5:15 ` [PATCH net-next 0/4] PTP_CLK pin configuration for SJA1105 DSA driver David Miller

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=20200323232648.GC9140@localhost \
    --to=richardcochran@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=christian.herber@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=yangbo.lu@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.