xref: /linux/Documentation/ABI/testing/sysfs-timecard (revision f81483aaeb59da530b286fe5d081e1705eb5c886)
1What:		/sys/class/timecard/
2Date:		September 2021
3Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
4Description:	This directory contains files and directories
5		providing a standardized interface to the ancillary
6		features of the OpenCompute timecard.
7
8What:		/sys/class/timecard/ocpN/
9Date:		September 2021
10Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
11Description:	This directory contains the attributes of the Nth timecard
12		registered.
13
14What:		/sys/class/timecard/ocpN/available_clock_sources
15Date:		September 2021
16Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
17Description:	(RO) The list of available time sources that the PHC
18		uses for clock adjustments.
19
20		====  =================================================
21                NONE  no adjustments
22                PPS   adjustments come from the PPS1 selector (default)
23                TOD   adjustments from the GNSS/TOD module
24                IRIG  adjustments from external IRIG-B signal
25                DCF   adjustments from external DCF signal
26                ====  =================================================
27
28What:		/sys/class/timecard/ocpN/available_sma_inputs
29Date:		September 2021
30Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
31Description:	(RO) Set of available destinations (sinks) for a SMA
32		input signal.
33
34                =====  ================================================
35                10Mhz  signal is used as the 10Mhz reference clock
36                PPS1   signal is sent to the PPS1 selector
37                PPS2   signal is sent to the PPS2 selector
38                TS1    signal is sent to timestamper 1
39                TS2    signal is sent to timestamper 2
40                IRIG   signal is sent to the IRIG-B module
41                DCF    signal is sent to the DCF module
42                =====  ================================================
43
44What:		/sys/class/timecard/ocpN/available_sma_outputs
45Date:		May 2021
46Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
47Description:	(RO) Set of available sources for a SMA output signal.
48
49                =====  ================================================
50                10Mhz  output is from the 10Mhz reference clock
51                PHC    output PPS is from the PHC clock
52                MAC    output PPS is from the Miniature Atomic Clock
53                GNSS   output PPS is from the GNSS module
54                GNSS2  output PPS is from the second GNSS module
55                IRIG   output is from the PHC, in IRIG-B format
56                DCF    output is from the PHC, in DCF format
57                =====  ================================================
58
59What:		/sys/class/timecard/ocpN/clock_source
60Date:		September 2021
61Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
62Description:	(RW) Contains the current synchronization source used by
63		the PHC.  May be changed by writing one of the listed
64		values from the available_clock_sources attribute set.
65
66What:		/sys/class/timecard/ocpN/gnss_sync
67Date:		September 2021
68Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
69Description:	(RO) Indicates whether a valid GNSS signal is received,
70		or when the signal was lost.
71
72What:		/sys/class/timecard/ocpN/i2c
73Date:		September 2021
74Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
75Description:	This optional attribute links to the associated i2c device.
76
77What:		/sys/class/timecard/ocpN/irig_b_mode
78Date:		September 2021
79Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
80Description:	(RW) An integer from 0-7 indicating the timecode format
81		of the IRIG-B output signal: B00<n>
82
83What:		/sys/class/timecard/ocpN/pps
84Date:		September 2021
85Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
86Description:	This optional attribute links to the associated PPS device.
87
88What:		/sys/class/timecard/ocpN/ptp
89Date:		September 2021
90Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
91Description:	This attribute links to the associated PTP device.
92
93What:		/sys/class/timecard/ocpN/serialnum
94Date:		September 2021
95Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
96Description:	(RO) Provides the serial number of the timecard.
97
98What:		/sys/class/timecard/ocpN/sma1
99What:		/sys/class/timecard/ocpN/sma2
100What:		/sys/class/timecard/ocpN/sma3
101What:		/sys/class/timecard/ocpN/sma4
102Date:		September 2021
103Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
104Description:	(RW) These attributes specify the direction of the signal
105		on the associated SMA connectors, and also the signal sink
106		or source.
107
108		The display format of the attribute is a space separated
109		list of signals, prefixed by the input/output direction.
110
111		The signal direction may be changed (if supported) by
112		prefixing the signal list with either "in:" or "out:".
113		If neither prefix is present, then the direction is unchanged.
114
115		The output signal may be changed by writing one of the listed
116		values from the available_sma_outputs attribute set.
117
118		The input destinations may be changed by writing multiple
119		values from the available_sma_inputs attribute set,
120		separated by spaces.  If there are duplicated input
121		destinations between connectors, the lowest numbered SMA
122		connector is given priority.
123
124		Note that not all input combinations may make sense.
125
126		The 10Mhz reference clock input is currently only valid
127		on SMA1 and may not be combined with other destination sinks.
128
129What:		/sys/class/timecard/ocpN/ts_window_adjust
130Date:		September 2021
131Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
132Description:	(RW) When retrieving the PHC with the PTP SYS_OFFSET_EXTENDED
133		ioctl, a system timestamp is made before and after the PHC
134		time is retrieved.  The midpoint between the two system
135		timestamps is usually taken to be the SYS time associated
136		with the PHC time.  This estimate may be wrong, as it depends
137		on PCI latencies, and when the PHC time was latched
138
139		The attribute value reduces the end timestamp by the given
140		number of nanoseconds, so the computed midpoint matches the
141		retrieved PHC time.
142
143		The initial value is set based on measured PCI latency and
144		the estimated point where the FPGA latches the PHC time.  This
145		value may be changed by writing an unsigned integer.
146
147What:		/sys/class/timecard/ocpN/ttyGNSS
148What:		/sys/class/timecard/ocpN/ttyGNSS2
149Date:		September 2021
150Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
151Description:	These optional attributes link to the TTY serial ports
152		associated with the GNSS devices.
153
154What:		/sys/class/timecard/ocpN/ttyMAC
155Date:		September 2021
156Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
157Description:	This optional attribute links to the TTY serial port
158		associated with the Miniature Atomic Clock.
159
160What:		/sys/class/timecard/ocpN/ttyNMEA
161Date:		September 2021
162Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
163Description:	This optional attribute links to the TTY serial port
164		which outputs the PHC time in NMEA ZDA format.
165
166What:		/sys/class/timecard/ocpN/utc_tai_offset
167Date:		September 2021
168Contact:	Jonathan Lemon <jonathan.lemon@gmail.com>
169Description:	(RW) The DCF and IRIG output signals are in UTC, while the
170		TimeCard operates on TAI.  This attribute allows setting the
171		offset in seconds, which is added to the TAI timebase for
172		these formats.
173
174		The offset may be changed by writing an unsigned integer.
175