18c2ecf20Sopenharmony_ci* Exynos5422 frequency and voltage scaling for Dynamic Memory Controller device
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe Samsung Exynos5422 SoC has DMC (Dynamic Memory Controller) to which the DRAM
48c2ecf20Sopenharmony_cimemory chips are connected. The driver is to monitor the controller in runtime
58c2ecf20Sopenharmony_ciand switch frequency and voltage. To monitor the usage of the controller in
68c2ecf20Sopenharmony_ciruntime, the driver uses the PPMU (Platform Performance Monitoring Unit), which
78c2ecf20Sopenharmony_ciis able to measure the current load of the memory.
88c2ecf20Sopenharmony_ciWhen 'userspace' governor is used for the driver, an application is able to
98c2ecf20Sopenharmony_ciswitch the DMC and memory frequency.
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciRequired properties for DMC device for Exynos5422:
128c2ecf20Sopenharmony_ci- compatible: Should be "samsung,exynos5422-dmc".
138c2ecf20Sopenharmony_ci- clocks : list of clock specifiers, must contain an entry for each
148c2ecf20Sopenharmony_ci  required entry in clock-names for CLK_FOUT_SPLL, CLK_MOUT_SCLK_SPLL,
158c2ecf20Sopenharmony_ci  CLK_FF_DOUT_SPLL2, CLK_FOUT_BPLL, CLK_MOUT_BPLL, CLK_SCLK_BPLL,
168c2ecf20Sopenharmony_ci  CLK_MOUT_MX_MSPLL_CCORE, CLK_MOUT_MX_MSPLL_CCORE_PHY, CLK_MOUT_MCLK_CDREX,
178c2ecf20Sopenharmony_ci- clock-names : should include "fout_spll", "mout_sclk_spll", "ff_dout_spll2",
188c2ecf20Sopenharmony_ci  "fout_bpll", "mout_bpll", "sclk_bpll", "mout_mx_mspll_ccore",
198c2ecf20Sopenharmony_ci  "mout_mclk_cdrex"  entries
208c2ecf20Sopenharmony_ci- devfreq-events : phandles for PPMU devices connected to this DMC.
218c2ecf20Sopenharmony_ci- vdd-supply : phandle for voltage regulator which is connected.
228c2ecf20Sopenharmony_ci- reg : registers of two CDREX controllers.
238c2ecf20Sopenharmony_ci- operating-points-v2 : phandle for OPPs described in v2 definition.
248c2ecf20Sopenharmony_ci- device-handle : phandle of the connected DRAM memory device. For more
258c2ecf20Sopenharmony_ci	information please refer to documentation file:
268c2ecf20Sopenharmony_ci	Documentation/devicetree/bindings/ddr/lpddr3.txt
278c2ecf20Sopenharmony_ci- devfreq-events : phandles of the PPMU events used by the controller.
288c2ecf20Sopenharmony_ci- samsung,syscon-clk : phandle of the clock register set used by the controller,
298c2ecf20Sopenharmony_ci	these registers are used for enabling a 'pause' feature and are not
308c2ecf20Sopenharmony_ci	exposed by clock framework but they must be used in a safe way.
318c2ecf20Sopenharmony_ci	The register offsets are in the driver code and specyfic for this SoC
328c2ecf20Sopenharmony_ci	type.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciOptional properties for DMC device for Exynos5422:
358c2ecf20Sopenharmony_ci- interrupt-parent : The parent interrupt controller.
368c2ecf20Sopenharmony_ci- interrupts : Contains the IRQ line numbers for the DMC internal performance
378c2ecf20Sopenharmony_ci  event counters in DREX0 and DREX1 channels. Align with specification of the
388c2ecf20Sopenharmony_ci  interrupt line(s) in the interrupt-parent controller.
398c2ecf20Sopenharmony_ci- interrupt-names : IRQ names "drex_0" and "drex_1", the order should be the
408c2ecf20Sopenharmony_ci  same as in the 'interrupts' list above.
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ciExample:
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci	ppmu_dmc0_0: ppmu@10d00000 {
458c2ecf20Sopenharmony_ci		compatible = "samsung,exynos-ppmu";
468c2ecf20Sopenharmony_ci		reg = <0x10d00000 0x2000>;
478c2ecf20Sopenharmony_ci		clocks = <&clock CLK_PCLK_PPMU_DREX0_0>;
488c2ecf20Sopenharmony_ci		clock-names = "ppmu";
498c2ecf20Sopenharmony_ci		events {
508c2ecf20Sopenharmony_ci			ppmu_event_dmc0_0: ppmu-event3-dmc0_0 {
518c2ecf20Sopenharmony_ci				event-name = "ppmu-event3-dmc0_0";
528c2ecf20Sopenharmony_ci			};
538c2ecf20Sopenharmony_ci		};
548c2ecf20Sopenharmony_ci	};
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci	dmc: memory-controller@10c20000 {
578c2ecf20Sopenharmony_ci		compatible = "samsung,exynos5422-dmc";
588c2ecf20Sopenharmony_ci		reg = <0x10c20000 0x10000>, <0x10c30000 0x10000>;
598c2ecf20Sopenharmony_ci		clocks = <&clock CLK_FOUT_SPLL>,
608c2ecf20Sopenharmony_ci			 <&clock CLK_MOUT_SCLK_SPLL>,
618c2ecf20Sopenharmony_ci			 <&clock CLK_FF_DOUT_SPLL2>,
628c2ecf20Sopenharmony_ci			 <&clock CLK_FOUT_BPLL>,
638c2ecf20Sopenharmony_ci			 <&clock CLK_MOUT_BPLL>,
648c2ecf20Sopenharmony_ci			 <&clock CLK_SCLK_BPLL>,
658c2ecf20Sopenharmony_ci			 <&clock CLK_MOUT_MX_MSPLL_CCORE>,
668c2ecf20Sopenharmony_ci			 <&clock CLK_MOUT_MCLK_CDREX>;
678c2ecf20Sopenharmony_ci		clock-names = "fout_spll",
688c2ecf20Sopenharmony_ci			      "mout_sclk_spll",
698c2ecf20Sopenharmony_ci			      "ff_dout_spll2",
708c2ecf20Sopenharmony_ci			      "fout_bpll",
718c2ecf20Sopenharmony_ci			      "mout_bpll",
728c2ecf20Sopenharmony_ci			      "sclk_bpll",
738c2ecf20Sopenharmony_ci			      "mout_mx_mspll_ccore",
748c2ecf20Sopenharmony_ci			      "mout_mclk_cdrex";
758c2ecf20Sopenharmony_ci		operating-points-v2 = <&dmc_opp_table>;
768c2ecf20Sopenharmony_ci		devfreq-events = <&ppmu_event3_dmc0_0>,	<&ppmu_event3_dmc0_1>,
778c2ecf20Sopenharmony_ci				 <&ppmu_event3_dmc1_0>, <&ppmu_event3_dmc1_1>;
788c2ecf20Sopenharmony_ci		device-handle = <&samsung_K3QF2F20DB>;
798c2ecf20Sopenharmony_ci		vdd-supply = <&buck1_reg>;
808c2ecf20Sopenharmony_ci		samsung,syscon-clk = <&clock>;
818c2ecf20Sopenharmony_ci		interrupt-parent = <&combiner>;
828c2ecf20Sopenharmony_ci		interrupts = <16 0>, <16 1>;
838c2ecf20Sopenharmony_ci		interrupt-names = "drex_0", "drex_1";
848c2ecf20Sopenharmony_ci	};
85