divider.txt 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. Binding for TI divider clock
  2. Binding status: Unstable - ABI compatibility may be broken in the future
  3. This binding uses the common clock binding[1]. It assumes a
  4. register-mapped adjustable clock rate divider that does not gate and has
  5. only one input clock or parent. By default the value programmed into
  6. the register is one less than the actual divisor value. E.g:
  7. register value actual divisor value
  8. 0 1
  9. 1 2
  10. 2 3
  11. This assumption may be modified by the following optional properties:
  12. ti,index-starts-at-one - valid divisor values start at 1, not the default
  13. of 0. E.g:
  14. register value actual divisor value
  15. 1 1
  16. 2 2
  17. 3 3
  18. ti,index-power-of-two - valid divisor values are powers of two. E.g:
  19. register value actual divisor value
  20. 0 1
  21. 1 2
  22. 2 4
  23. Additionally an array of valid dividers may be supplied like so:
  24. ti,dividers = <4>, <8>, <0>, <16>;
  25. Which will map the resulting values to a divisor table by their index:
  26. register value actual divisor value
  27. 0 4
  28. 1 8
  29. 2 <invalid divisor, skipped>
  30. 3 16
  31. Any zero value in this array means the corresponding bit-value is invalid
  32. and must not be used.
  33. The binding must also provide the register to control the divider and
  34. unless the divider array is provided, min and max dividers. Optionally
  35. the number of bits to shift that mask, if necessary. If the shift value
  36. is missing it is the same as supplying a zero shift.
  37. This binding can also optionally provide support to the hardware autoidle
  38. feature, see [2].
  39. [1] Documentation/devicetree/bindings/clock/clock-bindings.txt
  40. [2] Documentation/devicetree/bindings/clock/ti/autoidle.txt
  41. Required properties:
  42. - compatible : shall be "ti,divider-clock" or "ti,composite-divider-clock".
  43. - #clock-cells : from common clock binding; shall be set to 0.
  44. - clocks : link to phandle of parent clock
  45. - reg : offset for register controlling adjustable divider
  46. Optional properties:
  47. - clock-output-names : from common clock binding.
  48. - ti,dividers : array of integers defining divisors
  49. - ti,bit-shift : number of bits to shift the divider value, defaults to 0
  50. - ti,min-div : min divisor for dividing the input clock rate, only
  51. needed if the first divisor is offset from the default value (1)
  52. - ti,max-div : max divisor for dividing the input clock rate, only needed
  53. if ti,dividers is not defined.
  54. - ti,index-starts-at-one : valid divisor programming starts at 1, not zero,
  55. only valid if ti,dividers is not defined.
  56. - ti,index-power-of-two : valid divisor programming must be a power of two,
  57. only valid if ti,dividers is not defined.
  58. - ti,autoidle-shift : bit shift of the autoidle enable bit for the clock,
  59. see [2]
  60. - ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0,
  61. see [2]
  62. - ti,set-rate-parent : clk_set_rate is propagated to parent
  63. Examples:
  64. dpll_usb_m2_ck: dpll_usb_m2_ck@4a008190 {
  65. #clock-cells = <0>;
  66. compatible = "ti,divider-clock";
  67. clocks = <&dpll_usb_ck>;
  68. ti,max-div = <127>;
  69. reg = <0x190>;
  70. ti,index-starts-at-one;
  71. };
  72. aess_fclk: aess_fclk@4a004528 {
  73. #clock-cells = <0>;
  74. compatible = "ti,divider-clock";
  75. clocks = <&abe_clk>;
  76. ti,bit-shift = <24>;
  77. reg = <0x528>;
  78. ti,max-div = <2>;
  79. };
  80. dpll_core_m3x2_div_ck: dpll_core_m3x2_div_ck {
  81. #clock-cells = <0>;
  82. compatible = "ti,composite-divider-clock";
  83. clocks = <&dpll_core_x2_ck>;
  84. ti,max-div = <31>;
  85. reg = <0x0134>;
  86. ti,index-starts-at-one;
  87. };
  88. ssi_ssr_div_fck_3430es2: ssi_ssr_div_fck_3430es2 {
  89. #clock-cells = <0>;
  90. compatible = "ti,composite-divider-clock";
  91. clocks = <&corex2_fck>;
  92. ti,bit-shift = <8>;
  93. reg = <0x0a40>;
  94. ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
  95. };