162306a36Sopenharmony_ciBinding for TI divider clock
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciBinding status: Unstable - ABI compatibility may be broken in the future
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciThis binding uses the common clock binding[1].  It assumes a
662306a36Sopenharmony_ciregister-mapped adjustable clock rate divider that does not gate and has
762306a36Sopenharmony_cionly one input clock or parent.  By default the value programmed into
862306a36Sopenharmony_cithe register is one less than the actual divisor value.  E.g:
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciregister value		actual divisor value
1162306a36Sopenharmony_ci0			1
1262306a36Sopenharmony_ci1			2
1362306a36Sopenharmony_ci2			3
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciThis assumption may be modified by the following optional properties:
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_citi,index-starts-at-one - valid divisor values start at 1, not the default
1862306a36Sopenharmony_ciof 0.  E.g:
1962306a36Sopenharmony_ciregister value		actual divisor value
2062306a36Sopenharmony_ci1			1
2162306a36Sopenharmony_ci2			2
2262306a36Sopenharmony_ci3			3
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_citi,index-power-of-two - valid divisor values are powers of two.  E.g:
2562306a36Sopenharmony_ciregister value		actual divisor value
2662306a36Sopenharmony_ci0			1
2762306a36Sopenharmony_ci1			2
2862306a36Sopenharmony_ci2			4
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ciAdditionally an array of valid dividers may be supplied like so:
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci	ti,dividers = <4>, <8>, <0>, <16>;
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ciWhich will map the resulting values to a divisor table by their index:
3562306a36Sopenharmony_ciregister value		actual divisor value
3662306a36Sopenharmony_ci0			4
3762306a36Sopenharmony_ci1			8
3862306a36Sopenharmony_ci2			<invalid divisor, skipped>
3962306a36Sopenharmony_ci3			16
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciAny zero value in this array means the corresponding bit-value is invalid
4262306a36Sopenharmony_ciand must not be used.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciThe binding must also provide the register to control the divider and
4562306a36Sopenharmony_ciunless the divider array is provided, min and max dividers. Optionally
4662306a36Sopenharmony_cithe number of bits to shift that mask, if necessary. If the shift value
4762306a36Sopenharmony_ciis missing it is the same as supplying a zero shift.
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ciThis binding can also optionally provide support to the hardware autoidle
5062306a36Sopenharmony_cifeature, see [2].
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
5362306a36Sopenharmony_ci[2] Documentation/devicetree/bindings/clock/ti/autoidle.txt
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciRequired properties:
5662306a36Sopenharmony_ci- compatible : shall be "ti,divider-clock" or "ti,composite-divider-clock".
5762306a36Sopenharmony_ci- #clock-cells : from common clock binding; shall be set to 0.
5862306a36Sopenharmony_ci- clocks : link to phandle of parent clock
5962306a36Sopenharmony_ci- reg : offset for register controlling adjustable divider
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ciOptional properties:
6262306a36Sopenharmony_ci- clock-output-names : from common clock binding.
6362306a36Sopenharmony_ci- ti,dividers : array of integers defining divisors
6462306a36Sopenharmony_ci- ti,bit-shift : number of bits to shift the divider value, defaults to 0
6562306a36Sopenharmony_ci- ti,min-div : min divisor for dividing the input clock rate, only
6662306a36Sopenharmony_ci  needed if the first divisor is offset from the default value (1)
6762306a36Sopenharmony_ci- ti,max-div : max divisor for dividing the input clock rate, only needed
6862306a36Sopenharmony_ci  if ti,dividers is not defined.
6962306a36Sopenharmony_ci- ti,index-starts-at-one : valid divisor programming starts at 1, not zero,
7062306a36Sopenharmony_ci  only valid if ti,dividers is not defined.
7162306a36Sopenharmony_ci- ti,index-power-of-two : valid divisor programming must be a power of two,
7262306a36Sopenharmony_ci  only valid if ti,dividers is not defined.
7362306a36Sopenharmony_ci- ti,autoidle-shift : bit shift of the autoidle enable bit for the clock,
7462306a36Sopenharmony_ci  see [2]
7562306a36Sopenharmony_ci- ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0,
7662306a36Sopenharmony_ci  see [2]
7762306a36Sopenharmony_ci- ti,set-rate-parent : clk_set_rate is propagated to parent
7862306a36Sopenharmony_ci- ti,latch-bit : latch the divider value to HW, only needed if the register
7962306a36Sopenharmony_ci  access requires this. As an example dra76x DPLL_GMAC H14 divider implements
8062306a36Sopenharmony_ci  such behavior.
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ciExamples:
8362306a36Sopenharmony_cidpll_usb_m2_ck: dpll_usb_m2_ck@4a008190 {
8462306a36Sopenharmony_ci	#clock-cells = <0>;
8562306a36Sopenharmony_ci	compatible = "ti,divider-clock";
8662306a36Sopenharmony_ci	clocks = <&dpll_usb_ck>;
8762306a36Sopenharmony_ci	ti,max-div = <127>;
8862306a36Sopenharmony_ci	reg = <0x190>;
8962306a36Sopenharmony_ci	ti,index-starts-at-one;
9062306a36Sopenharmony_ci};
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ciaess_fclk: aess_fclk@4a004528 {
9362306a36Sopenharmony_ci	#clock-cells = <0>;
9462306a36Sopenharmony_ci	compatible = "ti,divider-clock";
9562306a36Sopenharmony_ci	clocks = <&abe_clk>;
9662306a36Sopenharmony_ci	ti,bit-shift = <24>;
9762306a36Sopenharmony_ci	reg = <0x528>;
9862306a36Sopenharmony_ci	ti,max-div = <2>;
9962306a36Sopenharmony_ci};
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_cidpll_core_m3x2_div_ck: dpll_core_m3x2_div_ck {
10262306a36Sopenharmony_ci	#clock-cells = <0>;
10362306a36Sopenharmony_ci	compatible = "ti,composite-divider-clock";
10462306a36Sopenharmony_ci	clocks = <&dpll_core_x2_ck>;
10562306a36Sopenharmony_ci	ti,max-div = <31>;
10662306a36Sopenharmony_ci	reg = <0x0134>;
10762306a36Sopenharmony_ci	ti,index-starts-at-one;
10862306a36Sopenharmony_ci};
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_cissi_ssr_div_fck_3430es2: ssi_ssr_div_fck_3430es2 {
11162306a36Sopenharmony_ci	#clock-cells = <0>;
11262306a36Sopenharmony_ci	compatible = "ti,composite-divider-clock";
11362306a36Sopenharmony_ci	clocks = <&corex2_fck>;
11462306a36Sopenharmony_ci	ti,bit-shift = <8>;
11562306a36Sopenharmony_ci	reg = <0x0a40>;
11662306a36Sopenharmony_ci	ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
11762306a36Sopenharmony_ci};
118