18c2ecf20Sopenharmony_ciBinding for a type of flexgen structure found on certain
28c2ecf20Sopenharmony_ciSTMicroelectronics consumer electronics SoC devices
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ciThis structure includes:
58c2ecf20Sopenharmony_ci- a clock cross bar (represented by a mux element)
68c2ecf20Sopenharmony_ci- a pre and final dividers (represented by a divider and gate elements)
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciFlexgen structure is a part of Clockgen[1].
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciPlease find an example below:
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci    Clockgen block diagram
138c2ecf20Sopenharmony_ci    -------------------------------------------------------------------
148c2ecf20Sopenharmony_ci   |                     Flexgen structure                             |
158c2ecf20Sopenharmony_ci   |                  ---------------------------------------------    |
168c2ecf20Sopenharmony_ci   |                 |    -------       --------       --------    |   |
178c2ecf20Sopenharmony_ciclk_sysin            |   |       |     |        |     |        |   |   |
188c2ecf20Sopenharmony_ci---|-----------------|-->|       |     |        |     |        |   |   |
198c2ecf20Sopenharmony_ci   | |               |   |       |     |        |     |        |   |   |
208c2ecf20Sopenharmony_ci   | |   -------     |   |       |     |Pre     |     |Final   |   |   |
218c2ecf20Sopenharmony_ci   | |  |PLL0   |    |   |       |     |Dividers|     |Dividers|   |   |
228c2ecf20Sopenharmony_ci   | |->|       |    |   |       |     |  x32   |     |  x32   |   |   |
238c2ecf20Sopenharmony_ci   | |  |  odf_0|----|-->|       |     |        |     |        |   |   |
248c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
258c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
268c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
278c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
288c2ecf20Sopenharmony_ci   | |   -------     |   |       |     |        |     |        |   |   |
298c2ecf20Sopenharmony_ci   | |               |   |       |     |        |     |        |   |   |
308c2ecf20Sopenharmony_ci   | |   -------     |   | Clock |     |        |     |        |   |   |
318c2ecf20Sopenharmony_ci   | |  |PLL1   |    |   |       |     |        |     |        |   |   |
328c2ecf20Sopenharmony_ci   | |->|       |    |   | Cross |     |        |     |        |   |   |
338c2ecf20Sopenharmony_ci   | |  |  odf_0|----|-->|       |     |        |     |        | CLK_DIV[31:0]
348c2ecf20Sopenharmony_ci   | |  |       |    |   | Bar   |====>|        |====>|        |===|=========>
358c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
368c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
378c2ecf20Sopenharmony_ci   | |  |       |    |   |       |     |        |     |        |   |   |
388c2ecf20Sopenharmony_ci   | |   -------     |   |       |     |        |     |        |   |   |
398c2ecf20Sopenharmony_ci   | |               |   |       |     |        |     |        |   |   |
408c2ecf20Sopenharmony_ci   | |   -------     |   |       |     |        |     |        |   |   |
418c2ecf20Sopenharmony_ci   | |  |QUADFS |    |   |       |     |        |     |        |   |   |
428c2ecf20Sopenharmony_ci   | |->|    ch0|----|-->|       |     |        |     |        |   |   |
438c2ecf20Sopenharmony_ci   |    |       |    |   |       |     |        |     |        |   |   |
448c2ecf20Sopenharmony_ci   |    |    ch1|----|-->|       |     |        |     |        |   |   |
458c2ecf20Sopenharmony_ci   |    |       |    |   |       |     |        |     |        |   |   |
468c2ecf20Sopenharmony_ci   |    |    ch2|----|-->|       |     | DIV    |     | DIV    |   |   |
478c2ecf20Sopenharmony_ci   |    |       |    |   |       |     |  1 to  |     |  1 to  |   |   |
488c2ecf20Sopenharmony_ci   |    |    ch3|----|-->|       |     |   1024 |     |     64 |   |   |
498c2ecf20Sopenharmony_ci   |     -------     |   |       |     |        |     |        |   |   |
508c2ecf20Sopenharmony_ci   |                 |    -------       --------       --------    |   |
518c2ecf20Sopenharmony_ci   |                   --------------------------------------------    |
528c2ecf20Sopenharmony_ci   |                                                                   |
538c2ecf20Sopenharmony_ci    -------------------------------------------------------------------
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciThis binding uses the common clock binding[2].
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci[1] Documentation/devicetree/bindings/clock/st/st,clkgen.txt
588c2ecf20Sopenharmony_ci[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciRequired properties:
618c2ecf20Sopenharmony_ci- compatible : shall be:
628c2ecf20Sopenharmony_ci  "st,flexgen"
638c2ecf20Sopenharmony_ci  "st,flexgen-audio", "st,flexgen" (enable clock propagation on parent for
648c2ecf20Sopenharmony_ci  audio use case)
658c2ecf20Sopenharmony_ci  "st,flexgen-video", "st,flexgen" (enable clock propagation on parent
668c2ecf20Sopenharmony_ci					and activate synchronous mode)
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci- #clock-cells : from common clock binding; shall be set to 1 (multiple clock
698c2ecf20Sopenharmony_ci  outputs).
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci- clocks : must be set to the parent's phandle. it's could be output clocks of
728c2ecf20Sopenharmony_ci  a quadsfs or/and a pll or/and clk_sysin (up to 7 clocks)
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci- clock-output-names : List of strings used to name the clock outputs.
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ciExample:
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci	clk_s_c0_flexgen: clk-s-c0-flexgen {
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci		#clock-cells = <1>;
818c2ecf20Sopenharmony_ci		compatible = "st,flexgen";
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci		clocks = <&clk_s_c0_pll0 0>,
848c2ecf20Sopenharmony_ci			 <&clk_s_c0_pll1 0>,
858c2ecf20Sopenharmony_ci			 <&clk_s_c0_quadfs 0>,
868c2ecf20Sopenharmony_ci			 <&clk_s_c0_quadfs 1>,
878c2ecf20Sopenharmony_ci			 <&clk_s_c0_quadfs 2>,
888c2ecf20Sopenharmony_ci			 <&clk_s_c0_quadfs 3>,
898c2ecf20Sopenharmony_ci			 <&clk_sysin>;
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci		clock-output-names = "clk-icn-gpu",
928c2ecf20Sopenharmony_ci				     "clk-fdma",
938c2ecf20Sopenharmony_ci				     "clk-nand",
948c2ecf20Sopenharmony_ci				     "clk-hva",
958c2ecf20Sopenharmony_ci				     "clk-proc-stfe",
968c2ecf20Sopenharmony_ci				     "clk-proc-tp",
978c2ecf20Sopenharmony_ci				     "clk-rx-icn-dmu",
988c2ecf20Sopenharmony_ci				     "clk-rx-icn-hva",
998c2ecf20Sopenharmony_ci				     "clk-icn-cpu",
1008c2ecf20Sopenharmony_ci				     "clk-tx-icn-dmu",
1018c2ecf20Sopenharmony_ci				     "clk-mmc-0",
1028c2ecf20Sopenharmony_ci				     "clk-mmc-1",
1038c2ecf20Sopenharmony_ci				     "clk-jpegdec",
1048c2ecf20Sopenharmony_ci				     "clk-ext2fa9",
1058c2ecf20Sopenharmony_ci				     "clk-ic-bdisp-0",
1068c2ecf20Sopenharmony_ci				     "clk-ic-bdisp-1",
1078c2ecf20Sopenharmony_ci				     "clk-pp-dmu",
1088c2ecf20Sopenharmony_ci				     "clk-vid-dmu",
1098c2ecf20Sopenharmony_ci				     "clk-dss-lpc",
1108c2ecf20Sopenharmony_ci				     "clk-st231-aud-0",
1118c2ecf20Sopenharmony_ci				     "clk-st231-gp-1",
1128c2ecf20Sopenharmony_ci				     "clk-st231-dmu",
1138c2ecf20Sopenharmony_ci				     "clk-icn-lmi",
1148c2ecf20Sopenharmony_ci				     "clk-tx-icn-disp-1",
1158c2ecf20Sopenharmony_ci				     "clk-icn-sbc",
1168c2ecf20Sopenharmony_ci				     "clk-stfe-frc2",
1178c2ecf20Sopenharmony_ci				     "clk-eth-phy",
1188c2ecf20Sopenharmony_ci				     "clk-eth-ref-phyclk",
1198c2ecf20Sopenharmony_ci				     "clk-flash-promip",
1208c2ecf20Sopenharmony_ci				     "clk-main-disp",
1218c2ecf20Sopenharmony_ci				     "clk-aux-disp",
1228c2ecf20Sopenharmony_ci				     "clk-compo-dvp";
1238c2ecf20Sopenharmony_ci	};
124