summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-07-20 14:41:45 +0200
committerKoen Kooi <koen@dominion.thruhere.net>2011-07-20 14:41:45 +0200
commite125e989fafda1faf6d3f5dc33e949cd7d4b5a97 (patch)
tree5359f8bbfa60493160ef883083f863fce5ea2fb4 /recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
parent7018fe0a81fa33c6d73d6296d25517b5d427d0a7 (diff)
downloadmeta-ti-e125e989fafda1faf6d3f5dc33e949cd7d4b5a97.tar.gz
linux 3.0: initial recipe that will track 3.0rc till 3.0 final
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch')
-rw-r--r--recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch264
1 files changed, 264 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
new file mode 100644
index 00000000..c490a1de
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
@@ -0,0 +1,264 @@
1From afa9b062a33a9d9d2d9077cc519e1375b8338e39 Mon Sep 17 00:00:00 2001
2From: Rajendra Nayak <rnayak@ti.com>
3Date: Mon, 10 Nov 2008 17:00:25 +0530
4Subject: [PATCH 04/19] OMAP3 PM: CPUFreq driver for OMAP3
5
6CPUFreq driver for OMAP3
7
8With additional fixes and cleanups from Tero Kristo:
9- Fix rate calculation bug in omap3_select_table_rate
10- Refreshed DVFS VDD1 control against latest clock fw
11
12Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
13Signed-off-by: Rajendra Nayak <rnayak@ti.com>
14
15OMAP3: PM: CPUFreq: Fix omap_getspeed.
16
17Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
18
19Make sure omap cpufreq driver initializes after cpufreq framework and governors
20
21Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
22
23merge: CPUFreq: remove obsolete funcs
24
25OMAP3 clock: Update cpufreq driver
26
27This patch removes all refrences to virtual clock
28nodes in CPUFreq driver.
29
30Signed-off-by: Rajendra Nayak <rnayak@ti.com>
31Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
32Signed-off-by: Jean Pihet <jpihet@mvista.com>
33
34PM: Prevent direct cpufreq scaling during initialization
35
36It is seen that the OMAP specific cpufreq initialization code tries to
37scale the MPU frequency to the highest possible without taking care of
38the voltage level. On power on reset the power IC does not provide the
39necessary voltage for the highest available MPU frequency (that would
40satisfy all Si families). This potentially is an window of opportunity
41for things to go wrong.
42
43Signed-off-by: Romit Dasgupta <romit@ti.com>
44Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
45
46OMAP3: PM: enable 600MHz (overdrive) OPP
47
48Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
49
50omap3: introduce cpufreq
51
52OMAP OPP layer functions now have dependencies of CONFIG_CPU_FREQ only.
53
54With this patch, omap opp layer now has its compilation flags
55bound to CONFIG_CPU_FREQ. Also its code has been removed from pm34xx.c.
56
57A new file has been created to contain cpu freq code related to
58OMAP3: cpufreq34xx.c
59
60OMAP34xx and OMAP36xx family OPPs are made available
61
62Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
63Signed-off-by: Paul Walmsley <paul@pwsan.com>
64Signed-off-by: Nishanth Menon <nm@ti.com>
65Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
66Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
67Signed-off-by: Romit Dasgupta <romit@ti.com>
68Signed-off-by: Rajendra Nayak <rnayak@ti.com>
69
70omap3: cpufreq: allow default opp table init
71
72For board files which choose to override the defaults, the existing
73mechanism will work, for boards that would like to work with defaults,
74allow init_common_hw to call init_opp_table to initialize if not
75already initialized. this will allow all omap boards which have opp
76tables predefined for a silicon to use the same.
77
78Originally reported for overo:
79http://marc.info/?t=127265269400004&r=1&w=2
80
81Signed-off-by: Nishanth Menon <nm@ti.com>
82Reported-by: Peter Tseng <tsenpet09@gmail.com>
83Cc: Cliff Brake <cliff.brake@gmail.com>
84Cc: Kevin Hilman <khilman@deeprootsystems.com>
85
86OMAP2: update OPP data to be device based
87
88Cc: Nishanth Menon <nm@ti.com>
89Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
90
91OMAP3: CPUfreq: update to device-based OPP API
92
93Update usage of OPP API to use new device-based API. This requires
94getting the 'struct device' for the MPU and using that with the OPP
95API.
96
97Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
98
99omap3: opp: make independent of cpufreq
100
101Make opp3xx data which is registered with the opp layer
102dependent purely on CONFIG_PM as opp layer and pm.c users
103are CONFIG_PM dependent not cpufreq dependent.
104so we rename the data definition to opp3xxx_data.c (inline with what
105we have for omap2), also move the build definition to be under
106the existing CONFIG_PM build instead of CPUFREQ.
107
108Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
109Cc: Kevin Hilman <khilman@deeprootsystems.com>
110Cc: Paul Walmsley <paul@pwsan.com>
111Cc: Rajendra Nayak <rnayak@ti.com>
112Cc: Sanjeev Premi <premi@ti.com>
113Cc: Thara Gopinath <thara@ti.com>
114Cc: Tony Lindgren <tony@atomide.com>
115
116Signed-off-by: Nishanth Menon <nm@ti.com>
117Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
118---
119 arch/arm/mach-omap2/clock.h | 14 +++++++++++++-
120 arch/arm/mach-omap2/clock34xx.c | 2 ++
121 arch/arm/plat-omap/cpu-omap.c | 34 +++++++++++++++++++++++++++++++---
122 3 files changed, 46 insertions(+), 4 deletions(-)
123
124diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
125index e10ff2b..0a07e50 100644
126--- a/arch/arm/mach-omap2/clock.h
127+++ b/arch/arm/mach-omap2/clock.h
128@@ -141,7 +141,9 @@ extern const struct clksel_rate gpt_sys_rates[];
129 extern const struct clksel_rate gfx_l3_rates[];
130 extern const struct clksel_rate dsp_ick_rates[];
131
132-#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ)
133+#ifdef CONFIG_CPU_FREQ
134+
135+#ifdef CONFIG_ARCH_OMAP2
136 extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
137 extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
138 #else
139@@ -149,6 +151,16 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
140 #define omap2_clk_exit_cpufreq_table 0
141 #endif
142
143+#ifdef CONFIG_ARCH_OMAP3
144+extern void omap3_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
145+extern void omap3_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
146+#else
147+#define omap3_clk_init_cpufreq_table 0
148+#define omap3_clk_exit_cpufreq_table 0
149+#endif
150+
151+#endif /* CONFIG_CPU_FREQ */
152+
153 extern const struct clkops clkops_omap2_iclk_dflt_wait;
154 extern const struct clkops clkops_omap2_iclk_dflt;
155 extern const struct clkops clkops_omap2_iclk_idle_only;
156diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
157index 1fc96b9..119e135 100644
158--- a/arch/arm/mach-omap2/clock34xx.c
159+++ b/arch/arm/mach-omap2/clock34xx.c
160@@ -20,6 +20,8 @@
161 #include <linux/kernel.h>
162 #include <linux/clk.h>
163 #include <linux/io.h>
164+#include <linux/err.h>
165+#include <linux/cpufreq.h>
166
167 #include <plat/clock.h>
168
169diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
170index 1b36664..f0f9430 100644
171--- a/arch/arm/plat-omap/cpu-omap.c
172+++ b/arch/arm/plat-omap/cpu-omap.c
173@@ -8,6 +8,10 @@
174 *
175 * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
176 *
177+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
178+ * Updated to support OMAP3
179+ * Rajendra Nayak <rnayak@ti.com>
180+ *
181 * This program is free software; you can redistribute it and/or modify
182 * it under the terms of the GNU General Public License version 2 as
183 * published by the Free Software Foundation.
184@@ -26,12 +30,19 @@
185 #include <plat/clock.h>
186 #include <asm/system.h>
187
188+#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
189+#include <plat/omap-pm.h>
190+#include <plat/opp.h>
191+#endif
192+
193 #define VERY_HI_RATE 900000000
194
195 static struct cpufreq_frequency_table *freq_table;
196
197 #ifdef CONFIG_ARCH_OMAP1
198 #define MPU_CLK "mpu"
199+#elif CONFIG_ARCH_OMAP3
200+#define MPU_CLK "arm_fck"
201 #else
202 #define MPU_CLK "virt_prcm_set"
203 #endif
204@@ -73,7 +84,13 @@ static int omap_target(struct cpufreq_policy *policy,
205 unsigned int target_freq,
206 unsigned int relation)
207 {
208+#ifdef CONFIG_ARCH_OMAP1
209 struct cpufreq_freqs freqs;
210+#endif
211+#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
212+ unsigned long freq;
213+ struct device *mpu_dev = omap2_get_mpuss_device();
214+#endif
215 int ret = 0;
216
217 /* Ensure desired rate is within allowed range. Some govenors
218@@ -83,13 +100,13 @@ static int omap_target(struct cpufreq_policy *policy,
219 if (target_freq > policy->max)
220 target_freq = policy->max;
221
222+#ifdef CONFIG_ARCH_OMAP1
223 freqs.old = omap_getspeed(0);
224 freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
225 freqs.cpu = 0;
226
227 if (freqs.old == freqs.new)
228 return ret;
229-
230 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
231 #ifdef CONFIG_CPU_FREQ_DEBUG
232 printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n",
233@@ -97,7 +114,11 @@ static int omap_target(struct cpufreq_policy *policy,
234 #endif
235 ret = clk_set_rate(mpu_clk, freqs.new * 1000);
236 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
237-
238+#elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
239+ freq = target_freq * 1000;
240+ if (opp_find_freq_ceil(mpu_dev, &freq))
241+ omap_pm_cpu_set_freq(freq);
242+#endif
243 return ret;
244 }
245
246@@ -114,7 +135,14 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
247
248 policy->cur = policy->min = policy->max = omap_getspeed(0);
249
250- clk_init_cpufreq_table(&freq_table);
251+ if (!cpu_is_omap34xx()) {
252+ clk_init_cpufreq_table(&freq_table);
253+ } else {
254+ struct device *mpu_dev = omap2_get_mpuss_device();
255+
256+ opp_init_cpufreq_table(mpu_dev, &freq_table);
257+ }
258+
259 if (freq_table) {
260 result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
261 if (!result)
262--
2631.6.6.1
264