1 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/omap3-opp.h
2 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/omap3-opp.h
4 #include <mach/omap-pm.h>
7 +#define S1150M 1150000000
8 +#define S1100M 1100000000
9 +#define S1000M 1000000000
10 +#define S950M 950000000
11 +#define S900M 900000000
12 +#define S850M 850000000
13 +#define S810M 810000000
14 +#define S750M 750000000
15 +#define S700M 700000000
16 #define S600M 600000000
17 #define S550M 550000000
18 #define S500M 500000000
19 #define S250M 250000000
20 -#define S125M 125000000
21 +#define S125M 124999000
24 +#define S520M 500000000
25 #define S430M 430000000
26 #define S400M 400000000
27 #define S360M 360000000
30 #define S166M 166000000
32 -static struct omap_opp omap3_mpu_rate_table[] = {
35 - {0, VDD1_OPP1, 0x1E},
37 - {S250M, VDD1_OPP2, 0x26},
39 - {S500M, VDD1_OPP3, 0x30},
41 - {S550M, VDD1_OPP4, 0x36},
43 - {S600M, VDD1_OPP5, 0x3C},
46 -static struct omap_opp omap3_l3_rate_table[] = {
49 - {0, VDD2_OPP1, 0x1E},
51 - {S83M, VDD2_OPP2, 0x24},
53 - {S166M, VDD2_OPP3, 0x2C},
56 -static struct omap_opp omap3_dsp_rate_table[] = {
59 - {S90M, VDD1_OPP1, 0x1E},
61 - {S180M, VDD1_OPP2, 0x26},
63 - {S360M, VDD1_OPP3, 0x30},
65 - {S400M, VDD1_OPP4, 0x36},
67 - {S430M, VDD1_OPP5, 0x3C},
69 +extern struct omap_opp omap3_mpu_rate_table[];
70 +extern struct omap_opp omap3_dsp_rate_table[];
71 +extern struct omap_opp omap3_l3_rate_table[];
74 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/include/mach/omap34xx.h
75 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h
79 #define MIN_VDD1_OPP VDD1_OPP1
80 -#define MAX_VDD1_OPP VDD1_OPP5
81 +/*#define MAX_VDD1_OPP VDD1_OPP5*/
82 +#define MAX_VDD1_OPP 15
83 #define MIN_VDD2_OPP VDD2_OPP1
84 #define MAX_VDD2_OPP VDD2_OPP3
86 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.c
87 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.c
90 #include "smartreflex.h"
91 #include "prm-regbits-34xx.h"
92 +#include "omap3-opp.h"
94 +struct omap_opp omap3_mpu_rate_table[] = {
111 + {S1000M, 13, 0x3C},
112 + {S1100M, 14, 0x43},
113 + {S1150M, 15, 0x48},
116 +struct omap_opp omap3_l3_rate_table[] = {
119 + {0, VDD2_OPP1, 0x1E},
121 + {S83M, VDD2_OPP2, 0x24},
123 + {S166M, VDD2_OPP3, 0x2C},
126 +struct omap_opp omap3_dsp_rate_table[] = {
139 + {S430M, 9, 0x3C},/*800MHz*/
150 * VP_TRANXDONE_TIMEOUT: maximum microseconds to wait for the VP to
152 sr->req_opp_no = target_opp_no;
154 if (sr->srid == SR1) {
155 - switch (target_opp_no) {
156 + switch (min(target_opp_no-1,5)) {
158 nvalue_reciprocal = sr->opp5_nvalue;
161 nvalue_reciprocal = sr->opp2_nvalue;
165 nvalue_reciprocal = sr->opp1_nvalue;
169 (ERRCONFIG_VPBOUNDINTEN | ERRCONFIG_VPBOUNDINTST));
171 if (sr->srid == SR1) {
172 + /*printk(KERN_NOTICE "OPP%d setting voltage %d\n",
173 + target_opp_no,mpu_opps[target_opp_no].vsel);*/
174 errminlimit = (target_opp_no > SR_MAX_LOW_OPP) ?
175 SR1_ERRMINLIMIT_HIGHOPP : SR1_ERRMINLIMIT_LOWOPP;
178 current_opp_no = get_opp_no(current_opp);
180 if (vdd == PRCM_VDD1) {
181 + /*printk(KERN_DEBUG "OPP%d bypass setting voltage %d\n",
182 + target_opp_no,target_vsel);*/
183 t2_smps_steps = abs(target_vsel - current_vsel);
184 errorgain = (target_opp_no > SR_MAX_LOW_OPP) ?
185 PRM_VP1_CONFIG_ERRORGAIN_HIGHOPP :
186 @@ -940,6 +1001,57 @@
190 +static ssize_t omap_sr_vdd1_opps_vsel_show(struct kobject *kobj,
191 + struct kobj_attribute *attr, char *buf)
195 + for(i=1;i<=MAX_VDD1_OPP;i++)
196 + b+=sprintf(b, "%d ", mpu_opps[i].vsel);
197 + b+=sprintf(b, "\n");
201 +static ssize_t omap_sr_vdd1_opps_vsel_store(struct kobject *kobj,
202 + struct kobj_attribute *attr,
203 + const char *buf, size_t n)
205 + unsigned short value[16];
208 + if (sscanf(buf, "%hu %hu %hu %hu %hu %hu %hu %hu %hu %hu %hu %hu %hu %hu %hu %hu",
209 + &value[0], &value[1], &value[2], &value[3],
210 + &value[4], &value[5], &value[6], &value[7],
211 + &value[8], &value[9], &value[10], &value[11],
212 + &value[12], &value[13], &value[14], &value[15]
213 + ) != MAX_VDD1_OPP) {
214 + printk(KERN_ERR "sr_vdd1_opps_vsel: Invalid value\n");
218 + mutex_lock(&dvfs_mutex);
220 + for(i=1;i<=MAX_VDD1_OPP;i++) {
221 + if(value[i-1]<0x49) {
222 + mpu_opps[i].vsel = value[i-1];
226 + mutex_unlock(&dvfs_mutex);
231 +static struct kobj_attribute sr_vdd1_opps_vsel = {
233 + .name = __stringify(sr_vdd1_opps_vsel),
236 + .show = omap_sr_vdd1_opps_vsel_show,
237 + .store = omap_sr_vdd1_opps_vsel_store,
241 /* Sysfs interface to select SR VDD1 auto compensation */
242 static ssize_t omap_sr_vdd1_autocomp_show(struct kobject *kobj,
243 struct kobj_attribute *attr, char *buf)
244 @@ -1075,6 +1187,10 @@
246 printk(KERN_INFO "SmartReflex driver initialized\n");
248 + ret = sysfs_create_file(power_kobj, &sr_vdd1_opps_vsel.attr);
250 + printk(KERN_ERR "sysfs_create_file failed: %d\n", ret);
252 ret = sysfs_create_file(power_kobj, &sr_vdd1_autocomp.attr);
254 printk(KERN_ERR "sysfs_create_file failed: %d\n", ret);
255 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/cpu-omap.c
256 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/cpu-omap.c
257 @@ -148,10 +148,13 @@
258 VERY_HI_RATE) / 1000;
261 - clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
262 + /*clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);*/
263 + clk_set_rate(mpu_clk, 600000 * 1000); /*N900 hack: set default max to 600MHz */
265 - policy->min = policy->cpuinfo.min_freq;
266 - policy->max = policy->cpuinfo.max_freq;
267 + /*policy->min = policy->cpuinfo.min_freq;*/
268 + /*policy->max = policy->cpuinfo.max_freq;*/
269 + policy->min = 250000;
270 + policy->max = 600000; /*N900 hack: set default to 250-600MHz */
271 policy->cur = omap_getspeed(0);
273 policy->cpuinfo.transition_latency = 300 * 1000;
274 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.h
275 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.h
277 /* XXX: end remove/move */
279 /* SR_MAX_LOW_OPP: the highest of the "low OPPs", 1 and 2. */
280 -#define SR_MAX_LOW_OPP 2
281 +#define SR_MAX_LOW_OPP 3
283 /* XXX: find more appropriate place for these once DVFS is in place */
284 extern u32 current_vdd1_opp;
285 --- kernel-maemo-2.6.28.orig/drivers/cpufreq/cpufreq.c
286 +++ kernel-maemo-2.6.28/drivers/cpufreq/cpufreq.c
289 * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
291 -#define store_one(file_name, object) \
292 +#define store_one(file_name, object,ignore) \
293 static ssize_t store_##file_name \
294 (struct cpufreq_policy *policy, const char *buf, size_t count) \
296 @@ -479,15 +479,16 @@
297 ret = sscanf (buf, "%u", &new_policy.object); \
301 - ret = __cpufreq_set_policy(policy, &new_policy); \
302 + printk(KERN_DEBUG "cpufreq: request %u -> %u\n",policy->object,new_policy.object); \
303 + if (new_policy.object != ignore && new_policy.object >= 100000) \
304 + ret = __cpufreq_set_policy(policy, &new_policy); \
305 policy->user_policy.object = policy->object; \
307 return ret ? ret : count; \
310 -store_one(scaling_min_freq,min);
311 -store_one(scaling_max_freq,max);
312 +store_one(scaling_min_freq,min,0);
313 +store_one(scaling_max_freq,max,600000);
316 * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware