xref: /freebsd/sys/contrib/device-tree/Bindings/clock/ti/mux.txt (revision 01950c46b8155250f64374fb72fc11faa44bf099)
1c66ec88fSEmmanuel VadotBinding for TI mux clock.
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotThis binding uses the common clock binding[1].  It assumes a
4c66ec88fSEmmanuel Vadotregister-mapped multiplexer with multiple input clock signals or
5c66ec88fSEmmanuel Vadotparents, one of which can be selected as output.  This clock does not
6c66ec88fSEmmanuel Vadotgate or adjust the parent rate via a divider or multiplier.
7c66ec88fSEmmanuel Vadot
8c66ec88fSEmmanuel VadotBy default the "clocks" property lists the parents in the same order
9*aa1a8ff2SEmmanuel Vadotas they are programmed into the register.  E.g:
10c66ec88fSEmmanuel Vadot
11c66ec88fSEmmanuel Vadot	clocks = <&foo_clock>, <&bar_clock>, <&baz_clock>;
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotresults in programming the register as follows:
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel Vadotregister value		selected parent clock
16c66ec88fSEmmanuel Vadot0			foo_clock
17c66ec88fSEmmanuel Vadot1			bar_clock
18c66ec88fSEmmanuel Vadot2			baz_clock
19c66ec88fSEmmanuel Vadot
20c66ec88fSEmmanuel VadotSome clock controller IPs do not allow a value of zero to be programmed
21c66ec88fSEmmanuel Vadotinto the register, instead indexing begins at 1.  The optional property
22c66ec88fSEmmanuel Vadot"index-starts-at-one" modified the scheme as follows:
23c66ec88fSEmmanuel Vadot
24c66ec88fSEmmanuel Vadotregister value		selected clock parent
25c66ec88fSEmmanuel Vadot1			foo_clock
26c66ec88fSEmmanuel Vadot2			bar_clock
27c66ec88fSEmmanuel Vadot3			baz_clock
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel VadotThe binding must provide the register to control the mux. Optionally
30c66ec88fSEmmanuel Vadotthe number of bits to shift the control field in the register can be
31c66ec88fSEmmanuel Vadotsupplied. If the shift value is missing it is the same as supplying
32c66ec88fSEmmanuel Vadota zero shift.
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
35c66ec88fSEmmanuel Vadot
36c66ec88fSEmmanuel VadotRequired properties:
37c66ec88fSEmmanuel Vadot- compatible : shall be "ti,mux-clock" or "ti,composite-mux-clock".
38c66ec88fSEmmanuel Vadot- #clock-cells : from common clock binding; shall be set to 0.
39c66ec88fSEmmanuel Vadot- clocks : link phandles of parent clocks
40c66ec88fSEmmanuel Vadot- reg : register offset for register controlling adjustable mux
41c66ec88fSEmmanuel Vadot
42c66ec88fSEmmanuel VadotOptional properties:
43d5b0e70fSEmmanuel Vadot- clock-output-names : from common clock binding.
44c66ec88fSEmmanuel Vadot- ti,bit-shift : number of bits to shift the bit-mask, defaults to
45c66ec88fSEmmanuel Vadot  0 if not present
46c66ec88fSEmmanuel Vadot- ti,index-starts-at-one : valid input select programming starts at 1, not
47c66ec88fSEmmanuel Vadot  zero
48c66ec88fSEmmanuel Vadot- ti,set-rate-parent : clk_set_rate is propagated to parent clock,
49c66ec88fSEmmanuel Vadot  not supported by the composite-mux-clock subtype
50c66ec88fSEmmanuel Vadot- ti,latch-bit : latch the mux value to HW, only needed if the register
51c66ec88fSEmmanuel Vadot  access requires this. As an example, dra7x DPLL_GMAC H14 muxing
52c66ec88fSEmmanuel Vadot  implements such behavior.
53c66ec88fSEmmanuel Vadot
54c66ec88fSEmmanuel VadotExamples:
55c66ec88fSEmmanuel Vadot
56c66ec88fSEmmanuel Vadotsys_clkin_ck: sys_clkin_ck@4a306110 {
57c66ec88fSEmmanuel Vadot	#clock-cells = <0>;
58c66ec88fSEmmanuel Vadot	compatible = "ti,mux-clock";
59c66ec88fSEmmanuel Vadot	clocks = <&virt_12000000_ck>, <&virt_13000000_ck>, <&virt_16800000_ck>, <&virt_19200000_ck>, <&virt_26000000_ck>, <&virt_27000000_ck>, <&virt_38400000_ck>;
60c66ec88fSEmmanuel Vadot	reg = <0x0110>;
61c66ec88fSEmmanuel Vadot	ti,index-starts-at-one;
62c66ec88fSEmmanuel Vadot};
63c66ec88fSEmmanuel Vadot
64c66ec88fSEmmanuel Vadotabe_dpll_bypass_clk_mux_ck: abe_dpll_bypass_clk_mux_ck@4a306108 {
65c66ec88fSEmmanuel Vadot	#clock-cells = <0>;
66c66ec88fSEmmanuel Vadot	compatible = "ti,mux-clock";
67c66ec88fSEmmanuel Vadot	clocks = <&sys_clkin_ck>, <&sys_32k_ck>;
68c66ec88fSEmmanuel Vadot	ti,bit-shift = <24>;
69c66ec88fSEmmanuel Vadot	reg = <0x0108>;
70c66ec88fSEmmanuel Vadot};
71c66ec88fSEmmanuel Vadot
72c66ec88fSEmmanuel Vadotmcbsp5_mux_fck: mcbsp5_mux_fck {
73c66ec88fSEmmanuel Vadot	#clock-cells = <0>;
74c66ec88fSEmmanuel Vadot	compatible = "ti,composite-mux-clock";
75c66ec88fSEmmanuel Vadot	clocks = <&core_96m_fck>, <&mcbsp_clks>;
76c66ec88fSEmmanuel Vadot	ti,bit-shift = <4>;
77c66ec88fSEmmanuel Vadot	reg = <0x02d8>;
78c66ec88fSEmmanuel Vadot};
79