18c2ecf20Sopenharmony_ciDevice Tree Clock bindings for APM X-Gene
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis binding uses the common clock binding[1].
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciRequired properties:
88c2ecf20Sopenharmony_ci- compatible : shall be one of the following:
98c2ecf20Sopenharmony_ci	"apm,xgene-socpll-clock" - for a X-Gene SoC PLL clock
108c2ecf20Sopenharmony_ci	"apm,xgene-pcppll-clock" - for a X-Gene PCP PLL clock
118c2ecf20Sopenharmony_ci	"apm,xgene-pmd-clock" - for a X-Gene PMD clock
128c2ecf20Sopenharmony_ci	"apm,xgene-device-clock" - for a X-Gene device clock
138c2ecf20Sopenharmony_ci	"apm,xgene-socpll-v2-clock" - for a X-Gene SoC PLL v2 clock
148c2ecf20Sopenharmony_ci	"apm,xgene-pcppll-v2-clock" - for a X-Gene PCP PLL v2 clock
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ciRequired properties for SoC or PCP PLL clocks:
178c2ecf20Sopenharmony_ci- reg : shall be the physical PLL register address for the pll clock.
188c2ecf20Sopenharmony_ci- clocks : shall be the input parent clock phandle for the clock. This should
198c2ecf20Sopenharmony_ci	be the reference clock.
208c2ecf20Sopenharmony_ci- #clock-cells : shall be set to 1.
218c2ecf20Sopenharmony_ci- clock-output-names : shall be the name of the PLL referenced by derive
228c2ecf20Sopenharmony_ci  clock.
238c2ecf20Sopenharmony_ciOptional properties for PLL clocks:
248c2ecf20Sopenharmony_ci- clock-names : shall be the name of the PLL. If missing, use the device name.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ciRequired properties for PMD clocks:
278c2ecf20Sopenharmony_ci- reg : shall be the physical register address for the pmd clock.
288c2ecf20Sopenharmony_ci- clocks : shall be the input parent clock phandle for the clock.
298c2ecf20Sopenharmony_ci- #clock-cells : shall be set to 1.
308c2ecf20Sopenharmony_ci- clock-output-names : shall be the name of the clock referenced by derive
318c2ecf20Sopenharmony_ci  clock.
328c2ecf20Sopenharmony_ciOptional properties for PLL clocks:
338c2ecf20Sopenharmony_ci- clock-names : shall be the name of the clock. If missing, use the device name.
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciRequired properties for device clocks:
368c2ecf20Sopenharmony_ci- reg : shall be a list of address and length pairs describing the CSR
378c2ecf20Sopenharmony_ci         reset and/or the divider. Either may be omitted, but at least
388c2ecf20Sopenharmony_ci         one must be present.
398c2ecf20Sopenharmony_ci - reg-names : shall be a string list describing the reg resource. This
408c2ecf20Sopenharmony_ci               may include "csr-reg" and/or "div-reg". If this property
418c2ecf20Sopenharmony_ci               is not present, the reg property is assumed to describe
428c2ecf20Sopenharmony_ci               only "csr-reg".
438c2ecf20Sopenharmony_ci- clocks : shall be the input parent clock phandle for the clock.
448c2ecf20Sopenharmony_ci- #clock-cells : shall be set to 1.
458c2ecf20Sopenharmony_ci- clock-output-names : shall be the name of the device referenced.
468c2ecf20Sopenharmony_ciOptional properties for device clocks:
478c2ecf20Sopenharmony_ci- clock-names : shall be the name of the device clock. If missing, use the
488c2ecf20Sopenharmony_ci                device name.
498c2ecf20Sopenharmony_ci- csr-offset : Offset to the CSR reset register from the reset address base.
508c2ecf20Sopenharmony_ci               Default is 0.
518c2ecf20Sopenharmony_ci- csr-mask : CSR reset mask bit. Default is 0xF.
528c2ecf20Sopenharmony_ci- enable-offset : Offset to the enable register from the reset address base.
538c2ecf20Sopenharmony_ci                  Default is 0x8.
548c2ecf20Sopenharmony_ci- enable-mask : CSR enable mask bit. Default is 0xF.
558c2ecf20Sopenharmony_ci- divider-offset : Offset to the divider CSR register from the divider base.
568c2ecf20Sopenharmony_ci                   Default is 0x0.
578c2ecf20Sopenharmony_ci- divider-width : Width of the divider register. Default is 0.
588c2ecf20Sopenharmony_ci- divider-shift : Bit shift of the divider register. Default is 0.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciFor example:
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci	pcppll: pcppll@17000100 {
638c2ecf20Sopenharmony_ci		compatible = "apm,xgene-pcppll-clock";
648c2ecf20Sopenharmony_ci		#clock-cells = <1>;
658c2ecf20Sopenharmony_ci		clocks = <&refclk 0>;
668c2ecf20Sopenharmony_ci		clock-names = "pcppll";
678c2ecf20Sopenharmony_ci		reg = <0x0 0x17000100 0x0 0x1000>;
688c2ecf20Sopenharmony_ci		clock-output-names = "pcppll";
698c2ecf20Sopenharmony_ci		type = <0>;
708c2ecf20Sopenharmony_ci	};
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci	pmd0clk: pmd0clk@7e200200 {
738c2ecf20Sopenharmony_ci		compatible = "apm,xgene-pmd-clock";
748c2ecf20Sopenharmony_ci		#clock-cells = <1>;
758c2ecf20Sopenharmony_ci		clocks = <&pmdpll 0>;
768c2ecf20Sopenharmony_ci		reg = <0x0 0x7e200200 0x0 0x10>;
778c2ecf20Sopenharmony_ci		clock-output-names = "pmd0clk";
788c2ecf20Sopenharmony_ci	};
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci	socpll: socpll@17000120 {
818c2ecf20Sopenharmony_ci		compatible = "apm,xgene-socpll-clock";
828c2ecf20Sopenharmony_ci		#clock-cells = <1>;
838c2ecf20Sopenharmony_ci		clocks = <&refclk 0>;
848c2ecf20Sopenharmony_ci		clock-names = "socpll";
858c2ecf20Sopenharmony_ci		reg = <0x0 0x17000120 0x0 0x1000>;
868c2ecf20Sopenharmony_ci		clock-output-names = "socpll";
878c2ecf20Sopenharmony_ci		type = <1>;
888c2ecf20Sopenharmony_ci	};
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci	qmlclk: qmlclk {
918c2ecf20Sopenharmony_ci		compatible = "apm,xgene-device-clock";
928c2ecf20Sopenharmony_ci		#clock-cells = <1>;
938c2ecf20Sopenharmony_ci		clocks = <&socplldiv2 0>;
948c2ecf20Sopenharmony_ci		clock-names = "qmlclk";
958c2ecf20Sopenharmony_ci		reg = <0x0 0x1703C000 0x0 0x1000>;
968c2ecf20Sopenharmony_ci		reg-name = "csr-reg";
978c2ecf20Sopenharmony_ci		clock-output-names = "qmlclk";
988c2ecf20Sopenharmony_ci	};
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci	ethclk: ethclk {
1018c2ecf20Sopenharmony_ci		compatible = "apm,xgene-device-clock";
1028c2ecf20Sopenharmony_ci		#clock-cells = <1>;
1038c2ecf20Sopenharmony_ci		clocks = <&socplldiv2 0>;
1048c2ecf20Sopenharmony_ci		clock-names = "ethclk";
1058c2ecf20Sopenharmony_ci		reg = <0x0 0x17000000 0x0 0x1000>;
1068c2ecf20Sopenharmony_ci		reg-names = "div-reg";
1078c2ecf20Sopenharmony_ci		divider-offset = <0x238>;
1088c2ecf20Sopenharmony_ci		divider-width = <0x9>;
1098c2ecf20Sopenharmony_ci		divider-shift = <0x0>;
1108c2ecf20Sopenharmony_ci		clock-output-names = "ethclk";
1118c2ecf20Sopenharmony_ci	};
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	apbclk: apbclk {
1148c2ecf20Sopenharmony_ci		compatible = "apm,xgene-device-clock";
1158c2ecf20Sopenharmony_ci		#clock-cells = <1>;
1168c2ecf20Sopenharmony_ci		clocks = <&ahbclk 0>;
1178c2ecf20Sopenharmony_ci		clock-names = "apbclk";
1188c2ecf20Sopenharmony_ci		reg = <0x0 0x1F2AC000 0x0 0x1000
1198c2ecf20Sopenharmony_ci			0x0 0x1F2AC000 0x0 0x1000>;
1208c2ecf20Sopenharmony_ci		reg-names = "csr-reg", "div-reg";
1218c2ecf20Sopenharmony_ci		csr-offset = <0x0>;
1228c2ecf20Sopenharmony_ci		csr-mask = <0x200>;
1238c2ecf20Sopenharmony_ci		enable-offset = <0x8>;
1248c2ecf20Sopenharmony_ci		enable-mask = <0x200>;
1258c2ecf20Sopenharmony_ci		divider-offset = <0x10>;
1268c2ecf20Sopenharmony_ci		divider-width = <0x2>;
1278c2ecf20Sopenharmony_ci		divider-shift = <0x0>;
1288c2ecf20Sopenharmony_ci		flags = <0x8>;
1298c2ecf20Sopenharmony_ci		clock-output-names = "apbclk";
1308c2ecf20Sopenharmony_ci	};
1318c2ecf20Sopenharmony_ci
132