kernel_optimize_test/drivers/clk/mvebu
Thomas Petazzoni ee2d8ea1e9 clk: mvebu: extend clk-cpu for dynamic frequency scaling
This commit extends the existing clk-cpu driver used on Marvell Armada
XP platforms to support the dynamic frequency scaling of the CPU
clock. Non-dynamic frequency change was already supported (and used
before secondary CPUs are started), but the dynamic frequency change
requires a completely different procedure.

In order to achieve this, the clk_cpu_set_rate() function is reworked
to handle two separate cases:

 - The case where the clock is enabled, which is the new dynamic
   frequency change code, implemented in clk_cpu_on_set_rate(). This
   part will be used for cpufreq activities.

 - The case where the clock is disabled, which is the existing
   frequency change code, moved in clk_cpu_off_set_rate(). This part
   is already used to set the clock frequency of the secondary CPUs
   before starting them.

In order to implement the dynamic frequency change function, we need
to access the PMU DFS registers, which are outside the currently
mapped "Clock Complex" registers, so a new area of registers is now
mapped. This affects the Device Tree binding, but we are careful to do
it in a backward-compatible way (by allowing the second pair of
registers to be non-existent, and in this case, ensuring
clk_cpu_on_set_rate() returns an error).

Note that technically speaking, the clk_cpu_on_set_rate() does not do
the entire procedure needed to change the frequency dynamically, as it
involves touching a number of PMSU registers. This is done through a
clock notifier registered by the PMSU driver in followup commits.

Cc: <devicetree@vger.kernel.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1404920715-19834-4-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2014-07-16 12:58:38 +00:00
..
armada-38x.c clk: mvebu: add clock support for Armada 380/385 2014-02-17 02:34:05 +00:00
armada-370.c clk: mvebu: armada-370: maintain clock init order 2014-02-06 18:06:28 +00:00
armada-375.c clk: mvebu: add clock support for Armada 375 2014-02-17 02:34:01 +00:00
armada-xp.c clk: mvebu: armada-xp: maintain clock init order 2014-02-06 18:06:50 +00:00
clk-corediv.c clk: mvebu: Support Armada 380 SoC on the core divider clock 2014-03-13 23:24:23 +00:00
clk-cpu.c clk: mvebu: extend clk-cpu for dynamic frequency scaling 2014-07-16 12:58:38 +00:00
common.c clk: mvebu: add missing iounmap 2013-08-23 11:44:03 -07:00
common.h clk: mvebu: add common clock functions for core clk and clk gating 2013-05-29 19:20:22 +00:00
dove.c clk: mvebu: dove: maintain clock init order 2014-02-06 18:06:52 +00:00
Kconfig clk: mvebu: add Orion5x clock driver 2014-04-26 01:03:55 +00:00
kirkwood.c clk: mvebu: kirkwood: maintain clock init order 2014-02-06 18:07:01 +00:00
Makefile clk: mvebu: add Orion5x clock driver 2014-04-26 01:03:55 +00:00
orion.c clk: mvebu: add Orion5x clock driver 2014-04-26 01:03:55 +00:00