Subject: Re: [RFC PATCH v2 0/2] AT8031 PHY timestamping support

From: Richard Cochran <[email-masked]>
Date: Sat, 29 Feb 2020 06:48:18 -0800

On Fri, Feb 28, 2020 at 08:43:05PM +0100, Michael Walle wrote:
> 
> Yeah, I know. And actually I don't think I'll pursue this further. Like I
> said, I just wanted to my current work. Maybe it will be useful in the
> future who knows.

I appreciate your publishing this work.  It is a good starting place.
Maybe the vendor will wake up and help this along.  One can always hope.
 
> Like I said, our FAE is pretty unresponsive. But I'll at least try to find
> out if my guess is correct (that it only works with RGMII). But even then,
> how should the outgoing timestamping work. There are two possibilities:
> 
>  (1) According to the datasheet, the PHY will attach the TX timestamp to
>      the corresponding RX packet; whatever that means. Lets assume there
>      is such a "corresponding packet", then we would be at the mercy of the
>      peer to actually send such a packet, let alone in a timely manner.

I see.  Mysterious.  For a Sync frame, I can't think of any
"corresponding RX packet".

>  (2) Mixing both methods. Use attached timestamps for RX packets, read the
>      timestamp via PHY registers for TX packets. Theoretically, we could
>      control how the packets are send and make sure, we fetch the TX
>      timestamp before sending another PTP packet. But well.. sounds really
>      hacky to me.

It would not be that bad.  Some of the MAC cards can only buffer one
Tx time stamp, and for this reason, the ptp4l program always fetches
the time stamp immediately after sending.

Thanks,
Richard