summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/dvfs/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/dvfs/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/dvfs/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch269
1 files changed, 269 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/dvfs/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch b/extras/recipes-kernel/linux/linux-omap/dvfs/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
new file mode 100644
index 00000000..0371bc3a
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/dvfs/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
@@ -0,0 +1,269 @@
1From f6b96e3b9e31da193189d92320b3dd9fac7c9ba9 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/20] 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>
117---
118 arch/arm/mach-omap2/clock.h | 14 +++++++++++++-
119 arch/arm/mach-omap2/clock34xx.c | 2 ++
120 arch/arm/plat-omap/cpu-omap.c | 35 ++++++++++++++++++++++++++++++++---
121 3 files changed, 47 insertions(+), 4 deletions(-)
122
123diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
124index 896584e..29b5cf0 100644
125--- a/arch/arm/mach-omap2/clock.h
126+++ b/arch/arm/mach-omap2/clock.h
127@@ -137,7 +137,9 @@ extern const struct clksel_rate gpt_32k_rates[];
128 extern const struct clksel_rate gpt_sys_rates[];
129 extern const struct clksel_rate gfx_l3_rates[];
130
131-#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ)
132+#ifdef CONFIG_CPU_FREQ
133+
134+#ifdef CONFIG_ARCH_OMAP2
135 extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
136 extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
137 #else
138@@ -145,6 +147,16 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
139 #define omap2_clk_exit_cpufreq_table 0
140 #endif
141
142+#ifdef CONFIG_ARCH_OMAP3
143+extern void omap3_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
144+extern void omap3_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
145+#else
146+#define omap3_clk_init_cpufreq_table 0
147+#define omap3_clk_exit_cpufreq_table 0
148+#endif
149+
150+#endif /* CONFIG_CPU_FREQ */
151+
152 extern const struct clkops clkops_omap3_noncore_dpll_ops;
153
154 #endif
155diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
156index 287abc4..85d3877 100644
157--- a/arch/arm/mach-omap2/clock34xx.c
158+++ b/arch/arm/mach-omap2/clock34xx.c
159@@ -20,6 +20,8 @@
160 #include <linux/kernel.h>
161 #include <linux/clk.h>
162 #include <linux/io.h>
163+#include <linux/err.h>
164+#include <linux/cpufreq.h>
165
166 #include <plat/clock.h>
167
168diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
169index bfa063b..608216b 100644
170--- a/arch/arm/plat-omap/cpu-omap.c
171+++ b/arch/arm/plat-omap/cpu-omap.c
172@@ -8,6 +8,10 @@
173 *
174 * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
175 *
176+ * Copyright (C) 2007-2008 Texas Instruments, Inc.
177+ * Updated to support OMAP3
178+ * Rajendra Nayak <rnayak@ti.com>
179+ *
180 * This program is free software; you can redistribute it and/or modify
181 * it under the terms of the GNU General Public License version 2 as
182 * published by the Free Software Foundation.
183@@ -21,17 +25,25 @@
184 #include <linux/err.h>
185 #include <linux/clk.h>
186 #include <linux/io.h>
187+#include <linux/opp.h>
188
189 #include <mach/hardware.h>
190 #include <plat/clock.h>
191+#include <plat/common.h>
192 #include <asm/system.h>
193
194+#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
195+#include <plat/omap-pm.h>
196+#endif
197+
198 #define VERY_HI_RATE 900000000
199
200 static struct cpufreq_frequency_table *freq_table;
201
202 #ifdef CONFIG_ARCH_OMAP1
203 #define MPU_CLK "mpu"
204+#elif CONFIG_ARCH_OMAP3
205+#define MPU_CLK "arm_fck"
206 #else
207 #define MPU_CLK "virt_prcm_set"
208 #endif
209@@ -73,7 +85,13 @@ static int omap_target(struct cpufreq_policy *policy,
210 unsigned int target_freq,
211 unsigned int relation)
212 {
213+#ifdef CONFIG_ARCH_OMAP1
214 struct cpufreq_freqs freqs;
215+#endif
216+#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
217+ unsigned long freq;
218+ struct device *mpu_dev = omap2_get_mpuss_device();
219+#endif
220 int ret = 0;
221
222 /* Ensure desired rate is within allowed range. Some govenors
223@@ -83,13 +101,13 @@ static int omap_target(struct cpufreq_policy *policy,
224 if (target_freq > policy->max)
225 target_freq = policy->max;
226
227+#ifdef CONFIG_ARCH_OMAP1
228 freqs.old = omap_getspeed(0);
229 freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
230 freqs.cpu = 0;
231
232 if (freqs.old == freqs.new)
233 return ret;
234-
235 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
236 #ifdef CONFIG_CPU_FREQ_DEBUG
237 printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n",
238@@ -97,7 +115,11 @@ static int omap_target(struct cpufreq_policy *policy,
239 #endif
240 ret = clk_set_rate(mpu_clk, freqs.new * 1000);
241 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
242-
243+#elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
244+ freq = target_freq * 1000;
245+ if (opp_find_freq_ceil(mpu_dev, &freq))
246+ omap_pm_cpu_set_freq(freq);
247+#endif
248 return ret;
249 }
250
251@@ -114,7 +136,14 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
252
253 policy->cur = policy->min = policy->max = omap_getspeed(0);
254
255- clk_init_cpufreq_table(&freq_table);
256+ if (!cpu_is_omap34xx()) {
257+ clk_init_cpufreq_table(&freq_table);
258+ } else {
259+ struct device *mpu_dev = omap2_get_mpuss_device();
260+
261+ opp_init_cpufreq_table(mpu_dev, &freq_table);
262+ }
263+
264 if (freq_table) {
265 result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
266 if (!result)
267--
2681.6.6.1
269