2012-11-01 18:24:24 +08:00
|
|
|
.TH PHC2SYS 8 "November 2012" "linuxptp"
|
|
|
|
.SH NAME
|
|
|
|
phc2sys \- synchronize two clocks
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B phc2sys
|
|
|
|
{
|
|
|
|
.BI \-d " pps-device"
|
|
|
|
[
|
|
|
|
.BI \-s " phc-device"
|
|
|
|
|
|
|
|
|
.BI \-i " interface"
|
|
|
|
] |
|
|
|
|
.BI \-s " phc-device"
|
|
|
|
|
|
|
|
|
.BI \-i " interface"
|
|
|
|
} [
|
|
|
|
.BI \-c " phc-device"
|
|
|
|
] [
|
|
|
|
.BI \-P " kp"
|
|
|
|
] [
|
|
|
|
.BI \-I " ki"
|
|
|
|
] [
|
|
|
|
.BI \-R " update-rate"
|
|
|
|
] [
|
|
|
|
.BI \-N " clock-readings"
|
2012-11-06 00:13:30 +08:00
|
|
|
] [
|
|
|
|
.BI \-O " offset"
|
2012-12-10 17:28:28 +08:00
|
|
|
] [
|
|
|
|
.B \-v
|
2012-11-01 18:24:24 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.B phc2sys
|
|
|
|
is a program which synchronizes two clocks in the system. Typically, it is used
|
|
|
|
to synchronize the system clock to a PTP hardware clock (PHC), which itself is
|
|
|
|
synchronized by the
|
|
|
|
.BR ptp4l (8)
|
|
|
|
program.
|
|
|
|
|
|
|
|
Two synchronization modes are supported, one uses a pulse per second (PPS)
|
|
|
|
signal provided by the source clock and the other mode reads time from the
|
|
|
|
source clock directly. The PPS mode is usually preferred, because reading the
|
|
|
|
PHC is slow and introduces an unknown error in the readings, but not all PHCs
|
|
|
|
provide the PPS signal.
|
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
|
|
|
.BI \-d " pps-device"
|
|
|
|
Specify the PPS device of the master clock (e.g. /dev/pps0). With this option
|
|
|
|
the PPS synchronization mode is used instead of the direct mode. As the PPS
|
|
|
|
signal does not specify time and only marks start of a second, the slave clock
|
|
|
|
should be already close to the correct time before
|
|
|
|
.B phc2sys
|
|
|
|
is started or the
|
|
|
|
.B \-s
|
2013-01-18 01:31:40 +08:00
|
|
|
option should be used too. This option can be used only with the system clock as
|
|
|
|
the slave clock.
|
2012-11-01 18:24:24 +08:00
|
|
|
.TP
|
|
|
|
.BI \-s " phc-device"
|
2012-11-01 22:15:35 +08:00
|
|
|
Specify the master clock by device (e.g. /dev/ptp0) or name (e.g. CLOCK_REALTIME
|
|
|
|
for the system clock). When this option is used together with the
|
2012-11-01 18:24:24 +08:00
|
|
|
.B \-d
|
2013-01-18 01:31:39 +08:00
|
|
|
option, the master clock is used only to correct the offset by whole number of
|
|
|
|
seconds, which cannot be fixed with PPS alone.
|
2012-11-01 18:24:24 +08:00
|
|
|
.TP
|
|
|
|
.BI \-i " interface"
|
|
|
|
Similar to the
|
|
|
|
.B \-s
|
|
|
|
option, but specified by the interface which provides the master clock.
|
|
|
|
.TP
|
|
|
|
.BI \-c " phc-device"
|
2012-11-01 22:15:35 +08:00
|
|
|
Specify the slave clock by device (e.g. /dev/ptp1) or name. The default is
|
|
|
|
CLOCK_REALTIME (the system clock).
|
2012-11-01 18:24:24 +08:00
|
|
|
.TP
|
|
|
|
.BI \-P " kp"
|
|
|
|
Specify the proportional constant of the PI controller. The default is 0.7.
|
|
|
|
.TP
|
|
|
|
.BI \-I " ki"
|
|
|
|
Specify the integral constant of the PI controller. The default is 0.3.
|
|
|
|
.TP
|
|
|
|
.BI \-R " update-rate"
|
|
|
|
Specify the slave clock update rate when running in the direct synchronization
|
|
|
|
mode. The default is 1 per second.
|
|
|
|
.TP
|
|
|
|
.BI \-N " phc-num"
|
|
|
|
Specify the number of master clock readings per one slave clock update. Only
|
|
|
|
the fastest reading is used to update the slave clock, this is useful to
|
|
|
|
minimize the error caused by random delays in scheduling and bus utilization.
|
|
|
|
The default is 5.
|
|
|
|
.TP
|
2012-11-06 00:13:30 +08:00
|
|
|
.BI \-O " offset"
|
|
|
|
Specify the offset between the slave and master times in seconds.
|
|
|
|
The default is 0 seconds.
|
|
|
|
.TP
|
2012-11-01 18:24:24 +08:00
|
|
|
.BI \-h
|
|
|
|
Display a help message.
|
2012-12-10 17:28:28 +08:00
|
|
|
.TP
|
|
|
|
.B \-v
|
|
|
|
Prints the software version and exits.
|
2012-11-01 18:24:24 +08:00
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
.BR ptp4l (8)
|