← Documents Documentation/ABI/testing/sysfs-ptp GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

PTP hardware-clock sysfs ABI

PTP hardware clock identity·capabilities, virtual clocks, programmable pins, external timestamps, periodic output과 Linux PPS delivery를 정의합니다.

Source pathDocumentation/ABI/testing/sysfs-ptp
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Clock identity와 adjustment

sysfs-ptp:1-42

Indexed PTP clock마다 friendly name, maximum frequency adjustment와 virtual-clock limit를 제공합니다.

Hardware channels와 virtual clocks

sysfs-ptp:43-83

Alarm·external timestamp·periodic output·pin counts와 physical/virtual clock operating mode를 관리합니다.

Programmable pins와 PPS capability

sysfs-ptp:84-105

Pin function/channel assignment을 읽고 쓰며 host CPU용 PPS support 여부를 확인합니다.

External timestamps와 periodic output

sysfs-ptp:106-142

External timestamp channels, FIFO event tuples, periodic waveform timing과 Linux PPS event delivery를 제어합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/class/ptp/
2 Date: September 2010
3 Contact: Richard Cochran <[email protected]>
4 Description:
5 This directory contains files and directories
6 providing a standardized interface to the ancillary
7 features of PTP hardware clocks.
8
9 What: /sys/class/ptp/ptp<N>/
10 Date: September 2010
11 Contact: Richard Cochran <[email protected]>
12 Description:
13 This directory contains the attributes of the Nth PTP
14 hardware clock registered into the PTP class driver
15 subsystem.
16
17 What: /sys/class/ptp/ptp<N>/clock_name
18 Date: September 2010
19 Contact: Richard Cochran <[email protected]>
20 Description:
21 This file contains the name of the PTP hardware clock
22 as a human readable string. The purpose of this
23 attribute is to provide the user with a "friendly
24 name" and to help distinguish PHY based devices from
25 MAC based ones. The string does not necessarily have
26 to be any kind of unique id.
27
28 What: /sys/class/ptp/ptp<N>/max_adjustment
29 Date: September 2010
30 Contact: Richard Cochran <[email protected]>
31 Description:
32 This file contains the PTP hardware clock's maximum
33 frequency adjustment value (a positive integer) in
34 parts per billion.
35
36 What: /sys/class/ptp/ptp<N>/max_vclocks
37 Date: May 2021
38 Contact: Yangbo Lu <[email protected]>
39 Description:
40 This file contains the maximum number of ptp vclocks.
41 Write integer to re-configure it.
42
43 What: /sys/class/ptp/ptp<N>/n_alarms
44 Date: September 2010
45 Contact: Richard Cochran <[email protected]>
46 Description:
47 This file contains the number of periodic or one shot
48 alarms offer by the PTP hardware clock.
49
50 What: /sys/class/ptp/ptp<N>/n_external_timestamps
51 Date: September 2010
52 Contact: Richard Cochran <[email protected]>
53 Description:
54 This file contains the number of external timestamp
55 channels offered by the PTP hardware clock.
56
57 What: /sys/class/ptp/ptp<N>/n_periodic_outputs
58 Date: September 2010
59 Contact: Richard Cochran <[email protected]>
60 Description:
61 This file contains the number of programmable periodic
62 output channels offered by the PTP hardware clock.
63
64 What: /sys/class/ptp/ptp<N>/n_pins
65 Date: March 2014
66 Contact: Richard Cochran <[email protected]>
67 Description:
68 This file contains the number of programmable pins
69 offered by the PTP hardware clock.
70
71 What: /sys/class/ptp/ptp<N>/n_vclocks
72 Date: May 2021
73 Contact: Yangbo Lu <[email protected]>
74 Description:
75 This file contains the number of virtual PTP clocks in
76 use. By default, the value is 0 meaning that only the
77 physical clock is in use. Setting the value creates
78 the corresponding number of virtual clocks and causes
79 the physical clock to become free running. Setting the
80 value back to 0 deletes the virtual clocks and
81 switches the physical clock back to normal, adjustable
82 operation.
83
84 What: /sys/class/ptp/ptp<N>/pins
85 Date: March 2014
86 Contact: Richard Cochran <[email protected]>
87 Description:
88 This directory contains one file for each programmable
89 pin offered by the PTP hardware clock. The file name
90 is the hardware dependent pin name. Reading from this
91 file produces two numbers, the assigned function (see
92 the `PTP_PF_` enumeration values in linux/ptp_clock.h)
93 and the channel number. The function and channel
94 assignment may be changed by two writing numbers into
95 the file.
96
97 What: /sys/class/ptp/ptp<N>/pps_available
98 Date: September 2010
99 Contact: Richard Cochran <[email protected]>
100 Description:
101 This file indicates whether the PTP hardware clock
102 supports a Pulse Per Second to the host CPU. Reading
103 "1" means that the PPS is supported, while "0" means
104 not supported.
105
106 What: /sys/class/ptp/ptp<N>/extts_enable
107 Date: September 2010
108 Contact: Richard Cochran <[email protected]>
109 Description:
110 This write-only file enables or disables external
111 timestamps. To enable external timestamps, write the
112 channel index followed by a "1" into the file.
113 To disable external timestamps, write the channel
114 index followed by a "0" into the file.
115
116 What: /sys/class/ptp/ptp<N>/fifo
117 Date: September 2010
118 Contact: Richard Cochran <[email protected]>
119 Description:
120 This file provides timestamps on external events, in
121 the form of three integers: channel index, seconds,
122 and nanoseconds.
123
124 What: /sys/class/ptp/ptp<N>/period
125 Date: September 2010
126 Contact: Richard Cochran <[email protected]>
127 Description:
128 This write-only file enables or disables periodic
129 outputs. To enable a periodic output, write five
130 integers into the file: channel index, start time
131 seconds, start time nanoseconds, period seconds, and
132 period nanoseconds. To disable a periodic output, set
133 all the seconds and nanoseconds values to zero.
134
135 What: /sys/class/ptp/ptp<N>/pps_enable
136 Date: September 2010
137 Contact: Richard Cochran <[email protected]>
138 Description:
139 This write-only file enables or disables delivery of
140 PPS events to the Linux PPS subsystem. To enable PPS
141 events, write a "1" into the file. To disable events,
142 write a "0" into the file.
143

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

PTP hardware-clock sysfs ABI: ptp

1-8
항목한국어 전문 번역
What/sys/class/ptp/
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/` directory에는 PTP hardware clocks의 ancillary features에 대한 standardized interface를 제공하는 files와 directories가 들어 있습니다.

PTP hardware-clock sysfs ABI: ptp<N>

9-16
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/` directory에는 PTP class-driver subsystem에 register된 N번째 PTP hardware clock의 attributes가 들어 있습니다.

PTP hardware-clock sysfs ABI: clock name

17-27
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/clock_name
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/clock_name`은 PTP hardware clock의 human-readable name을 담습니다. Friendly name을 제공하고 PHY-based device와 MAC-based device를 구분하는 데 도움을 주며 unique ID일 필요는 없습니다.
PTP clock identity and adjustment
AttributeMeaning
clock_nameFriendly, not necessarily unique clock name
max_adjustmentMaximum positive adjustment in ppb
max_vclocksConfigurable virtual-clock maximum

User-facing identity와 frequency-control limit를 비교합니다.

PTP hardware-clock sysfs ABI: max adjustment

28-35
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/max_adjustment
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/max_adjustment`는 PTP hardware clock의 maximum frequency adjustment positive integer를 parts per billion 단위로 담습니다.

PTP hardware-clock sysfs ABI: max vclocks

36-42
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/max_vclocks
Date2021년 5월
KernelVersion
ContactYangbo Lu <[email protected]>
Description`/sys/class/ptp/ptp<N>/max_vclocks`는 maximum PTP virtual clocks 수를 담습니다. Integer를 쓰면 reconfigure합니다.

PTP hardware-clock sysfs ABI: n alarms

43-49
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/n_alarms
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/n_alarms`는 PTP hardware clock이 제공하는 periodic 또는 one-shot alarms 수입니다.
PTP hardware capability counts
AttributeResource count
n_alarmsPeriodic or one-shot alarms
n_external_timestampsExternal timestamp channels
n_periodic_outputsProgrammable periodic outputs
n_pinsProgrammable pins

Clock이 제공하는 programmable resources를 정리합니다.

PTP hardware-clock sysfs ABI: n external timestamps

50-56
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/n_external_timestamps
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/n_external_timestamps`는 PTP hardware clock이 제공하는 external timestamp channels 수입니다.

PTP hardware-clock sysfs ABI: n periodic outputs

57-63
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/n_periodic_outputs
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/n_periodic_outputs`는 PTP hardware clock이 제공하는 programmable periodic-output channels 수입니다.

PTP hardware-clock sysfs ABI: n pins

64-70
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/n_pins
Date2014년 3월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/n_pins`는 PTP hardware clock이 제공하는 programmable pins 수입니다.

PTP hardware-clock sysfs ABI: n vclocks

71-83
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/n_vclocks
Date2021년 5월
KernelVersion
ContactYangbo Lu <[email protected]>
Description`/sys/class/ptp/ptp<N>/n_vclocks`는 사용 중인 virtual PTP clocks 수입니다. Default `0`은 physical clock만 사용함을 뜻합니다. Nonzero value를 설정하면 그 수만큼 virtual clocks를 만들고 physical clock은 free-running 상태가 됩니다. 다시 `0`으로 설정하면 virtual clocks를 삭제하고 physical clock을 normal adjustable operation으로 되돌립니다.
PTP virtual-clock lifecycle
n_vclocks = 0Physical clock adjustableNo virtual clocks
Set n_vclocks = NCreate N virtual clocksPhysical clock free running
Set back to 0Delete virtual clocksRestore adjustable physical clock

n_vclocks가 physical clock mode와 virtual-clock objects를 함께 전환합니다.

PTP hardware-clock sysfs ABI: pins

84-96
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/pins
Date2014년 3월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/pins` directory에는 PTP hardware clock이 제공하는 programmable pin마다 file 하나가 있습니다. Filename은 hardware-dependent pin name입니다. Read하면 assigned function과 channel number의 두 numbers를 반환하며 function은 `linux/ptp_clock.h`의 `PTP_PF_` enumeration values를 사용합니다. 두 numbers를 쓰면 function과 channel assignment를 변경할 수 있습니다.
PTP programmable pin assignment
PositionFieldDefinition
1Assigned functionPTP_PF_ value from linux/ptp_clock.h
2Channel numberClock channel assigned to pin

Pin file read/write tuple의 두 values와 source enumeration을 보존합니다.

PTP hardware-clock sysfs ABI: pps available

97-105
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/pps_available
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/pps_available`은 PTP hardware clock이 host CPU에 Pulse Per Second를 제공하는지 나타냅니다. `1`은 PPS supported, `0`은 not supported입니다.
PTP PPS availability
ValueMeaning
1PPS supported
0PPS not supported

Host CPU에 대한 PPS capability를 binary value로 보고합니다.

PTP hardware-clock sysfs ABI: extts enable

106-115
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/extts_enable
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/extts_enable`은 external timestamps를 enable 또는 disable하는 write-only file입니다. Channel index 뒤에 `1`을 쓰면 enable, `0`을 쓰면 disable합니다.
External timestamp control
PositionFieldValues
1Channel indexExternal timestamp channel
2Enable1 enable; 0 disable

extts_enable의 two-integer write format입니다.

PTP hardware-clock sysfs ABI: fifo

116-123
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/fifo
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/fifo`는 external events의 timestamps를 channel index, seconds, nanoseconds의 세 integers로 제공합니다.
PTP external-event FIFO tuple
PositionField
1Channel index
2Seconds
3Nanoseconds

FIFO event timestamp를 세 integers 순서로 반환합니다.

PTP hardware-clock sysfs ABI: period

124-134
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/period
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/period`는 periodic outputs를 enable 또는 disable하는 write-only file입니다. Enable하려면 channel index, start-time seconds, start-time nanoseconds, period seconds, period nanoseconds의 다섯 integers를 씁니다. Disable하려면 모든 seconds와 nanoseconds values를 zero로 설정합니다.
PTP periodic-output write tuple
PositionField
1Channel index
2Start time seconds
3Start time nanoseconds
4Period seconds
5Period nanoseconds
DisableSet every seconds and nanoseconds field to zero.

period file에 쓰는 다섯 integers 순서입니다.

PTP hardware-clock sysfs ABI: pps enable

135-142
항목한국어 전문 번역
What/sys/class/ptp/ptp<N>/pps_enable
Date2010년 9월
KernelVersion
ContactRichard Cochran <[email protected]>
Description`/sys/class/ptp/ptp<N>/pps_enable`은 Linux PPS subsystem으로 PPS events를 전달할지 enable 또는 disable하는 write-only file입니다. `1`은 enable, `0`은 disable입니다.
PTP to Linux PPS delivery
Write 1Enable PPS event deliveryLinux PPS subsystem receives events
Write 0Disable PPS event delivery

pps_enable controls event delivery from the hardware clock to the Linux PPS subsystem.