Documentation/ptp: add the existing implementations. - #20208
Merged
xiaoxiang781216 merged 1 commit intoSep 21, 2026
Merged
xiaoxiang781216 merged 1 commit into
xiaoxiang781216 merged 1 commit into
Conversation
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 <danieloak@gmail.com> Assisted-by: Claude:claude-sonnet-5
acassis
approved these changes
Sep 20, 2026
xiaoxiang781216
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PTP clock driver page (
Documentation/components/drivers/special/ptp.rst) explains how to write a lower-half driver, but it does not say which ones exist in the tree, and the driver of a real Ethernet MAC was added in #20180. This PR adds an "Existing Implementations" section, in the way that other driver pages do (for example the RPTUN driver porting page). It changes documentation only.The section lists the two lower-half drivers that call
ptp_clock_register()inmaster:drivers/timers/ptp_clock_dummy.c, the dummy driver described in the same page, enabled withCONFIG_PTP_CLOCK_DUMMYand registered as/dev/ptp0at start-up.arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c, the Ethernet MAC of the STM32 (the legacy driver), enabled withCONFIG_PTP_CLOCKandCONFIG_STM32_ETH_PTPand registered as/dev/ptpN, where N is the number of the Ethernet interface. It says that the clock is the PTP counter of the MAC, which is also the time base of the hardware timestamps of the received packets, so those are not values ofCLOCK_REALTIME.It also says that both use the device number 0 by default, so they cannot be registered at the same time. That comes from the code: the dummy driver is initialized with device number 0 in
drivers_initialize()and the STM32 driver registers with the number of the interface.Impact
Documentation only, no code change. Only the page
components/drivers/special/ptpchanges.Testing
Built the documentation with Sphinx 6.2.1 and the packages of
Documentation/Pipfile, without-W: the build succeeds, the new section renders and none of the 19 warnings (duplicate C declarations in other pages) is from this file../tools/checkpatch.shpasses.The statements were checked by reading the code: the only two drivers that register a PTP clock were found with a search for
ptp_clock_register()andptp_clock_dummy_initialize()inmaster.