From bda32d3a74e7d831efed955aa31aea242f0ddddb Mon Sep 17 00:00:00 2001 From: "Daniel P. Carvalho" Date: Sun, 20 Sep 2026 14:26:34 -0300 Subject: [PATCH] Documentation/ptp: add the existing implementations. The page described how to write a lower-half driver but did not say which ones are in the tree. - List the two lower-half drivers that register a PTP clock, the dummy driver and the Ethernet MAC of the STM32, with the option that enables each. - Say that the clock of the STM32 driver is the PTP counter of the MAC, which is also the time base of the timestamps of the received packets, and not CLOCK_REALTIME. - Say that both use the device number 0 by default and so cannot be registered at the same time. Signed-off-by: Daniel P. Carvalho Assisted-by: Claude:claude-sonnet-5 --- .../components/drivers/special/ptp.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Documentation/components/drivers/special/ptp.rst b/Documentation/components/drivers/special/ptp.rst index 0bacee1f2e4..5e592ef9196 100644 --- a/Documentation/components/drivers/special/ptp.rst +++ b/Documentation/components/drivers/special/ptp.rst @@ -496,6 +496,24 @@ that embeds a ``struct ptp_lowerhalf_s`` and provides the operations of return ptp_clock_register(&priv->base, 500000, 0); } +Existing Implementations +======================== + +The following lower-half drivers are available in the tree: + +- ``drivers/timers/ptp_clock_dummy.c`` - The dummy driver described above, + enabled with ``CONFIG_PTP_CLOCK_DUMMY``. It is registered as ``/dev/ptp0`` + at start-up. +- ``arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c`` - The Ethernet MAC of the + STM32 (the legacy driver), registered with ``CONFIG_PTP_CLOCK`` and + ``CONFIG_STM32_ETH_PTP`` as ``/dev/ptpN``, where N is the number of the + Ethernet interface. The clock is the PTP counter of the MAC. It is also the + time base of the hardware timestamps of the received packets, so those are + not values of ``CLOCK_REALTIME``. + +Both use the device number 0 by default, so they cannot be registered at the +same time. + Integration with PTP Daemon ===========================