Repository navigation
Conversation
|
This is very TL;DR - why don't you start with brief, human-written description of the problem you are trying to solve, followed by a list of the elements involved in the solution. It's also not a good idea to let your AI randomly "improve" things, except in separate commits that are clearly described. BTW, "BCM" has no part to play in the discussion of GPIOs in the kernel - everything uses GPIO numbers, never (header) pin numbers. |
| * Do not add an input-direction monitor SM on this same GPIO: its direction | ||
| * request removes the pad output enable on RP1. | ||
| */ | ||
| static const u16 rp1_compact_output_program[RP1_OUTPUT_PROGRAM_WORDS] = { |
There was a problem hiding this comment.
Why would you not include the full output from pioasm, with the assembly language as comments?
|
Did you test this on HW? Ideally test the performance against pps-gpio |
|
@nbuchwitz Yes: two Pi 5s, Saleae Logic Pro 16, 250 MS/s. A 10-minute capture (600 pulses/channel) measured maximum corresponding-pin skew of 68 ns (GPIO18) and 64 ns (GPIO23), with no missing pulses. A retarget alarm occurred after capture. These bench results still need reproduction on the exact PR revision and comparison with
|
Thanks, I will tighten the description and GPIO terminology. |
|
A description of the problem and the architecture of the solution will provide a framework for an analysis of the submission. |
Understood. The problem is connecting PPS on Pi 5 GPIOs to the Ethernet PTP hardware clock, allowing external PPS timestamping and clock-aligned PPS output.
|

Raspberry Pi 5's RP1 owns GPIO and PIO resources, while its Ethernet MAC
provides a PTP hardware clock (PHC). Linux currently does not expose those
GPIOs through that PHC's standard PTP pin interface, so it cannot timestamp a
reference PPS on a selected GPIO or generate a PHC-aligned PPS output on one.
This series connects the MACB PHC to RP1 PIO, DMA and pin control. Linux PTP
clients such as
testptpcan map an available GPIO to an external timestampinput or periodic output. This provides a route for hardware timestamping a
reference PPS in the Ethernet PHC and for outputting a PHC-aligned PPS to
another device, using standard PTP ioctls and no private ABI.
The series:
channels and one periodic output channel.
testptpconfiguration for PPS input, output and simultaneousoperation.
The first external timestamp channel works without periodic output. A second
input channel needs PEROUT active to provide the PHC anchor. With PEROUT active,
both indexed rising-edge inputs can operate alongside the output on three
distinct GPIOs. The direct channel-0 input path also supports falling-edge and
both-edge requests. GPIOs are selected at runtime by GPIO number, not header
pin number. The kernel PTP UAPI is unchanged.
Validation:
enabled. The counter conversion helper also compiles with
W=1.testptpselftest and validated the MACBbinding with
dt-doc-validate.testptp -con a Pi 5 booted with the candidate reports two externaltimestamp channels, one periodic output and 28 programmable pins.
GPIO24 on channel 1 and GPIO23 for PEROUT, and confirmed that the pins were
initially unmapped.
The simultaneous two-input plus output path has not yet received a physical
waveform test. No comparison against the standard
pps-gpiodriver has beenrun. These tests establish neither absolute accuracy nor a jitter bound.
The simultaneous input/output path still needs physical qualification with
separate PPS sources on both input GPIOs and a scope or logic analyzer on the
output. CM5, additional GPIO waveforms, sustained duplex operation, failure
recovery under hardware faults and independent timing calibration remain open.