All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Lukasz Majewski <lukma@denx.de>
Cc: netdev@vger.kernel.org,
	Arun Ramadoss <arun.ramadoss@microchip.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	Tristram.Ha@microchip.com,
	Richard Cochran <richardcochran@gmail.com>,
	Christian Eggers <ceggers@arri.de>
Subject: Re: [PTP][KSZ9477][p2p1step] Questions for PTP support on KSZ9477 device
Date: Tue, 17 Jun 2025 17:10:11 +0100	[thread overview]
Message-ID: <b4f057ea-5e48-478d-999b-0b5faebc774c@linux.dev> (raw)
In-Reply-To: <aFD8VDUgRaZ3OZZd@pengutronix.de>

On 17/06/2025 06:25, Oleksij Rempel wrote:
> On Mon, Jun 16, 2025 at 05:25:01PM +0200, Lukasz Majewski wrote:
>> Dear Community,
>>
>> As of [1] KSZ drivers support HW timestamping HWTSTAMP_TX_ONESTEP_P2P.
>> When used with ptp4l (config [2]) I'm able to see that two boards with
>> KSZ9477 can communicate and one of them is a grandmaster device.
>>
>> This is OK (/dev/ptp0 is created and works properly).
>>
>>  From what I have understood - the device which supports p2p1step also
>> supports "older" approaches, so communication with other HW shall be
>> possible.
> 
> This is not fully correct. "One step" and "two step" need different things from
> hardware and driver.
> 
> In "one step" mode, the switch modifies the PTP frame directly and inserts the
> timestamp during sending (start of frame). This works without host help.
> 
> But for "two step" mode, the hardware only timestamps after the frame is sent.
> The host must then read this timestamp. For that, the switch must trigger an
> interrupt to the host. This requires:
> - board to wire the IRQ line from switch to host,
> - and driver to handle that interrupt and read the timestamp (like in
> ksz_ptp_msg_thread_fn()).
> 
> So it's not only about switch HW. It also depends on board design and driver
> support.
> 
>> Hence the questions:
>>
>> 1. Would it be possible to communicate with beaglebone black (BBB)
>> connected to the same network?
> 
> No, this will not work correctly. Both sides must use the same timestamping
> mode: either both "one step" or both "two step".
>   

I'm not quite sure this statement is fully correct. I don't have a
hardware on hands to make this setup, but reading through the code in
linuxptp - the two-step fsm kicks off based on the message type bit. In 
case when linuxptp receives 1-step sync, it does all the calculations.
For delay response packets on GM side it doesn't matter as GM doesn't do
any calculations. I don't see any requirements here from the perspective
of protocol itself.

But again, I don't have HW to make a proof.



  parent reply	other threads:[~2025-06-17 16:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16 15:25 [PTP][KSZ9477][p2p1step] Questions for PTP support on KSZ9477 device Lukasz Majewski
2025-06-17  5:25 ` Oleksij Rempel
2025-06-17  9:53   ` Lukasz Majewski
2025-06-17 16:10   ` Vadim Fedorenko [this message]
2025-06-18  5:07     ` Richard Cochran
2025-06-18  6:27       ` Oleksij Rempel
2025-06-26 21:33         ` Lukasz Majewski
2025-06-27 21:58           ` Vladimir Oltean
2025-06-29  9:28             ` Lukasz Majewski
2025-06-30  4:36               ` Oleksij Rempel

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=b4f057ea-5e48-478d-999b-0b5faebc774c@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=Tristram.Ha@microchip.com \
    --cc=arun.ramadoss@microchip.com \
    --cc=ceggers@arri.de \
    --cc=lukma@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=richardcochran@gmail.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.