dpll.yaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
  2. ---
  3. name: dpll
  4. doc: DPLL subsystem.
  5. definitions:
  6. -
  7. type: enum
  8. name: mode
  9. doc: |
  10. working modes a dpll can support, differentiates if and how dpll selects
  11. one of its inputs to syntonize with it, valid values for DPLL_A_MODE
  12. attribute
  13. entries:
  14. -
  15. name: manual
  16. doc: input can be only selected by sending a request to dpll
  17. value: 1
  18. -
  19. name: automatic
  20. doc: highest prio input pin auto selected by dpll
  21. render-max: true
  22. -
  23. type: enum
  24. name: lock-status
  25. doc: |
  26. provides information of dpll device lock status, valid values for
  27. DPLL_A_LOCK_STATUS attribute
  28. entries:
  29. -
  30. name: unlocked
  31. doc: |
  32. dpll was not yet locked to any valid input (or forced by setting
  33. DPLL_A_MODE to DPLL_MODE_DETACHED)
  34. value: 1
  35. -
  36. name: locked
  37. doc: |
  38. dpll is locked to a valid signal, but no holdover available
  39. -
  40. name: locked-ho-acq
  41. doc: |
  42. dpll is locked and holdover acquired
  43. -
  44. name: holdover
  45. doc: |
  46. dpll is in holdover state - lost a valid lock or was forced
  47. by disconnecting all the pins (latter possible only
  48. when dpll lock-state was already DPLL_LOCK_STATUS_LOCKED_HO_ACQ,
  49. if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
  50. dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
  51. render-max: true
  52. -
  53. type: enum
  54. name: lock-status-error
  55. doc: |
  56. if previous status change was done due to a failure, this provides
  57. information of dpll device lock status error.
  58. Valid values for DPLL_A_LOCK_STATUS_ERROR attribute
  59. entries:
  60. -
  61. name: none
  62. doc: |
  63. dpll device lock status was changed without any error
  64. value: 1
  65. -
  66. name: undefined
  67. doc: |
  68. dpll device lock status was changed due to undefined error.
  69. Driver fills this value up in case it is not able
  70. to obtain suitable exact error type.
  71. -
  72. name: media-down
  73. doc: |
  74. dpll device lock status was changed because of associated
  75. media got down.
  76. This may happen for example if dpll device was previously
  77. locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
  78. -
  79. name: fractional-frequency-offset-too-high
  80. doc: |
  81. the FFO (Fractional Frequency Offset) between the RX and TX
  82. symbol rate on the media got too high.
  83. This may happen for example if dpll device was previously
  84. locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
  85. render-max: true
  86. -
  87. type: enum
  88. name: clock-quality-level
  89. doc: |
  90. level of quality of a clock device. This mainly applies when
  91. the dpll lock-status is DPLL_LOCK_STATUS_HOLDOVER.
  92. The current list is defined according to the table 11-7 contained
  93. in ITU-T G.8264/Y.1364 document. One may extend this list freely
  94. by other ITU-T defined clock qualities, or different ones defined
  95. by another standardization body (for those, please use
  96. different prefix).
  97. entries:
  98. -
  99. name: itu-opt1-prc
  100. value: 1
  101. -
  102. name: itu-opt1-ssu-a
  103. -
  104. name: itu-opt1-ssu-b
  105. -
  106. name: itu-opt1-eec1
  107. -
  108. name: itu-opt1-prtc
  109. -
  110. name: itu-opt1-eprtc
  111. -
  112. name: itu-opt1-eeec
  113. -
  114. name: itu-opt1-eprc
  115. render-max: true
  116. -
  117. type: const
  118. name: temp-divider
  119. value: 1000
  120. doc: |
  121. temperature divider allowing userspace to calculate the
  122. temperature as float with three digit decimal precision.
  123. Value of (DPLL_A_TEMP / DPLL_TEMP_DIVIDER) is integer part of
  124. temperature value.
  125. Value of (DPLL_A_TEMP % DPLL_TEMP_DIVIDER) is fractional part of
  126. temperature value.
  127. -
  128. type: enum
  129. name: type
  130. doc: type of dpll, valid values for DPLL_A_TYPE attribute
  131. entries:
  132. -
  133. name: pps
  134. doc: dpll produces Pulse-Per-Second signal
  135. value: 1
  136. -
  137. name: eec
  138. doc: dpll drives the Ethernet Equipment Clock
  139. render-max: true
  140. -
  141. type: enum
  142. name: pin-type
  143. doc: |
  144. defines possible types of a pin, valid values for DPLL_A_PIN_TYPE
  145. attribute
  146. entries:
  147. -
  148. name: mux
  149. doc: aggregates another layer of selectable pins
  150. value: 1
  151. -
  152. name: ext
  153. doc: external input
  154. -
  155. name: synce-eth-port
  156. doc: ethernet port PHY's recovered clock
  157. -
  158. name: int-oscillator
  159. doc: device internal oscillator
  160. -
  161. name: gnss
  162. doc: GNSS recovered clock
  163. render-max: true
  164. -
  165. type: enum
  166. name: pin-direction
  167. doc: |
  168. defines possible direction of a pin, valid values for
  169. DPLL_A_PIN_DIRECTION attribute
  170. entries:
  171. -
  172. name: input
  173. doc: pin used as a input of a signal
  174. value: 1
  175. -
  176. name: output
  177. doc: pin used to output the signal
  178. render-max: true
  179. -
  180. type: const
  181. name: pin-frequency-1-hz
  182. value: 1
  183. -
  184. type: const
  185. name: pin-frequency-10-khz
  186. value: 10000
  187. -
  188. type: const
  189. name: pin-frequency-77-5-khz
  190. value: 77500
  191. -
  192. type: const
  193. name: pin-frequency-10-mhz
  194. value: 10000000
  195. -
  196. type: enum
  197. name: pin-state
  198. doc: |
  199. defines possible states of a pin, valid values for
  200. DPLL_A_PIN_STATE attribute
  201. entries:
  202. -
  203. name: connected
  204. doc: pin connected, active input of phase locked loop
  205. value: 1
  206. -
  207. name: disconnected
  208. doc: pin disconnected, not considered as a valid input
  209. -
  210. name: selectable
  211. doc: pin enabled for automatic input selection
  212. render-max: true
  213. -
  214. type: flags
  215. name: pin-capabilities
  216. doc: |
  217. defines possible capabilities of a pin, valid flags on
  218. DPLL_A_PIN_CAPABILITIES attribute
  219. entries:
  220. -
  221. name: direction-can-change
  222. doc: pin direction can be changed
  223. -
  224. name: priority-can-change
  225. doc: pin priority can be changed
  226. -
  227. name: state-can-change
  228. doc: pin state can be changed
  229. -
  230. type: const
  231. name: phase-offset-divider
  232. value: 1000
  233. doc: |
  234. phase offset divider allows userspace to calculate a value of
  235. measured signal phase difference between a pin and dpll device
  236. as a fractional value with three digit decimal precision.
  237. Value of (DPLL_A_PHASE_OFFSET / DPLL_PHASE_OFFSET_DIVIDER) is an
  238. integer part of a measured phase offset value.
  239. Value of (DPLL_A_PHASE_OFFSET % DPLL_PHASE_OFFSET_DIVIDER) is a
  240. fractional part of a measured phase offset value.
  241. -
  242. type: enum
  243. name: feature-state
  244. doc: |
  245. Allow control (enable/disable) and status checking over features.
  246. entries:
  247. -
  248. name: disable
  249. doc: |
  250. feature shall be disabled
  251. -
  252. name: enable
  253. doc: |
  254. feature shall be enabled
  255. attribute-sets:
  256. -
  257. name: dpll
  258. enum-name: dpll_a
  259. attributes:
  260. -
  261. name: id
  262. type: u32
  263. -
  264. name: module-name
  265. type: string
  266. -
  267. name: pad
  268. type: pad
  269. -
  270. name: clock-id
  271. type: u64
  272. -
  273. name: mode
  274. type: u32
  275. enum: mode
  276. -
  277. name: mode-supported
  278. type: u32
  279. enum: mode
  280. multi-attr: true
  281. -
  282. name: lock-status
  283. type: u32
  284. enum: lock-status
  285. -
  286. name: temp
  287. type: s32
  288. -
  289. name: type
  290. type: u32
  291. enum: type
  292. -
  293. name: lock-status-error
  294. type: u32
  295. enum: lock-status-error
  296. -
  297. name: clock-quality-level
  298. type: u32
  299. enum: clock-quality-level
  300. multi-attr: true
  301. doc: |
  302. Level of quality of a clock device. This mainly applies when
  303. the dpll lock-status is DPLL_LOCK_STATUS_HOLDOVER. This could
  304. be put to message multiple times to indicate possible parallel
  305. quality levels (e.g. one specified by ITU option 1 and another
  306. one specified by option 2).
  307. -
  308. name: phase-offset-monitor
  309. type: u32
  310. enum: feature-state
  311. doc: Receive or request state of phase offset monitor feature.
  312. If enabled, dpll device shall monitor and notify all currently
  313. available inputs for changes of their phase offset against the
  314. dpll device.
  315. -
  316. name: phase-offset-avg-factor
  317. type: u32
  318. doc: Averaging factor applied to calculation of reported phase offset.
  319. -
  320. name: pin
  321. enum-name: dpll_a_pin
  322. attributes:
  323. -
  324. name: id
  325. type: u32
  326. -
  327. name: parent-id
  328. type: u32
  329. -
  330. name: module-name
  331. type: string
  332. -
  333. name: pad
  334. type: pad
  335. -
  336. name: clock-id
  337. type: u64
  338. -
  339. name: board-label
  340. type: string
  341. -
  342. name: panel-label
  343. type: string
  344. -
  345. name: package-label
  346. type: string
  347. -
  348. name: type
  349. type: u32
  350. enum: pin-type
  351. -
  352. name: direction
  353. type: u32
  354. enum: pin-direction
  355. -
  356. name: frequency
  357. type: u64
  358. -
  359. name: frequency-supported
  360. type: nest
  361. multi-attr: true
  362. nested-attributes: frequency-range
  363. -
  364. name: frequency-min
  365. type: u64
  366. -
  367. name: frequency-max
  368. type: u64
  369. -
  370. name: prio
  371. type: u32
  372. -
  373. name: state
  374. type: u32
  375. enum: pin-state
  376. -
  377. name: capabilities
  378. type: u32
  379. enum: pin-capabilities
  380. -
  381. name: parent-device
  382. type: nest
  383. multi-attr: true
  384. nested-attributes: pin-parent-device
  385. -
  386. name: parent-pin
  387. type: nest
  388. multi-attr: true
  389. nested-attributes: pin-parent-pin
  390. -
  391. name: phase-adjust-min
  392. type: s32
  393. -
  394. name: phase-adjust-max
  395. type: s32
  396. -
  397. name: phase-adjust
  398. type: s32
  399. -
  400. name: phase-offset
  401. type: s64
  402. -
  403. name: fractional-frequency-offset
  404. type: sint
  405. doc: |
  406. The FFO (Fractional Frequency Offset) between the RX and TX
  407. symbol rate on the media associated with the pin:
  408. (rx_frequency-tx_frequency)/rx_frequency
  409. Value is in PPM (parts per million).
  410. This may be implemented for example for pin of type
  411. PIN_TYPE_SYNCE_ETH_PORT.
  412. -
  413. name: esync-frequency
  414. type: u64
  415. doc: |
  416. Frequency of Embedded SYNC signal. If provided, the pin is configured
  417. with a SYNC signal embedded into its base clock frequency.
  418. -
  419. name: esync-frequency-supported
  420. type: nest
  421. multi-attr: true
  422. nested-attributes: frequency-range
  423. doc: |
  424. If provided a pin is capable of embedding a SYNC signal (within given
  425. range) into its base frequency signal.
  426. -
  427. name: esync-pulse
  428. type: u32
  429. doc: |
  430. A ratio of high to low state of a SYNC signal pulse embedded
  431. into base clock frequency. Value is in percents.
  432. -
  433. name: reference-sync
  434. type: nest
  435. multi-attr: true
  436. nested-attributes: reference-sync
  437. doc: |
  438. Capable pin provides list of pins that can be bound to create a
  439. reference-sync pin pair.
  440. -
  441. name: phase-adjust-gran
  442. type: u32
  443. doc: |
  444. Granularity of phase adjustment, in picoseconds. The value of
  445. phase adjustment must be a multiple of this granularity.
  446. -
  447. name: fractional-frequency-offset-ppt
  448. type: sint
  449. doc: |
  450. The FFO (Fractional Frequency Offset) of the pin with respect to
  451. the nominal frequency.
  452. Value = (frequency_measured - frequency_nominal) / frequency_nominal
  453. Value is in PPT (parts per trillion, 10^-12).
  454. Note: This attribute provides higher resolution than the standard
  455. fractional-frequency-offset (which is in PPM).
  456. -
  457. name: pin-parent-device
  458. subset-of: pin
  459. attributes:
  460. -
  461. name: parent-id
  462. -
  463. name: direction
  464. -
  465. name: prio
  466. -
  467. name: state
  468. -
  469. name: phase-offset
  470. -
  471. name: pin-parent-pin
  472. subset-of: pin
  473. attributes:
  474. -
  475. name: parent-id
  476. -
  477. name: state
  478. -
  479. name: frequency-range
  480. subset-of: pin
  481. attributes:
  482. -
  483. name: frequency-min
  484. -
  485. name: frequency-max
  486. -
  487. name: reference-sync
  488. subset-of: pin
  489. attributes:
  490. -
  491. name: id
  492. -
  493. name: state
  494. operations:
  495. enum-name: dpll_cmd
  496. list:
  497. -
  498. name: device-id-get
  499. doc: |
  500. Get id of dpll device that matches given attributes
  501. attribute-set: dpll
  502. flags: [admin-perm]
  503. do:
  504. pre: dpll-lock-doit
  505. post: dpll-unlock-doit
  506. request:
  507. attributes:
  508. - module-name
  509. - clock-id
  510. - type
  511. reply:
  512. attributes:
  513. - id
  514. -
  515. name: device-get
  516. doc: |
  517. Get list of DPLL devices (dump) or attributes of a single dpll device
  518. attribute-set: dpll
  519. flags: [admin-perm]
  520. do:
  521. pre: dpll-pre-doit
  522. post: dpll-post-doit
  523. request:
  524. attributes:
  525. - id
  526. reply: &dev-attrs
  527. attributes:
  528. - id
  529. - module-name
  530. - mode
  531. - mode-supported
  532. - lock-status
  533. - lock-status-error
  534. - temp
  535. - clock-id
  536. - type
  537. - phase-offset-monitor
  538. - phase-offset-avg-factor
  539. dump:
  540. reply: *dev-attrs
  541. -
  542. name: device-set
  543. doc: Set attributes for a DPLL device
  544. attribute-set: dpll
  545. flags: [admin-perm]
  546. do:
  547. pre: dpll-pre-doit
  548. post: dpll-post-doit
  549. request:
  550. attributes:
  551. - id
  552. - mode
  553. - phase-offset-monitor
  554. - phase-offset-avg-factor
  555. -
  556. name: device-create-ntf
  557. doc: Notification about device appearing
  558. notify: device-get
  559. mcgrp: monitor
  560. -
  561. name: device-delete-ntf
  562. doc: Notification about device disappearing
  563. notify: device-get
  564. mcgrp: monitor
  565. -
  566. name: device-change-ntf
  567. doc: Notification about device configuration being changed
  568. notify: device-get
  569. mcgrp: monitor
  570. -
  571. name: pin-id-get
  572. doc: |
  573. Get id of a pin that matches given attributes
  574. attribute-set: pin
  575. flags: [admin-perm]
  576. do:
  577. pre: dpll-lock-doit
  578. post: dpll-unlock-doit
  579. request:
  580. attributes:
  581. - module-name
  582. - clock-id
  583. - board-label
  584. - panel-label
  585. - package-label
  586. - type
  587. reply:
  588. attributes:
  589. - id
  590. -
  591. name: pin-get
  592. doc: |
  593. Get list of pins and its attributes.
  594. - dump request without any attributes given - list all the pins in the
  595. system
  596. - dump request with target dpll - list all the pins registered with
  597. a given dpll device
  598. - do request with target dpll and target pin - single pin attributes
  599. attribute-set: pin
  600. flags: [admin-perm]
  601. do:
  602. pre: dpll-pin-pre-doit
  603. post: dpll-pin-post-doit
  604. request:
  605. attributes:
  606. - id
  607. reply: &pin-attrs
  608. attributes:
  609. - id
  610. - module-name
  611. - clock-id
  612. - board-label
  613. - panel-label
  614. - package-label
  615. - type
  616. - frequency
  617. - frequency-supported
  618. - capabilities
  619. - parent-device
  620. - parent-pin
  621. - phase-adjust-gran
  622. - phase-adjust-min
  623. - phase-adjust-max
  624. - phase-adjust
  625. - fractional-frequency-offset
  626. - fractional-frequency-offset-ppt
  627. - esync-frequency
  628. - esync-frequency-supported
  629. - esync-pulse
  630. - reference-sync
  631. dump:
  632. request:
  633. attributes:
  634. - id
  635. reply: *pin-attrs
  636. -
  637. name: pin-set
  638. doc: Set attributes of a target pin
  639. attribute-set: pin
  640. flags: [admin-perm]
  641. do:
  642. pre: dpll-pin-pre-doit
  643. post: dpll-pin-post-doit
  644. request:
  645. attributes:
  646. - id
  647. - frequency
  648. - direction
  649. - prio
  650. - state
  651. - parent-device
  652. - parent-pin
  653. - phase-adjust
  654. - esync-frequency
  655. - reference-sync
  656. -
  657. name: pin-create-ntf
  658. doc: Notification about pin appearing
  659. notify: pin-get
  660. mcgrp: monitor
  661. -
  662. name: pin-delete-ntf
  663. doc: Notification about pin disappearing
  664. notify: pin-get
  665. mcgrp: monitor
  666. -
  667. name: pin-change-ntf
  668. doc: Notification about pin configuration being changed
  669. notify: pin-get
  670. mcgrp: monitor
  671. mcast-groups:
  672. list:
  673. -
  674. name: monitor