clock-bindings.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. This binding is a work-in-progress, and are based on some experimental
  2. work by benh[1].
  3. Sources of clock signal can be represented by any node in the device
  4. tree. Those nodes are designated as clock providers. Clock consumer
  5. nodes use a phandle and clock specifier pair to connect clock provider
  6. outputs to clock inputs. Similar to the gpio specifiers, a clock
  7. specifier is an array of one more more cells identifying the clock
  8. output on a device. The length of a clock specifier is defined by the
  9. value of a #clock-cells property in the clock provider node.
  10. [1] http://patchwork.ozlabs.org/patch/31551/
  11. ==Clock providers==
  12. Required properties:
  13. #clock-cells: Number of cells in a clock specifier; Typically 0 for nodes
  14. with a single clock output and 1 for nodes with multiple
  15. clock outputs.
  16. Optional properties:
  17. clock-output-names: Recommended to be a list of strings of clock output signal
  18. names indexed by the first cell in the clock specifier.
  19. However, the meaning of clock-output-names is domain
  20. specific to the clock provider, and is only provided to
  21. encourage using the same meaning for the majority of clock
  22. providers. This format may not work for clock providers
  23. using a complex clock specifier format. In those cases it
  24. is recommended to omit this property and create a binding
  25. specific names property.
  26. Clock consumer nodes must never directly reference
  27. the provider's clock-output-names property.
  28. For example:
  29. oscillator {
  30. #clock-cells = <1>;
  31. clock-output-names = "ckil", "ckih";
  32. };
  33. - this node defines a device with two clock outputs, the first named
  34. "ckil" and the second named "ckih". Consumer nodes always reference
  35. clocks by index. The names should reflect the clock output signal
  36. names for the device.
  37. ==Clock consumers==
  38. Required properties:
  39. clocks: List of phandle and clock specifier pairs, one pair
  40. for each clock input to the device. Note: if the
  41. clock provider specifies '0' for #clock-cells, then
  42. only the phandle portion of the pair will appear.
  43. Optional properties:
  44. clock-names: List of clock input name strings sorted in the same
  45. order as the clocks property. Consumers drivers
  46. will use clock-names to match clock input names
  47. with clocks specifiers.
  48. clock-ranges: Empty property indicating that child nodes can inherit named
  49. clocks from this node. Useful for bus nodes to provide a
  50. clock to their children.
  51. For example:
  52. device {
  53. clocks = <&osc 1>, <&ref 0>;
  54. clock-names = "baud", "register";
  55. };
  56. This represents a device with two clock inputs, named "baud" and "register".
  57. The baud clock is connected to output 1 of the &osc device, and the register
  58. clock is connected to output 0 of the &ref.
  59. ==Example==
  60. /* external oscillator */
  61. osc: oscillator {
  62. compatible = "fixed-clock";
  63. #clock-cells = <1>;
  64. clock-frequency = <32678>;
  65. clock-output-names = "osc";
  66. };
  67. /* phase-locked-loop device, generates a higher frequency clock
  68. * from the external oscillator reference */
  69. pll: pll@4c000 {
  70. compatible = "vendor,some-pll-interface"
  71. #clock-cells = <1>;
  72. clocks = <&osc 0>;
  73. clock-names = "ref";
  74. reg = <0x4c000 0x1000>;
  75. clock-output-names = "pll", "pll-switched";
  76. };
  77. /* UART, using the low frequency oscillator for the baud clock,
  78. * and the high frequency switched PLL output for register
  79. * clocking */
  80. uart@a000 {
  81. compatible = "fsl,imx-uart";
  82. reg = <0xa000 0x1000>;
  83. interrupts = <33>;
  84. clocks = <&osc 0>, <&pll 1>;
  85. clock-names = "baud", "register";
  86. };
  87. This DT fragment defines three devices: an external oscillator to provide a
  88. low-frequency reference clock, a PLL device to generate a higher frequency
  89. clock signal, and a UART.
  90. * The oscillator is fixed-frequency, and provides one clock output, named "osc".
  91. * The PLL is both a clock provider and a clock consumer. It uses the clock
  92. signal generated by the external oscillator, and provides two output signals
  93. ("pll" and "pll-switched").
  94. * The UART has its baud clock connected the external oscillator and its
  95. register clock connected to the PLL clock (the "pll-switched" signal)