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