jclark
October 21, 2026, 5:24pm
1
It turns out that BeagleY-AI has a very unusual capability related to precision timing. With a suitable overlay it is able to hardware timestamp a PPS signal. This allows for nanosecond-level accuracy, several orders of magnitude better than what you get with normal kernel timestamping of a PPS on a GPIO. It is also the essential hardware capability needed to create a PTP grandmaster. Up to now the only inexpensive platforms that supported this were the Raspberry Pi CM4 and CM5.
There are some more details and the necessary overlay in this PR:
v6.18.x ← jclark:beagley-ai-cpts-hw1tspush
opened 02:01AM - 20 Oct 26 UTC
This adds an overlay that turns HAT pin 33 (GPIO13) on the BeagleY-AI into a har… dware timestamp input for the Ethernet controller's PTP clock. With a GPS receiver's PPS output on that pin, the BeagleY-AI becomes a GPS-disciplined PTP grandmaster accurate to tens of nanoseconds, something very few inexpensive boards can do.
The Precision Time Protocol (PTP, IEEE 1588) synchronizes clocks over Ethernet. An Ethernet controller that supports PTP has its own clock, the PTP hardware clock (PHC), and timestamps packets against it in hardware. To *serve* accurate time, the PHC itself has to be locked to a reference, normally a GPS receiver's 1PPS output. That only works well if the controller has an input pin whose edges are also timestamped in hardware against the PHC. Linux exposes this as an *external timestamp* (extts) channel of the PHC (`PTP_EXTTS_REQUEST`).
Many Ethernet controllers have a PHC, but very few have such an input, and fewer still are on an inexpensive board. Until now, the only low-cost boards with one were the Raspberry Pi Compute Modules, the CM4 and CM5, where the input is on the Ethernet PHY. The AM67A's CPSW has it in the MAC's own timestamping unit (the CPTS `HW1_TS_PUSH` input), and the BeagleY-AI can bring it out to the 40-pin header. What was missing is the pin mux and the routing, which this overlay supplies. With it, the BeagleY-AI joins the CM4 and CM5 as the third such board.
For background, see https://satpulse.net/intro/timing.html#ptp-hardware-clocks on PHCs and PPS inputs, and https://satpulse.net/hardware/#hardware-for-timing-applications on how little low-cost hardware has them. SatPulse is my open-source GPS-to-PTP/NTP daemon. Support for PHCs like the CPTS, which have timestamp channels but no dedicated PHC pins, is in https://github.com/jclark/satpulse/pull/506.
This overlay:
- Muxes pad E19 (GPIO13, HAT pin 33) to `CP_GEMAC_CPTS0_HW1TSPUSH` (mode 1) and attaches it to `cpsw3g`. The PWM overlay `k3-am67a-beagley-ai-pwm-epwm1-gpio13` uses the same pad, so the two can't be loaded together.
- Sets up the Time Sync Router (`TIMESYNC_EVENT_INTROUTER0`, 0xA40000). The pad does not reach the CPTS directly: it is input 12 of the router, whose output 10 feeds the CPSW CPTS. The router resets with every output disabled, and mainline has no node or driver for it (TI's vendor kernels use `reg-mux` with a vendor-only `mux-reg-masks-state` property). So the overlay models the router as a `pinctrl-single` that sets just that one route.
- Gives the router a `reg` of 1 KiB, per the TRM memory map. The 0x800 used in TI's AM62x node makes pinctrl-single read past the block, and reading its debugfs files then oopses the kernel.
Tested on a BeagleY-AI running the BeagleBoard.org Debian Trixie IoT image (2026-10-09, kernel 7.2.9-arm64-k3-r19), with the PPS of a low-cost GPS receiver (ZhongKe ATGM332D-5N) on pin 33:
- Every second, the PPS appears on extts channel 0 of the CPTS PHC (`/dev/ptp0`). SatPulse disciplines the PHC from it, and the PPS timestamps have an RMS offset of 11-16 ns from the second.
- The BeagleY-AI then served as PTP grandmaster (ptp4l, server only) through a PTP-aware switch to a client with an Intel I226 (ptp4l, client only). The client measured a path delay of 0 ± 2 ns and an RMS master offset of 11 ns.
- As an independent check, the client has its own GPS receiver (u-blox ZED-F9T), whose PPS goes to the I226's SDP0 and is timestamped against the I226 PHC that the BeagleY-AI was steering. Over 5 minutes, the client's PPS had a mean offset of -0.4 ns from the second and an RMS of 14.6 ns, all within -35 to +42 ns. So the time served by the BeagleY-AI agreed with a separate GPS receiver to within a few tens of nanoseconds.
As with most PTP-capable SBCs, the latency between the wire and the timestamp point has to be calibrated. Initial tests show an ingress latency of about 385 ns and an egress latency of about 8 ns, which are the values used for the test (ptp4l `ingressLatency` and `egressLatency`).
FYI: current kernels' CPTS driver rejects every `PTP_EXTTS_REQUEST2` with `EOPNOTSUPP`, so only the older `PTP_EXTTS_REQUEST` ioctl works. The overlay doesn't depend on this, but I've submitted a patch to netdev: https://lore.kernel.org/all/20261020003525.1237742-1-jjc@jclark.com/
The necessary support in my satpulse software has now been merged.
James
@jclark sorry i was traveling this week, so away from my builders, i’ve merged it as is. But can you please add your copyright notice:
src/arm64/overlays/k3-am67a-beagley-ai-cpts-hw1tspush-gpio13.dtso: no copyright notice
* Copyright (C) Name/etc
jclark
November 2, 2026, 12:29pm
3
I have also got PPS output working.
I blogged about it here: BeagleY-AI as a PTP grandmaster - SatPulse
BeagleY-AI is clearly the best available SBC for precision network timing at the moment.
awesome work @jclark (and i forgot to merge your timing patch last night) i’ll work on that this week while on the road..