Skip to content

ptp: initial support for IEEE 1588/802.1AS PTP/gPTP#1472

Draft
troglobit wants to merge 7 commits intomainfrom
gptp
Draft

ptp: initial support for IEEE 1588/802.1AS PTP/gPTP#1472
troglobit wants to merge 7 commits intomainfrom
gptp

Conversation

@troglobit
Copy link
Copy Markdown
Contributor

Summary

  • Full IEEE 1588-2019 / 802.1AS PTP stack wired into confd via the ieee1588-ptp-tt YANG model with Infix augments (infix-ptp) for profile selection and per-port configuration
  • Supports Ordinary Clock, Boundary Clock, and E2E/P2P Transparent Clock instance types; 802.1AS/gPTP profile via infix-ptp:profile
  • Hardware timestamping auto-detected; software fallback on mixed ports
  • show ptp CLI command with port states, offset, and grandmaster identity
  • Inclusive IEEE 1588g-2022 terminology throughout (time transmitter, time receiver, BTCA)

Tests

Five regression tests under test/case/ptp/:

  • basic — smoke test: OC back-to-back, SW timestamps, QEMU-compatible
  • bmca — BTCA election and runtime re-election via priority1
  • boundary_clock — two-port BC, verifies steps-removed=2
  • transparent_clock — E2E-TC and P2P-TC (HW timestamps, ptp-hwts nodes)
  • port_recovery — link-down/link-up fault recovery

Convergence threshold auto-selected from the ptp-hwts topology capability (1 µs HW / 100 µs SW).

Test plan

  • basic, bmca, boundary_clock, port_recovery pass on QEMU testbed
  • transparent_clock (E2E + P2P) pass on monza/styx or monza/alder HW rig

Remaining work

  • phc2sys YANG model (infix-phc2sys.yang, instance-index + servo params)
  • ts2phc YANG model (GPS/PPS → PHC → ptp4l GM path)
  • timemaster coordination (Phase 3, after phc2sys YANG is stable)
  • show ptp network (YANG action or background-polled topology container)
  • CMLDS (requires upstream linuxptp + 802.1ASdm foundation)
  • Full 12-bit sdoId, fault log, performance monitoring

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Add a board README to explain how to get Infix running
- Update mkimage.sh to allow creating images without boot loader

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
NOTE: this is intended only for use on devboards like EspressoBin where
      the onboard bootloader only understands fat and ext2 file systems.
      To enable, use 'make apply-ext4'

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This is used by the next commit that adds initial support for PTP/gPTP.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Remaining work:
- phc2sys YANG model (infix-phc2sys.yang, instance-index + servo params)
- ts2phc YANG model (GPS/PPS → PHC → ptp4l GM path)
- timemaster coordination (Phase 3, after phc2sys YANG is stable)
- show ptp network (YANG action or background-polled topology container)
- CMLDS (requires upstream linuxptp + 802.1ASdm foundation)
- Full 12-bit sdoId, fault log, performance monitoring

Backported patches from linuxptp master:
- port: fix unicast negotiation recovery after FAULT_DETECTED
- udp: fix port-specific ptp/p2p_dst_ipv4 configuration
- pmc: avoid race conditions in agent update
- phc2sys: wait until pmc agent is subscribed (startup race)
- fix MAC driver incorrect SIOCGHWTSTAMP adjustment flags
- pmc_agent: longer update interval when not subscribed
- phc2sys: don't disable pmc agent with -s/-d/-w options
- port_signaling: respect ptp_minor_version in message header
- port: refresh link status on faults
- uds: copy server socket ownership in pmc clients (non-root pmc)
- uds: don't call chmod() on client socket
- port: allow mixing wildcard and exact clock identities
- Add pidfile support to ptp4l, phc2sys, and timemaster

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant