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