xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/clock/silabs,si5341.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunBinding for Silicon Labs Si5340, Si5341 Si5342, Si5344 and Si5345 programmable
2*4882a593Smuzhiyuni2c clock generator.
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunReference
5*4882a593Smuzhiyun[1] Si5341 Data Sheet
6*4882a593Smuzhiyun    https://www.silabs.com/documents/public/data-sheets/Si5341-40-D-DataSheet.pdf
7*4882a593Smuzhiyun[2] Si5341 Reference Manual
8*4882a593Smuzhiyun    https://www.silabs.com/documents/public/reference-manuals/Si5341-40-D-RM.pdf
9*4882a593Smuzhiyun[3] Si5345 Reference Manual
10*4882a593Smuzhiyun    https://www.silabs.com/documents/public/reference-manuals/Si5345-44-42-D-RM.pdf
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThe Si5341 and Si5340 are programmable i2c clock generators with up to 10 output
13*4882a593Smuzhiyunclocks. The chip contains a PLL that sources 5 (or 4) multisynth clocks, which
14*4882a593Smuzhiyunin turn can be directed to any of the 10 (or 4) outputs through a divider.
15*4882a593SmuzhiyunThe internal structure of the clock generators can be found in [2].
16*4882a593SmuzhiyunThe Si5345 is similar to the Si5341 with the addition of fractional input
17*4882a593Smuzhiyundividers and automatic input selection, as described in [3].
18*4882a593SmuzhiyunThe Si5342 and Si5344 are smaller versions of the Si5345, with 2 or 4 outputs.
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunThe driver can be used in "as is" mode, reading the current settings from the
21*4882a593Smuzhiyunchip at boot, in case you have a (pre-)programmed device. If the PLL is not
22*4882a593Smuzhiyunconfigured when the driver probes, it assumes the driver must fully initialize
23*4882a593Smuzhiyunit.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunThe device type, speed grade and revision are determined runtime by probing.
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunThe driver currently only supports XTAL input mode, and does not support any
28*4882a593Smuzhiyunfancy input configurations. They can still be programmed into the chip and
29*4882a593Smuzhiyunthe driver will leave them "as is".
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun==I2C device node==
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunRequired properties:
34*4882a593Smuzhiyun- compatible: shall be one of the following:
35*4882a593Smuzhiyun	"silabs,si5340" - Si5340 A/B/C/D
36*4882a593Smuzhiyun	"silabs,si5341" - Si5341 A/B/C/D
37*4882a593Smuzhiyun	"silabs,si5342" - Si5342 A/B/C/D
38*4882a593Smuzhiyun	"silabs,si5344" - Si5344 A/B/C/D
39*4882a593Smuzhiyun	"silabs,si5345" - Si5345 A/B/C/D
40*4882a593Smuzhiyun- reg: i2c device address, usually 0x74
41*4882a593Smuzhiyun- #clock-cells: from common clock binding; shall be set to 2.
42*4882a593Smuzhiyun	The first value is "0" for outputs, "1" for synthesizers.
43*4882a593Smuzhiyun	The second value is the output or synthesizer index.
44*4882a593Smuzhiyun- clocks: from common clock binding; list of parent clock  handles,
45*4882a593Smuzhiyun	corresponding to inputs. Use a fixed clock for the "xtal" input.
46*4882a593Smuzhiyun	At least one must be present.
47*4882a593Smuzhiyun- clock-names: One of: "xtal", "in0", "in1", "in2"
48*4882a593Smuzhiyun- vdd-supply: Regulator node for VDD
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunOptional properties:
51*4882a593Smuzhiyun- vdda-supply: Regulator node for VDDA
52*4882a593Smuzhiyun- vdds-supply: Regulator node for VDDS
53*4882a593Smuzhiyun- silabs,pll-m-num, silabs,pll-m-den: Numerator and denominator for PLL
54*4882a593Smuzhiyun  feedback divider. Must be such that the PLL output is in the valid range. For
55*4882a593Smuzhiyun  example, to create 14GHz from a 48MHz xtal, use m-num=14000 and m-den=48. Only
56*4882a593Smuzhiyun  the fraction matters, using 3500 and 12 will deliver the exact same result.
57*4882a593Smuzhiyun  If these are not specified, and the PLL is not yet programmed when the driver
58*4882a593Smuzhiyun  probes, the PLL will be set to 14GHz.
59*4882a593Smuzhiyun- silabs,reprogram: When present, the driver will always assume the device must
60*4882a593Smuzhiyun  be initialized, and always performs the soft-reset routine. Since this will
61*4882a593Smuzhiyun  temporarily stop all output clocks, don't do this if the chip is generating
62*4882a593Smuzhiyun  the CPU clock for example.
63*4882a593Smuzhiyun- interrupts: Interrupt for INTRb pin.
64*4882a593Smuzhiyun- #address-cells: shall be set to 1.
65*4882a593Smuzhiyun- #size-cells: shall be set to 0.
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun== Child nodes: Outputs ==
69*4882a593Smuzhiyun
70*4882a593SmuzhiyunThe child nodes list the output clocks.
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunEach of the clock outputs can be overwritten individually by using a child node.
73*4882a593SmuzhiyunIf a child node for a clock output is not set, the configuration remains
74*4882a593Smuzhiyununchanged.
75*4882a593Smuzhiyun
76*4882a593SmuzhiyunRequired child node properties:
77*4882a593Smuzhiyun- reg: number of clock output.
78*4882a593Smuzhiyun
79*4882a593SmuzhiyunOptional child node properties:
80*4882a593Smuzhiyun- vdd-supply: Regulator node for VDD for this output. The driver selects default
81*4882a593Smuzhiyun	values for common-mode and amplitude based on the voltage.
82*4882a593Smuzhiyun- silabs,format: Output format, one of:
83*4882a593Smuzhiyun	1 = differential (defaults to LVDS levels)
84*4882a593Smuzhiyun	2 = low-power (defaults to HCSL levels)
85*4882a593Smuzhiyun	4 = LVCMOS
86*4882a593Smuzhiyun- silabs,common-mode: Manually override output common mode, see [2] for values
87*4882a593Smuzhiyun- silabs,amplitude: Manually override output amplitude, see [2] for values
88*4882a593Smuzhiyun- silabs,synth-master: boolean. If present, this output is allowed to change the
89*4882a593Smuzhiyun	multisynth frequency dynamically.
90*4882a593Smuzhiyun- silabs,silabs,disable-high: boolean. If set, the clock output is driven HIGH
91*4882a593Smuzhiyun	when disabled, otherwise it's driven LOW.
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun==Example==
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun/* 48MHz reference crystal */
96*4882a593Smuzhiyunref48: ref48M {
97*4882a593Smuzhiyun	compatible = "fixed-clock";
98*4882a593Smuzhiyun	#clock-cells = <0>;
99*4882a593Smuzhiyun	clock-frequency = <48000000>;
100*4882a593Smuzhiyun};
101*4882a593Smuzhiyun
102*4882a593Smuzhiyuni2c-master-node {
103*4882a593Smuzhiyun	/* Programmable clock (for logic) */
104*4882a593Smuzhiyun	si5341: clock-generator@74 {
105*4882a593Smuzhiyun		reg = <0x74>;
106*4882a593Smuzhiyun		compatible = "silabs,si5341";
107*4882a593Smuzhiyun		#clock-cells = <2>;
108*4882a593Smuzhiyun		#address-cells = <1>;
109*4882a593Smuzhiyun		#size-cells = <0>;
110*4882a593Smuzhiyun		clocks = <&ref48>;
111*4882a593Smuzhiyun		clock-names = "xtal";
112*4882a593Smuzhiyun
113*4882a593Smuzhiyun		silabs,pll-m-num = <14000>; /* PLL at 14.0 GHz */
114*4882a593Smuzhiyun		silabs,pll-m-den = <48>;
115*4882a593Smuzhiyun		silabs,reprogram; /* Chips are not programmed, always reset */
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun		out@0 {
118*4882a593Smuzhiyun			reg = <0>;
119*4882a593Smuzhiyun			silabs,format = <1>; /* LVDS 3v3 */
120*4882a593Smuzhiyun			silabs,common-mode = <3>;
121*4882a593Smuzhiyun			silabs,amplitude = <3>;
122*4882a593Smuzhiyun			silabs,synth-master;
123*4882a593Smuzhiyun		};
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun		/*
126*4882a593Smuzhiyun		 * Output 6 configuration:
127*4882a593Smuzhiyun		 *  LVDS 1v8
128*4882a593Smuzhiyun		 */
129*4882a593Smuzhiyun		out@6 {
130*4882a593Smuzhiyun			reg = <6>;
131*4882a593Smuzhiyun			silabs,format = <1>; /* LVDS 1v8 */
132*4882a593Smuzhiyun			silabs,common-mode = <13>;
133*4882a593Smuzhiyun			silabs,amplitude = <3>;
134*4882a593Smuzhiyun		};
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun		/*
137*4882a593Smuzhiyun		 * Output 8 configuration:
138*4882a593Smuzhiyun		 *  HCSL 3v3
139*4882a593Smuzhiyun		 */
140*4882a593Smuzhiyun		out@8 {
141*4882a593Smuzhiyun			reg = <8>;
142*4882a593Smuzhiyun			silabs,format = <2>;
143*4882a593Smuzhiyun			silabs,common-mode = <11>;
144*4882a593Smuzhiyun			silabs,amplitude = <3>;
145*4882a593Smuzhiyun		};
146*4882a593Smuzhiyun	};
147*4882a593Smuzhiyun};
148*4882a593Smuzhiyun
149*4882a593Smuzhiyunsome-video-node {
150*4882a593Smuzhiyun	/* Standard clock bindings */
151*4882a593Smuzhiyun	clock-names = "pixel";
152*4882a593Smuzhiyun	clocks = <&si5341 0 7>; /* Output 7 */
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun	/* Set output 7 to use syntesizer 3 as its parent */
155*4882a593Smuzhiyun	assigned-clocks = <&si5341 0 7>, <&si5341 1 3>;
156*4882a593Smuzhiyun	assigned-clock-parents = <&si5341 1 3>;
157*4882a593Smuzhiyun	/* Set output 7 to 148.5 MHz using a synth frequency of 594 MHz */
158*4882a593Smuzhiyun	assigned-clock-rates = <148500000>, <594000000>;
159*4882a593Smuzhiyun};
160*4882a593Smuzhiyun
161*4882a593Smuzhiyunsome-audio-node {
162*4882a593Smuzhiyun	clock-names = "i2s-clk";
163*4882a593Smuzhiyun	clocks = <&si5341 0 0>;
164*4882a593Smuzhiyun	/*
165*4882a593Smuzhiyun	 * since output 0 is a synth-master, the synth will be automatically set
166*4882a593Smuzhiyun	 * to an appropriate frequency when the audio driver requests another
167*4882a593Smuzhiyun	 * frequency. We give control over synth 2 to this output here.
168*4882a593Smuzhiyun	 */
169*4882a593Smuzhiyun	assigned-clocks = <&si5341 0 0>;
170*4882a593Smuzhiyun	assigned-clock-parents = <&si5341 1 2>;
171*4882a593Smuzhiyun};
172