Re: [PATCH v2 net-next 02/14] dt-bindings: net: add nxp,netc-timer property

From: Krzysztof Kozlowski
Date: Mon Jul 21 2025 - 08:24:04 EST


On 18/07/2025 14:01, Vladimir Oltean wrote:
>> Maybe there is another property describing a time provider in the
>> kernel or dtschema. Please look for it. This all looks like you are
>> implementing typical use case in non-typical, but vendor-like, way.
>>
>> Best regards,
>> Krzysztof
>
> An MII timestamper and a PTP clock (as integrated in a MAC or a PHY) are
> similar but have some notable differences.
>
> A timestamper is an external device with a free-running counter, which
> sniffs the MII bus between the MAC and the PHY, and provides timestamps
> when the first octet of a packet hits the wire.
>
> A PTP clock is also a high precision counter, which can be free-running
> or it can be precisely adjusted. It does not have packet timestamping
> capabilities itself, instead the Ethernet MAC can snapshot this counter
> when it places the first octet of a packet on the MII bus. PTP clocks
> frequently have other auxiliary functions, like emitting external
> signals based on the internal time, or snapshotting external signals.
>
> The timestamper is not required to have these functions. In fact, I am
> looking at ptp_ines.c, the only non-PHY MII timestamper supported by the
> kernel, and I am noting the fact that it does not call ptp_clock_register()
> at all, presumably because it has no controllable PTP clock to speak of.
>
> That being said, my understanding is based on analyzing the public code
> available to me, and I do not have practical experience with MII bus
> snooping devices, so if Richard could chime in, it would be great.
>
> I am also in favor of using the "ptp-timer" phandle to describe the link


And it is already used in other binding, so yes, that's the candidate.

> between the MAC and the internal PTP clock that will be snapshot when
> taking packet timestamps. The fman-dtsec.yaml schema also uses it for an
> identical purpose.


Best regards,
Krzysztof