18c2ecf20Sopenharmony_ciBinding for TI mux clock. 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciBinding status: Unstable - ABI compatibility may be broken in the future 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciThis binding uses the common clock binding[1]. It assumes a 68c2ecf20Sopenharmony_ciregister-mapped multiplexer with multiple input clock signals or 78c2ecf20Sopenharmony_ciparents, one of which can be selected as output. This clock does not 88c2ecf20Sopenharmony_cigate or adjust the parent rate via a divider or multiplier. 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciBy default the "clocks" property lists the parents in the same order 118c2ecf20Sopenharmony_cias they are programmed into the regster. E.g: 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci clocks = <&foo_clock>, <&bar_clock>, <&baz_clock>; 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciresults in programming the register as follows: 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciregister value selected parent clock 188c2ecf20Sopenharmony_ci0 foo_clock 198c2ecf20Sopenharmony_ci1 bar_clock 208c2ecf20Sopenharmony_ci2 baz_clock 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciSome clock controller IPs do not allow a value of zero to be programmed 238c2ecf20Sopenharmony_ciinto the register, instead indexing begins at 1. The optional property 248c2ecf20Sopenharmony_ci"index-starts-at-one" modified the scheme as follows: 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciregister value selected clock parent 278c2ecf20Sopenharmony_ci1 foo_clock 288c2ecf20Sopenharmony_ci2 bar_clock 298c2ecf20Sopenharmony_ci3 baz_clock 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciThe binding must provide the register to control the mux. Optionally 328c2ecf20Sopenharmony_cithe number of bits to shift the control field in the register can be 338c2ecf20Sopenharmony_cisupplied. If the shift value is missing it is the same as supplying 348c2ecf20Sopenharmony_cia zero shift. 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci[1] Documentation/devicetree/bindings/clock/clock-bindings.txt 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ciRequired properties: 398c2ecf20Sopenharmony_ci- compatible : shall be "ti,mux-clock" or "ti,composite-mux-clock". 408c2ecf20Sopenharmony_ci- #clock-cells : from common clock binding; shall be set to 0. 418c2ecf20Sopenharmony_ci- clocks : link phandles of parent clocks 428c2ecf20Sopenharmony_ci- reg : register offset for register controlling adjustable mux 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ciOptional properties: 458c2ecf20Sopenharmony_ci- ti,bit-shift : number of bits to shift the bit-mask, defaults to 468c2ecf20Sopenharmony_ci 0 if not present 478c2ecf20Sopenharmony_ci- ti,index-starts-at-one : valid input select programming starts at 1, not 488c2ecf20Sopenharmony_ci zero 498c2ecf20Sopenharmony_ci- ti,set-rate-parent : clk_set_rate is propagated to parent clock, 508c2ecf20Sopenharmony_ci not supported by the composite-mux-clock subtype 518c2ecf20Sopenharmony_ci- ti,latch-bit : latch the mux value to HW, only needed if the register 528c2ecf20Sopenharmony_ci access requires this. As an example, dra7x DPLL_GMAC H14 muxing 538c2ecf20Sopenharmony_ci implements such behavior. 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ciExamples: 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_cisys_clkin_ck: sys_clkin_ck@4a306110 { 588c2ecf20Sopenharmony_ci #clock-cells = <0>; 598c2ecf20Sopenharmony_ci compatible = "ti,mux-clock"; 608c2ecf20Sopenharmony_ci clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>; 618c2ecf20Sopenharmony_ci reg = <0x0110>; 628c2ecf20Sopenharmony_ci ti,index-starts-at-one; 638c2ecf20Sopenharmony_ci}; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ciabe_dpll_bypass_clk_mux_ck: abe_dpll_bypass_clk_mux_ck@4a306108 { 668c2ecf20Sopenharmony_ci #clock-cells = <0>; 678c2ecf20Sopenharmony_ci compatible = "ti,mux-clock"; 688c2ecf20Sopenharmony_ci clocks = <&sys_clkin_ck>, <&sys_32k_ck>; 698c2ecf20Sopenharmony_ci ti,bit-shift = <24>; 708c2ecf20Sopenharmony_ci reg = <0x0108>; 718c2ecf20Sopenharmony_ci}; 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_cimcbsp5_mux_fck: mcbsp5_mux_fck { 748c2ecf20Sopenharmony_ci #clock-cells = <0>; 758c2ecf20Sopenharmony_ci compatible = "ti,composite-mux-clock"; 768c2ecf20Sopenharmony_ci clocks = <&core_96m_fck>, <&mcbsp_clks>; 778c2ecf20Sopenharmony_ci ti,bit-shift = <4>; 788c2ecf20Sopenharmony_ci reg = <0x02d8>; 798c2ecf20Sopenharmony_ci}; 80