diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-04-04 08:54:23 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-10 07:19:26 -0400 |
commit | 73cc9c8cac3f86ae4efebf001b68dcecc00b0017 (patch) | |
tree | ea771271a3307e73094cec11c78549b37d91ac7a /arch/unicore32 | |
parent | 7258267e56325d41f468eb650b6c23f697201645 (diff) |
cpufreq: unicore2: move cpufreq driver to drivers/cpufreq
This patch moves cpufreq driver of UNICORE-2 architecture to drivers/cpufreq.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/unicore32')
-rw-r--r-- | arch/unicore32/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/unicore32/kernel/cpu-ucv2.c | 92 |
2 files changed, 0 insertions, 93 deletions
diff --git a/arch/unicore32/kernel/Makefile b/arch/unicore32/kernel/Makefile index fa497e0efe5a..607a72f2ae35 100644 --- a/arch/unicore32/kernel/Makefile +++ b/arch/unicore32/kernel/Makefile | |||
@@ -9,7 +9,6 @@ obj-y += setup.o signal.o sys.o stacktrace.o traps.o | |||
9 | obj-$(CONFIG_MODULES) += ksyms.o module.o | 9 | obj-$(CONFIG_MODULES) += ksyms.o module.o |
10 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 10 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
11 | 11 | ||
12 | obj-$(CONFIG_CPU_FREQ) += cpu-ucv2.o | ||
13 | obj-$(CONFIG_UNICORE_FPU_F64) += fpu-ucf64.o | 12 | obj-$(CONFIG_UNICORE_FPU_F64) += fpu-ucf64.o |
14 | 13 | ||
15 | # obj-y for architecture PKUnity v3 | 14 | # obj-y for architecture PKUnity v3 |
diff --git a/arch/unicore32/kernel/cpu-ucv2.c b/arch/unicore32/kernel/cpu-ucv2.c deleted file mode 100644 index ba5a71ce2d71..000000000000 --- a/arch/unicore32/kernel/cpu-ucv2.c +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/unicore32/kernel/cpu-ucv2.c: clock scaling for the UniCore-II | ||
3 | * | ||
4 | * Code specific to PKUnity SoC and UniCore ISA | ||
5 | * | ||
6 | * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn> | ||
7 | * Copyright (C) 2001-2010 Guan Xuetao | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/clk.h> | ||
18 | #include <linux/cpufreq.h> | ||
19 | |||
20 | #include <mach/hardware.h> | ||
21 | |||
22 | static struct cpufreq_driver ucv2_driver; | ||
23 | |||
24 | /* make sure that only the "userspace" governor is run | ||
25 | * -- anything else wouldn't make sense on this platform, anyway. | ||
26 | */ | ||
27 | int ucv2_verify_speed(struct cpufreq_policy *policy) | ||
28 | { | ||
29 | if (policy->cpu) | ||
30 | return -EINVAL; | ||
31 | |||
32 | cpufreq_verify_within_limits(policy, | ||
33 | policy->cpuinfo.min_freq, policy->cpuinfo.max_freq); | ||
34 | |||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | static unsigned int ucv2_getspeed(unsigned int cpu) | ||
39 | { | ||
40 | struct clk *mclk = clk_get(NULL, "MAIN_CLK"); | ||
41 | |||
42 | if (cpu) | ||
43 | return 0; | ||
44 | return clk_get_rate(mclk)/1000; | ||
45 | } | ||
46 | |||
47 | static int ucv2_target(struct cpufreq_policy *policy, | ||
48 | unsigned int target_freq, | ||
49 | unsigned int relation) | ||
50 | { | ||
51 | unsigned int cur = ucv2_getspeed(0); | ||
52 | struct cpufreq_freqs freqs; | ||
53 | struct clk *mclk = clk_get(NULL, "MAIN_CLK"); | ||
54 | |||
55 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | ||
56 | |||
57 | if (!clk_set_rate(mclk, target_freq * 1000)) { | ||
58 | freqs.old = cur; | ||
59 | freqs.new = target_freq; | ||
60 | } | ||
61 | |||
62 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | ||
63 | |||
64 | return 0; | ||
65 | } | ||
66 | |||
67 | static int __init ucv2_cpu_init(struct cpufreq_policy *policy) | ||
68 | { | ||
69 | if (policy->cpu != 0) | ||
70 | return -EINVAL; | ||
71 | policy->cur = ucv2_getspeed(0); | ||
72 | policy->min = policy->cpuinfo.min_freq = 250000; | ||
73 | policy->max = policy->cpuinfo.max_freq = 1000000; | ||
74 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | ||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | static struct cpufreq_driver ucv2_driver = { | ||
79 | .flags = CPUFREQ_STICKY, | ||
80 | .verify = ucv2_verify_speed, | ||
81 | .target = ucv2_target, | ||
82 | .get = ucv2_getspeed, | ||
83 | .init = ucv2_cpu_init, | ||
84 | .name = "UniCore-II", | ||
85 | }; | ||
86 | |||
87 | static int __init ucv2_cpufreq_init(void) | ||
88 | { | ||
89 | return cpufreq_register_driver(&ucv2_driver); | ||
90 | } | ||
91 | |||
92 | arch_initcall(ucv2_cpufreq_init); | ||