Commit Graph

6 Commits (master)

Author SHA1 Message Date
Richard Cochran 7df88afab9 Add support for write phase mode.
Recently the Linux kernel's PTP Hardware Clock interface was expanded
to include a "write phase" mode where the clock servo in implemented
in hardware.  This mode hearkens back to the tradition ntp_adjtime
interface, passing a measured offset into the kernel's servo.

This patch adds a new configuration option and logic to support the
write phase mode.

Because the hardware's adjustment bandwidth may be limited, this mode
is only activated when the servo reaches SERVO_LOCKED_STABLE state, in
order to achieve reasonably fast locking times.  Users may control the
SERVO_LOCKED_STABLE state by configuring 'servo_offset_threshold' and
'servo_num_offset_values' accordingly.

Example configuration file highlights:

  unicast_listen          1
  logSyncInterval         0
  logMinDelayReqInterval  0
  first_step_threshold    0.001000000
  step_threshold          0
  clock_servo             pi

  write_phase_mode        1
  servo_offset_threshold  50
  servo_num_offset_values 10
  tsproc_mode             raw

Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2020-05-24 11:43:51 -07:00
Richard Cochran 43d49a21d0 Add PHC methods for querying and configuring the pin functionality.
In anticipation of support for external time stamping in PHC devices, this
patch adds wrapper functions around the pin functionality.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2020-03-21 04:48:16 -07:00
Dimitrios Katsaros a5da8c4b71 Added support for opening POSIX clock devices
I have reduced the requirements for the -p option to accept
any type of device. With this it should be possible to use
ptp4l to syncronize any clock device that implements the kernel
POSIX clock interface.

[ RC - Initialize struct timex. ]

Signed-off-by: Dimitrios Katsaros <patcherwork@gmail.com>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2019-01-06 19:41:45 -08:00
Jiri Benc 4004273cd8 phc2sys: enable PPS output from PHC
PPS output from a PHC has to be enabled by PTP_ENABLE_PPS ioctl. Call
the ioctl when both PHC device and PPS device are specified and PPS is
supported by the PHC.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
2013-04-19 17:52:25 +02:00
Richard Cochran 5b8fa684ae phc: Add a method to query the maximum adjustment.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-12 18:58:59 +01:00
Richard Cochran 11e0446c0e Add code to open and close PHC devices.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
2011-11-01 18:00:16 +01:00