old version maemo21
[kernel-power] / kernel-maemo-2.6.28 / debian / patches / overclock-ulv.diff
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
3 @@ -4,11 +4,20 @@
4  #include <mach/omap-pm.h>
5  
6  /* MPU speeds */
7 +#define S1200M  1200000000
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
22  
23  /* DSP speeds */
24  #define S430M   430000000
25 @@ -23,16 +32,24 @@
26  
27  static struct omap_opp omap3_mpu_rate_table[] = {
28         {0, 0, 0},
29 -       /*OPP1*/
30 -       {0, VDD1_OPP1, 0x1E},
31 -       /*OPP2*/
32 -       {S250M, VDD1_OPP2, 0x26},
33 -       /*OPP3*/
34 -       {S500M, VDD1_OPP3, 0x30},
35 -       /*OPP4*/
36 -       {S550M, VDD1_OPP4, 0x36},
37 -       /*OPP5*/
38 -       {S600M, VDD1_OPP5, 0x3C},
39 +       {0, VDD1_OPP1, 0x19},
40 +       /*underclocking*/
41 +       {S125M, VDD1_OPP2, 0x19},
42 +       /*default*/
43 +       {S250M, VDD1_OPP3, 0x19},
44 +       {S500M, VDD1_OPP4, 0x21},
45 +       {S550M, VDD1_OPP5, 0x26},
46 +       {S600M, 6, 0x26},
47 +       /*overclocking*/
48 +       {S700M, 7, 0x2D},
49 +       {S750M, 8, 0x2D},
50 +       {S810M, 9, 0x30},
51 +       {S850M, 10, 0x30},
52 +       {S900M, 11, 0x36},
53 +       {S950M, 12, 0x36},
54 +       {S1000M, 13, 0x3C},
55 +       {S1100M, 14, 0x3C},
56 +       {S1200M, 15, 0x40},
57  };
58  
59  static struct omap_opp omap3_l3_rate_table[] = {
60 @@ -47,16 +64,24 @@
61  
62  static struct omap_opp omap3_dsp_rate_table[] = {
63         {0, 0, 0},
64 -       /*OPP1*/
65 +       /*underclocking*/
66         {S90M, VDD1_OPP1, 0x1E},
67 -       /*OPP2*/
68 -       {S180M, VDD1_OPP2, 0x26},
69 -       /*OPP3*/
70 -       {S360M, VDD1_OPP3, 0x30},
71 -       /*OPP4*/
72 -       {S400M, VDD1_OPP4, 0x36},
73 -       /*OPP5*/
74 -       {S430M, VDD1_OPP5, 0x3C},
75 +       /*default*/
76 +       {S90M, VDD1_OPP2, 0x1E},
77 +       {S180M, VDD1_OPP3, 0x26},
78 +       {S360M, VDD1_OPP4, 0x30},
79 +       {S400M, VDD1_OPP5, 0x36},
80 +       {S430M, 6, 0x36},
81 +       /*overclocking*/
82 +       {S430M, 7, 0x36},
83 +       {S430M, 8, 0x36},
84 +       {S430M, 9, 0x36},/*800MHz*/
85 +       {S500M, 10, 0x3C},
86 +       {S500M, 11, 0x3C},
87 +       {S500M, 12, 0x3C},
88 +       {S500M, 13, 0x3C},
89 +       {S500M, 14, 0x3C},
90 +       {S500M, 15, 0x3C},
91  };
92  
93  #endif
94 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/include/mach/omap34xx.h
95 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h
96 @@ -114,7 +114,8 @@
97  #define VDD2_OPP3      0x3
98  
99  #define MIN_VDD1_OPP   VDD1_OPP1
100 -#define MAX_VDD1_OPP   VDD1_OPP5
101 +/*#define MAX_VDD1_OPP VDD1_OPP5*/
102 +#define MAX_VDD1_OPP   15
103  #define MIN_VDD2_OPP   VDD2_OPP1
104  #define MAX_VDD2_OPP   VDD2_OPP3
105  
106 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.c
107 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.c
108 @@ -513,7 +513,7 @@
109         sr->req_opp_no = target_opp_no;
110  
111         if (sr->srid == SR1) {
112 -               switch (target_opp_no) {
113 +               switch (min(target_opp_no-1,5)) {
114                 case 5:
115                         nvalue_reciprocal = sr->opp5_nvalue;
116                         break;
117 @@ -527,6 +527,7 @@
118                         nvalue_reciprocal = sr->opp2_nvalue;
119                         break;
120                 case 1:
121 +               case 0:
122                         nvalue_reciprocal = sr->opp1_nvalue;
123                         break;
124                 default:
125 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/cpu-omap.c
126 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/cpu-omap.c
127 @@ -148,10 +148,13 @@
128                                                         VERY_HI_RATE) / 1000;
129         }
130  
131 -       clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
132 +       /*clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);*/
133 +       clk_set_rate(mpu_clk, 600000 * 1000); /*N900 hack: set default max to 600MHz */
134  
135 -       policy->min = policy->cpuinfo.min_freq;
136 -       policy->max = policy->cpuinfo.max_freq;
137 +       /*policy->min = policy->cpuinfo.min_freq;*/
138 +       /*policy->max = policy->cpuinfo.max_freq;*/
139 +       policy->min = 250000;
140 +       policy->max = 600000; /*N900 hack: set default to 250-600MHz */
141         policy->cur = omap_getspeed(0);
142  
143         policy->cpuinfo.transition_latency = 300 * 1000;
144 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.h
145 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.h
146 @@ -254,7 +254,7 @@
147  /* XXX: end remove/move */
148  
149  /* SR_MAX_LOW_OPP: the highest of the "low OPPs", 1 and 2. */
150 -#define SR_MAX_LOW_OPP         2
151 +#define SR_MAX_LOW_OPP         3
152  
153  /* XXX: find more appropriate place for these once DVFS is in place */
154  extern u32 current_vdd1_opp;
155 --- kernel-maemo-2.6.28.orig/drivers/cpufreq/cpufreq.c
156 +++ kernel-maemo-2.6.28/drivers/cpufreq/cpufreq.c
157 @@ -465,7 +465,7 @@
158  /**
159   * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
160   */
161 -#define store_one(file_name, object)                   \
162 +#define store_one(file_name, object,ignore)                    \
163  static ssize_t store_##file_name                                       \
164  (struct cpufreq_policy *policy, const char *buf, size_t count)         \
165  {                                                                      \
166 @@ -479,15 +479,16 @@
167         ret = sscanf (buf, "%u", &new_policy.object);                   \
168         if (ret != 1)                                                   \
169                 return -EINVAL;                                         \
170 -                                                                       \
171 -       ret = __cpufreq_set_policy(policy, &new_policy);                \
172 +       printk(KERN_DEBUG "cpufreq: request %u -> %u\n",policy->object,new_policy.object);      \
173 +       if (new_policy.object != ignore && new_policy.object >= 100000) \
174 +           ret = __cpufreq_set_policy(policy, &new_policy);            \
175         policy->user_policy.object = policy->object;                    \
176                                                                         \
177         return ret ? ret : count;                                       \
178  }
179  
180 -store_one(scaling_min_freq,min);
181 -store_one(scaling_max_freq,max);
182 +store_one(scaling_min_freq,min,600000);
183 +store_one(scaling_max_freq,max,600000);
184  
185  /**
186   * show_cpuinfo_cur_freq - current CPU frequency as detected by hardware
187 --- kernel-maemo-2.6.28.orig/Makefile
188 +++ kernel-maemo-2.6.28/Makefile
189 @@ -1,7 +1,7 @@
190  VERSION = 2
191  PATCHLEVEL = 6
192  SUBLEVEL = 28
193 -EXTRAVERSION = .10maemo
194 +EXTRAVERSION = .10maemo-ulv
195  NAME = Erotic Pickled Herring
196  
197  # *DOCUMENTATION*