162306a36Sopenharmony_ciBinding for Silicon Labs Si5340, Si5341 Si5342, Si5344 and Si5345 programmable 262306a36Sopenharmony_cii2c clock generator. 362306a36Sopenharmony_ci 462306a36Sopenharmony_ciReference 562306a36Sopenharmony_ci[1] Si5341 Data Sheet 662306a36Sopenharmony_ci https://www.silabs.com/documents/public/data-sheets/Si5341-40-D-DataSheet.pdf 762306a36Sopenharmony_ci[2] Si5341 Reference Manual 862306a36Sopenharmony_ci https://www.silabs.com/documents/public/reference-manuals/Si5341-40-D-RM.pdf 962306a36Sopenharmony_ci[3] Si5345 Reference Manual 1062306a36Sopenharmony_ci https://www.silabs.com/documents/public/reference-manuals/Si5345-44-42-D-RM.pdf 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ciThe Si5341 and Si5340 are programmable i2c clock generators with up to 10 output 1362306a36Sopenharmony_ciclocks. The chip contains a PLL that sources 5 (or 4) multisynth clocks, which 1462306a36Sopenharmony_ciin turn can be directed to any of the 10 (or 4) outputs through a divider. 1562306a36Sopenharmony_ciThe internal structure of the clock generators can be found in [2]. 1662306a36Sopenharmony_ciThe Si5345 is similar to the Si5341 with the addition of fractional input 1762306a36Sopenharmony_cidividers and automatic input selection, as described in [3]. 1862306a36Sopenharmony_ciThe Si5342 and Si5344 are smaller versions of the Si5345, with 2 or 4 outputs. 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciThe driver can be used in "as is" mode, reading the current settings from the 2162306a36Sopenharmony_cichip at boot, in case you have a (pre-)programmed device. If the PLL is not 2262306a36Sopenharmony_ciconfigured when the driver probes, it assumes the driver must fully initialize 2362306a36Sopenharmony_ciit. 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ciThe device type, speed grade and revision are determined runtime by probing. 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciThe driver currently does not support any fancy input configurations. They can 2862306a36Sopenharmony_cistill be programmed into the chip and the driver will leave them "as is". 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci==I2C device node== 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ciRequired properties: 3362306a36Sopenharmony_ci- compatible: shall be one of the following: 3462306a36Sopenharmony_ci "silabs,si5340" - Si5340 A/B/C/D 3562306a36Sopenharmony_ci "silabs,si5341" - Si5341 A/B/C/D 3662306a36Sopenharmony_ci "silabs,si5342" - Si5342 A/B/C/D 3762306a36Sopenharmony_ci "silabs,si5344" - Si5344 A/B/C/D 3862306a36Sopenharmony_ci "silabs,si5345" - Si5345 A/B/C/D 3962306a36Sopenharmony_ci- reg: i2c device address, usually 0x74 4062306a36Sopenharmony_ci- #clock-cells: from common clock binding; shall be set to 2. 4162306a36Sopenharmony_ci The first value is "0" for outputs, "1" for synthesizers. 4262306a36Sopenharmony_ci The second value is the output or synthesizer index. 4362306a36Sopenharmony_ci- clocks: from common clock binding; list of parent clock handles, 4462306a36Sopenharmony_ci corresponding to inputs. Use a fixed clock for the "xtal" input. 4562306a36Sopenharmony_ci At least one must be present. 4662306a36Sopenharmony_ci- clock-names: One of: "xtal", "in0", "in1", "in2" 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ciOptional properties: 4962306a36Sopenharmony_ci- vdd-supply: Regulator node for VDD 5062306a36Sopenharmony_ci- vdda-supply: Regulator node for VDDA 5162306a36Sopenharmony_ci- vdds-supply: Regulator node for VDDS 5262306a36Sopenharmony_ci- silabs,pll-m-num, silabs,pll-m-den: Numerator and denominator for PLL 5362306a36Sopenharmony_ci feedback divider. Must be such that the PLL output is in the valid range. For 5462306a36Sopenharmony_ci example, to create 14GHz from a 48MHz xtal, use m-num=14000 and m-den=48. Only 5562306a36Sopenharmony_ci the fraction matters, using 3500 and 12 will deliver the exact same result. 5662306a36Sopenharmony_ci If these are not specified, and the PLL is not yet programmed when the driver 5762306a36Sopenharmony_ci probes, the PLL will be set to 14GHz. 5862306a36Sopenharmony_ci- silabs,reprogram: When present, the driver will always assume the device must 5962306a36Sopenharmony_ci be initialized, and always performs the soft-reset routine. Since this will 6062306a36Sopenharmony_ci temporarily stop all output clocks, don't do this if the chip is generating 6162306a36Sopenharmony_ci the CPU clock for example. 6262306a36Sopenharmony_ci- silabs,xaxb-ext-clk: When present, indicates that the XA/XB pins are used 6362306a36Sopenharmony_ci in EXTCLK (external reference clock) rather than XTAL (crystal) mode. 6462306a36Sopenharmony_ci- interrupts: Interrupt for INTRb pin. 6562306a36Sopenharmony_ci- silabs,iovdd-33: When present, indicates that the I2C lines are using 3.3V 6662306a36Sopenharmony_ci rather than 1.8V thresholds. 6762306a36Sopenharmony_ci- vddoX-supply (where X is an output index): Regulator node for VDDO for the 6862306a36Sopenharmony_ci specified output. The driver selects the output VDD_SEL setting based on this 6962306a36Sopenharmony_ci voltage. 7062306a36Sopenharmony_ci- #address-cells: shall be set to 1. 7162306a36Sopenharmony_ci- #size-cells: shall be set to 0. 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci== Child nodes: Outputs == 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ciThe child nodes list the output clocks. 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ciEach of the clock outputs can be overwritten individually by using a child node. 7962306a36Sopenharmony_ciIf a child node for a clock output is not set, the configuration remains 8062306a36Sopenharmony_ciunchanged. 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ciRequired child node properties: 8362306a36Sopenharmony_ci- reg: number of clock output. 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ciOptional child node properties: 8662306a36Sopenharmony_ci- silabs,format: Output format, one of: 8762306a36Sopenharmony_ci 1 = differential (defaults to LVDS levels) 8862306a36Sopenharmony_ci 2 = low-power (defaults to HCSL levels) 8962306a36Sopenharmony_ci 4 = LVCMOS 9062306a36Sopenharmony_ci- silabs,common-mode: Manually override output common mode, see [2] for values 9162306a36Sopenharmony_ci- silabs,amplitude: Manually override output amplitude, see [2] for values 9262306a36Sopenharmony_ci- silabs,synth-master: boolean. If present, this output is allowed to change the 9362306a36Sopenharmony_ci multisynth frequency dynamically. 9462306a36Sopenharmony_ci- silabs,silabs,disable-high: boolean. If set, the clock output is driven HIGH 9562306a36Sopenharmony_ci when disabled, otherwise it's driven LOW. 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci==Example== 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci/* 48MHz reference crystal */ 10062306a36Sopenharmony_ciref48: ref48M { 10162306a36Sopenharmony_ci compatible = "fixed-clock"; 10262306a36Sopenharmony_ci #clock-cells = <0>; 10362306a36Sopenharmony_ci clock-frequency = <48000000>; 10462306a36Sopenharmony_ci}; 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_cii2c-master-node { 10762306a36Sopenharmony_ci /* Programmable clock (for logic) */ 10862306a36Sopenharmony_ci si5341: clock-generator@74 { 10962306a36Sopenharmony_ci reg = <0x74>; 11062306a36Sopenharmony_ci compatible = "silabs,si5341"; 11162306a36Sopenharmony_ci #clock-cells = <2>; 11262306a36Sopenharmony_ci #address-cells = <1>; 11362306a36Sopenharmony_ci #size-cells = <0>; 11462306a36Sopenharmony_ci clocks = <&ref48>; 11562306a36Sopenharmony_ci clock-names = "xtal"; 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci silabs,pll-m-num = <14000>; /* PLL at 14.0 GHz */ 11862306a36Sopenharmony_ci silabs,pll-m-den = <48>; 11962306a36Sopenharmony_ci silabs,reprogram; /* Chips are not programmed, always reset */ 12062306a36Sopenharmony_ci 12162306a36Sopenharmony_ci out@0 { 12262306a36Sopenharmony_ci reg = <0>; 12362306a36Sopenharmony_ci silabs,format = <1>; /* LVDS 3v3 */ 12462306a36Sopenharmony_ci silabs,common-mode = <3>; 12562306a36Sopenharmony_ci silabs,amplitude = <3>; 12662306a36Sopenharmony_ci silabs,synth-master; 12762306a36Sopenharmony_ci }; 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci /* 13062306a36Sopenharmony_ci * Output 6 configuration: 13162306a36Sopenharmony_ci * LVDS 1v8 13262306a36Sopenharmony_ci */ 13362306a36Sopenharmony_ci out@6 { 13462306a36Sopenharmony_ci reg = <6>; 13562306a36Sopenharmony_ci silabs,format = <1>; /* LVDS 1v8 */ 13662306a36Sopenharmony_ci silabs,common-mode = <13>; 13762306a36Sopenharmony_ci silabs,amplitude = <3>; 13862306a36Sopenharmony_ci }; 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci /* 14162306a36Sopenharmony_ci * Output 8 configuration: 14262306a36Sopenharmony_ci * HCSL 3v3 14362306a36Sopenharmony_ci */ 14462306a36Sopenharmony_ci out@8 { 14562306a36Sopenharmony_ci reg = <8>; 14662306a36Sopenharmony_ci silabs,format = <2>; 14762306a36Sopenharmony_ci silabs,common-mode = <11>; 14862306a36Sopenharmony_ci silabs,amplitude = <3>; 14962306a36Sopenharmony_ci }; 15062306a36Sopenharmony_ci }; 15162306a36Sopenharmony_ci}; 15262306a36Sopenharmony_ci 15362306a36Sopenharmony_cisome-video-node { 15462306a36Sopenharmony_ci /* Standard clock bindings */ 15562306a36Sopenharmony_ci clock-names = "pixel"; 15662306a36Sopenharmony_ci clocks = <&si5341 0 7>; /* Output 7 */ 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci /* Set output 7 to use syntesizer 3 as its parent */ 15962306a36Sopenharmony_ci assigned-clocks = <&si5341 0 7>, <&si5341 1 3>; 16062306a36Sopenharmony_ci assigned-clock-parents = <&si5341 1 3>; 16162306a36Sopenharmony_ci /* Set output 7 to 148.5 MHz using a synth frequency of 594 MHz */ 16262306a36Sopenharmony_ci assigned-clock-rates = <148500000>, <594000000>; 16362306a36Sopenharmony_ci}; 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_cisome-audio-node { 16662306a36Sopenharmony_ci clock-names = "i2s-clk"; 16762306a36Sopenharmony_ci clocks = <&si5341 0 0>; 16862306a36Sopenharmony_ci /* 16962306a36Sopenharmony_ci * since output 0 is a synth-master, the synth will be automatically set 17062306a36Sopenharmony_ci * to an appropriate frequency when the audio driver requests another 17162306a36Sopenharmony_ci * frequency. We give control over synth 2 to this output here. 17262306a36Sopenharmony_ci */ 17362306a36Sopenharmony_ci assigned-clocks = <&si5341 0 0>; 17462306a36Sopenharmony_ci assigned-clock-parents = <&si5341 1 2>; 17562306a36Sopenharmony_ci}; 176