summaryrefslogtreecommitdiff
path: root/Documentation/netlink/specs/dpll.yaml
blob: b14aed18065f43ce24e9217eefd455814c953efc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)

name: dpll

doc: DPLL subsystem.

definitions:
  -
    type: enum
    name: mode
    doc: |
      working modes a dpll can support, differentiates if and how dpll selects
      one of its inputs to syntonize with it, valid values for DPLL_A_MODE
      attribute
    entries:
      -
        name: manual
        doc: input can be only selected by sending a request to dpll
        value: 1
      -
        name: automatic
        doc: highest prio input pin auto selected by dpll
    render-max: true
  -
    type: enum
    name: lock-status
    doc: |
      provides information of dpll device lock status, valid values for
      DPLL_A_LOCK_STATUS attribute
    entries:
      -
        name: unlocked
        doc: |
          dpll was not yet locked to any valid input (or forced by setting
          DPLL_A_MODE to DPLL_MODE_DETACHED)
        value: 1
      -
        name: locked
        doc: |
          dpll is locked to a valid signal, but no holdover available
      -
        name: locked-ho-acq
        doc: |
          dpll is locked and holdover acquired
      -
        name: holdover
        doc: |
          dpll is in holdover state - lost a valid lock or was forced
          by disconnecting all the pins (latter possible only
          when dpll lock-state was already DPLL_LOCK_STATUS_LOCKED_HO_ACQ,
          if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
          dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
    render-max: true
  -
    type: const
    name: temp-divider
    value: 1000
    doc: |
      temperature divider allowing userspace to calculate the
      temperature as float with three digit decimal precision.
      Value of (DPLL_A_TEMP / DPLL_TEMP_DIVIDER) is integer part of
      temperature value.
      Value of (DPLL_A_TEMP % DPLL_TEMP_DIVIDER) is fractional part of
      temperature value.
  -
    type: enum
    name: type
    doc: type of dpll, valid values for DPLL_A_TYPE attribute
    entries:
      -
        name: pps
        doc: dpll produces Pulse-Per-Second signal
        value: 1
      -
        name: eec
        doc: dpll drives the Ethernet Equipment Clock
    render-max: true
  -
    type: enum
    name: pin-type
    doc: |
      defines possible types of a pin, valid values for DPLL_A_PIN_TYPE
      attribute
    entries:
      -
        name: mux
        doc: aggregates another layer of selectable pins
        value: 1
      -
        name: ext
        doc: external input
      -
        name: synce-eth-port
        doc: ethernet port PHY's recovered clock
      -
        name: int-oscillator
        doc: device internal oscillator
      -
        name: gnss
        doc: GNSS recovered clock
    render-max: true
  -
    type: enum
    name: pin-direction
    doc: |
      defines possible direction of a pin, valid values for
      DPLL_A_PIN_DIRECTION attribute
    entries:
      -
        name: input
        doc: pin used as a input of a signal
        value: 1
      -
        name: output
        doc: pin used to output the signal
    render-max: true
  -
    type: const
    name: pin-frequency-1-hz
    value: 1
  -
    type: const
    name: pin-frequency-10-khz
    value: 10000
  -
    type: const
    name: pin-frequency-77_5-khz
    value: 77500
  -
    type: const
    name: pin-frequency-10-mhz
    value: 10000000
  -
    type: enum
    name: pin-state
    doc: |
      defines possible states of a pin, valid values for
      DPLL_A_PIN_STATE attribute
    entries:
      -
        name: connected
        doc: pin connected, active input of phase locked loop
        value: 1
      -
        name: disconnected
        doc: pin disconnected, not considered as a valid input
      -
        name: selectable
        doc: pin enabled for automatic input selection
    render-max: true
  -
    type: flags
    name: pin-capabilities
    doc: |
      defines possible capabilities of a pin, valid flags on
      DPLL_A_PIN_CAPABILITIES attribute
    entries:
      -
        name: direction-can-change
        doc: pin direction can be changed
      -
        name: priority-can-change
        doc: pin priority can be changed
      -
        name: state-can-change
        doc: pin state can be changed
  -
    type: const
    name: phase-offset-divider
    value: 1000
    doc: |
      phase offset divider allows userspace to calculate a value of
      measured signal phase difference between a pin and dpll device
      as a fractional value with three digit decimal precision.
      Value of (DPLL_A_PHASE_OFFSET / DPLL_PHASE_OFFSET_DIVIDER) is an
      integer part of a measured phase offset value.
      Value of (DPLL_A_PHASE_OFFSET % DPLL_PHASE_OFFSET_DIVIDER) is a
      fractional part of a measured phase offset value.

attribute-sets:
  -
    name: dpll
    enum-name: dpll_a
    attributes:
      -
        name: id
        type: u32
      -
        name: module-name
        type: string
      -
        name: pad
        type: pad
      -
        name: clock-id
        type: u64
      -
        name: mode
        type: u32
        enum: mode
      -
        name: mode-supported
        type: u32
        enum: mode
        multi-attr: true
      -
        name: lock-status
        type: u32
        enum: lock-status
      -
        name: temp
        type: s32
      -
        name: type
        type: u32
        enum: type
  -
    name: pin
    enum-name: dpll_a_pin
    attributes:
      -
        name: id
        type: u32
      -
        name: parent-id
        type: u32
      -
        name: module-name
        type: string
      -
        name: pad
        type: pad
      -
        name: clock-id
        type: u64
      -
        name: board-label
        type: string
      -
        name: panel-label
        type: string
      -
        name: package-label
        type: string
      -
        name: type
        type: u32
        enum: pin-type
      -
        name: direction
        type: u32
        enum: pin-direction
      -
        name: frequency
        type: u64
      -
        name: frequency-supported
        type: nest
        multi-attr: true
        nested-attributes: frequency-range
      -
        name: frequency-min
        type: u64
      -
        name: frequency-max
        type: u64
      -
        name: prio
        type: u32
      -
        name: state
        type: u32
        enum: pin-state
      -
        name: capabilities
        type: u32
      -
        name: parent-device
        type: nest
        multi-attr: true
        nested-attributes: pin-parent-device
      -
        name: parent-pin
        type: nest
        multi-attr: true
        nested-attributes: pin-parent-pin
      -
        name: phase-adjust-min
        type: s32
      -
        name: phase-adjust-max
        type: s32
      -
        name: phase-adjust
        type: s32
      -
        name: phase-offset
        type: s64
      -
        name: fractional-frequency-offset
        type: sint
        doc: |
          The FFO (Fractional Frequency Offset) between the RX and TX
          symbol rate on the media associated with the pin:
          (rx_frequency-tx_frequency)/rx_frequency
          Value is in PPM (parts per million).
          This may be implemented for example for pin of type
          PIN_TYPE_SYNCE_ETH_PORT.
  -
    name: pin-parent-device
    subset-of: pin
    attributes:
      -
        name: parent-id
      -
        name: direction
      -
        name: prio
      -
        name: state
      -
        name: phase-offset
  -
    name: pin-parent-pin
    subset-of: pin
    attributes:
      -
        name: parent-id
      -
        name: state
  -
    name: frequency-range
    subset-of: pin
    attributes:
      -
        name: frequency-min
      -
        name: frequency-max

operations:
  enum-name: dpll_cmd
  list:
    -
      name: device-id-get
      doc: |
        Get id of dpll device that matches given attributes
      attribute-set: dpll
      flags: [ admin-perm ]

      do:
        pre: dpll-lock-doit
        post: dpll-unlock-doit
        request:
          attributes:
            - module-name
            - clock-id
            - type
        reply:
          attributes:
            - id

    -
      name: device-get
      doc: |
        Get list of DPLL devices (dump) or attributes of a single dpll device
      attribute-set: dpll
      flags: [ admin-perm ]

      do:
        pre: dpll-pre-doit
        post: dpll-post-doit
        request:
          attributes:
            - id
        reply: &dev-attrs
          attributes:
            - id
            - module-name
            - mode
            - mode-supported
            - lock-status
            - temp
            - clock-id
            - type

      dump:
        pre: dpll-lock-dumpit
        post: dpll-unlock-dumpit
        reply: *dev-attrs

    -
      name: device-set
      doc: Set attributes for a DPLL device
      attribute-set: dpll
      flags: [ admin-perm ]

      do:
        pre: dpll-pre-doit
        post: dpll-post-doit
        request:
          attributes:
            - id
    -
      name: device-create-ntf
      doc: Notification about device appearing
      notify: device-get
      mcgrp: monitor
    -
      name: device-delete-ntf
      doc: Notification about device disappearing
      notify: device-get
      mcgrp: monitor
    -
      name: device-change-ntf
      doc: Notification about device configuration being changed
      notify: device-get
      mcgrp: monitor
    -
      name: pin-id-get
      doc: |
        Get id of a pin that matches given attributes
      attribute-set: pin
      flags: [ admin-perm ]

      do:
        pre: dpll-lock-doit
        post: dpll-unlock-doit
        request:
          attributes:
            - module-name
            - clock-id
            - board-label
            - panel-label
            - package-label
            - type
        reply:
          attributes:
            - id

    -
      name: pin-get
      doc: |
        Get list of pins and its attributes.
        - dump request without any attributes given - list all the pins in the
          system
        - dump request with target dpll - list all the pins registered with
          a given dpll device
        - do request with target dpll and target pin - single pin attributes
      attribute-set: pin
      flags: [ admin-perm ]

      do:
        pre: dpll-pin-pre-doit
        post: dpll-pin-post-doit
        request:
          attributes:
            - id
        reply: &pin-attrs
          attributes:
            - id
            - board-label
            - panel-label
            - package-label
            - type
            - frequency
            - frequency-supported
            - capabilities
            - parent-device
            - parent-pin
            - phase-adjust-min
            - phase-adjust-max
            - phase-adjust
            - fractional-frequency-offset

      dump:
        pre: dpll-lock-dumpit
        post: dpll-unlock-dumpit
        request:
          attributes:
            - id
        reply: *pin-attrs

    -
      name: pin-set
      doc: Set attributes of a target pin
      attribute-set: pin
      flags: [ admin-perm ]

      do:
        pre: dpll-pin-pre-doit
        post: dpll-pin-post-doit
        request:
          attributes:
            - id
            - frequency
            - direction
            - prio
            - state
            - parent-device
            - parent-pin
            - phase-adjust
    -
      name: pin-create-ntf
      doc: Notification about pin appearing
      notify: pin-get
      mcgrp: monitor
    -
      name: pin-delete-ntf
      doc: Notification about pin disappearing
      notify: pin-get
      mcgrp: monitor
    -
      name: pin-change-ntf
      doc: Notification about pin configuration being changed
      notify: pin-get
      mcgrp: monitor

mcast-groups:
  list:
    -
      name: monitor