1*4882a593SmuzhiyunBinding for TI divider clock 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunBinding status: Unstable - ABI compatibility may be broken in the future 4*4882a593Smuzhiyun 5*4882a593SmuzhiyunThis binding uses the common clock binding[1]. It assumes a 6*4882a593Smuzhiyunregister-mapped adjustable clock rate divider that does not gate and has 7*4882a593Smuzhiyunonly one input clock or parent. By default the value programmed into 8*4882a593Smuzhiyunthe register is one less than the actual divisor value. E.g: 9*4882a593Smuzhiyun 10*4882a593Smuzhiyunregister value actual divisor value 11*4882a593Smuzhiyun0 1 12*4882a593Smuzhiyun1 2 13*4882a593Smuzhiyun2 3 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunThis assumption may be modified by the following optional properties: 16*4882a593Smuzhiyun 17*4882a593Smuzhiyunti,index-starts-at-one - valid divisor values start at 1, not the default 18*4882a593Smuzhiyunof 0. E.g: 19*4882a593Smuzhiyunregister value actual divisor value 20*4882a593Smuzhiyun1 1 21*4882a593Smuzhiyun2 2 22*4882a593Smuzhiyun3 3 23*4882a593Smuzhiyun 24*4882a593Smuzhiyunti,index-power-of-two - valid divisor values are powers of two. E.g: 25*4882a593Smuzhiyunregister value actual divisor value 26*4882a593Smuzhiyun0 1 27*4882a593Smuzhiyun1 2 28*4882a593Smuzhiyun2 4 29*4882a593Smuzhiyun 30*4882a593SmuzhiyunAdditionally an array of valid dividers may be supplied like so: 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun ti,dividers = <4>, <8>, <0>, <16>; 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunWhich will map the resulting values to a divisor table by their index: 35*4882a593Smuzhiyunregister value actual divisor value 36*4882a593Smuzhiyun0 4 37*4882a593Smuzhiyun1 8 38*4882a593Smuzhiyun2 <invalid divisor, skipped> 39*4882a593Smuzhiyun3 16 40*4882a593Smuzhiyun 41*4882a593SmuzhiyunAny zero value in this array means the corresponding bit-value is invalid 42*4882a593Smuzhiyunand must not be used. 43*4882a593Smuzhiyun 44*4882a593SmuzhiyunThe binding must also provide the register to control the divider and 45*4882a593Smuzhiyununless the divider array is provided, min and max dividers. Optionally 46*4882a593Smuzhiyunthe number of bits to shift that mask, if necessary. If the shift value 47*4882a593Smuzhiyunis missing it is the same as supplying a zero shift. 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunThis binding can also optionally provide support to the hardware autoidle 50*4882a593Smuzhiyunfeature, see [2]. 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun[1] Documentation/devicetree/bindings/clock/clock-bindings.txt 53*4882a593Smuzhiyun[2] Documentation/devicetree/bindings/clock/ti/autoidle.txt 54*4882a593Smuzhiyun 55*4882a593SmuzhiyunRequired properties: 56*4882a593Smuzhiyun- compatible : shall be "ti,divider-clock" or "ti,composite-divider-clock". 57*4882a593Smuzhiyun- #clock-cells : from common clock binding; shall be set to 0. 58*4882a593Smuzhiyun- clocks : link to phandle of parent clock 59*4882a593Smuzhiyun- reg : offset for register controlling adjustable divider 60*4882a593Smuzhiyun 61*4882a593SmuzhiyunOptional properties: 62*4882a593Smuzhiyun- clock-output-names : from common clock binding. 63*4882a593Smuzhiyun- ti,dividers : array of integers defining divisors 64*4882a593Smuzhiyun- ti,bit-shift : number of bits to shift the divider value, defaults to 0 65*4882a593Smuzhiyun- ti,min-div : min divisor for dividing the input clock rate, only 66*4882a593Smuzhiyun needed if the first divisor is offset from the default value (1) 67*4882a593Smuzhiyun- ti,max-div : max divisor for dividing the input clock rate, only needed 68*4882a593Smuzhiyun if ti,dividers is not defined. 69*4882a593Smuzhiyun- ti,index-starts-at-one : valid divisor programming starts at 1, not zero, 70*4882a593Smuzhiyun only valid if ti,dividers is not defined. 71*4882a593Smuzhiyun- ti,index-power-of-two : valid divisor programming must be a power of two, 72*4882a593Smuzhiyun only valid if ti,dividers is not defined. 73*4882a593Smuzhiyun- ti,autoidle-shift : bit shift of the autoidle enable bit for the clock, 74*4882a593Smuzhiyun see [2] 75*4882a593Smuzhiyun- ti,invert-autoidle-bit : autoidle is enabled by setting the bit to 0, 76*4882a593Smuzhiyun see [2] 77*4882a593Smuzhiyun- ti,set-rate-parent : clk_set_rate is propagated to parent 78*4882a593Smuzhiyun- ti,latch-bit : latch the divider value to HW, only needed if the register 79*4882a593Smuzhiyun access requires this. As an example dra76x DPLL_GMAC H14 divider implements 80*4882a593Smuzhiyun such behavior. 81*4882a593Smuzhiyun 82*4882a593SmuzhiyunExamples: 83*4882a593Smuzhiyundpll_usb_m2_ck: dpll_usb_m2_ck@4a008190 { 84*4882a593Smuzhiyun #clock-cells = <0>; 85*4882a593Smuzhiyun compatible = "ti,divider-clock"; 86*4882a593Smuzhiyun clocks = <&dpll_usb_ck>; 87*4882a593Smuzhiyun ti,max-div = <127>; 88*4882a593Smuzhiyun reg = <0x190>; 89*4882a593Smuzhiyun ti,index-starts-at-one; 90*4882a593Smuzhiyun}; 91*4882a593Smuzhiyun 92*4882a593Smuzhiyunaess_fclk: aess_fclk@4a004528 { 93*4882a593Smuzhiyun #clock-cells = <0>; 94*4882a593Smuzhiyun compatible = "ti,divider-clock"; 95*4882a593Smuzhiyun clocks = <&abe_clk>; 96*4882a593Smuzhiyun ti,bit-shift = <24>; 97*4882a593Smuzhiyun reg = <0x528>; 98*4882a593Smuzhiyun ti,max-div = <2>; 99*4882a593Smuzhiyun}; 100*4882a593Smuzhiyun 101*4882a593Smuzhiyundpll_core_m3x2_div_ck: dpll_core_m3x2_div_ck { 102*4882a593Smuzhiyun #clock-cells = <0>; 103*4882a593Smuzhiyun compatible = "ti,composite-divider-clock"; 104*4882a593Smuzhiyun clocks = <&dpll_core_x2_ck>; 105*4882a593Smuzhiyun ti,max-div = <31>; 106*4882a593Smuzhiyun reg = <0x0134>; 107*4882a593Smuzhiyun ti,index-starts-at-one; 108*4882a593Smuzhiyun}; 109*4882a593Smuzhiyun 110*4882a593Smuzhiyunssi_ssr_div_fck_3430es2: ssi_ssr_div_fck_3430es2 { 111*4882a593Smuzhiyun #clock-cells = <0>; 112*4882a593Smuzhiyun compatible = "ti,composite-divider-clock"; 113*4882a593Smuzhiyun clocks = <&corex2_fck>; 114*4882a593Smuzhiyun ti,bit-shift = <8>; 115*4882a593Smuzhiyun reg = <0x0a40>; 116*4882a593Smuzhiyun ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>; 117*4882a593Smuzhiyun}; 118