old version maemo20
[kernel-power] / kernel-maemo-2.6.28 / debian / patches / overclock_uvolt.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 S1200M  1200000000
8 +#define S1100M  1100000000
9 +#define S1000M  1000000000
10 +#define S950M   950000000
11 +#define S900M   900000000
12 +#define S850M   850000000
13 +#define S800M   800000000
14 +#define S750M   750000000
15 +#define S700M   700000000
16  #define S600M   600000000
17  #define S550M   550000000
18  #define S500M   500000000
19 @@ -23,16 +32,23 @@
20  
21  static struct omap_opp omap3_mpu_rate_table[] = {
22         {0, 0, 0},
23 -       /*OPP1*/
24         {0, VDD1_OPP1, 0x1E},
25 -       /*OPP2*/
26 -       {S250M, VDD1_OPP2, 0x26},
27 -       /*OPP3*/
28 -       {S500M, VDD1_OPP3, 0x30},
29 -       /*OPP4*/
30 -       {S550M, VDD1_OPP4, 0x36},
31 -       /*OPP5*/
32 -       {S600M, VDD1_OPP5, 0x3C},
33 +       /*underclocking*/
34 +       {S125M, VDD1_OPP2, 0x1E},
35 +       /*default*/
36 +       {S250M, VDD1_OPP3, 0x26},
37 +       {S500M, VDD1_OPP4, 0x30},
38 +       {S550M, VDD1_OPP5, 0x30},
39 +       {S600M, 6, 0x30},
40 +       /*overclocking*/
41 +       {S700M, 7, 0x36},
42 +       {S750M, 8, 0x36},
43 +       {S800M, 9, 0x36},
44 +       {S850M, 10, 0x36},
45 +       {S900M, 11, 0x36},
46 +       {S950M, 12, 0x36},
47 +       {S1000M, 13, 0x36},
48 +       {S1100M, 14, 0x36},
49  };
50  
51  static struct omap_opp omap3_l3_rate_table[] = {
52 @@ -47,16 +63,23 @@
53  
54  static struct omap_opp omap3_dsp_rate_table[] = {
55         {0, 0, 0},
56 -       /*OPP1*/
57 +       /*underclocking*/
58         {S90M, VDD1_OPP1, 0x1E},
59 -       /*OPP2*/
60 -       {S180M, VDD1_OPP2, 0x26},
61 -       /*OPP3*/
62 -       {S360M, VDD1_OPP3, 0x30},
63 -       /*OPP4*/
64 -       {S400M, VDD1_OPP4, 0x36},
65 -       /*OPP5*/
66 -       {S430M, VDD1_OPP5, 0x3C},
67 +       /*default*/
68 +       {S90M, VDD1_OPP2, 0x1E},
69 +       {S180M, VDD1_OPP3, 0x26},
70 +       {S360M, VDD1_OPP4, 0x30},
71 +       {S400M, VDD1_OPP5, 0x36},
72 +       {S430M, 6, 0x3C},
73 +       /*overclocking*/
74 +       {S430M, 7, 0x3C},
75 +       {S430M, 8, 0x3C},
76 +       {S430M, 9, 0x3C},/*800MHz*/
77 +       {S500M, 10, 0x3C},
78 +       {S500M, 11, 0x3C},
79 +       {S500M, 12, 0x3C},
80 +       {S500M, 13, 0x3C},
81 +       {S500M, 14, 0x3C},
82  };
83  
84  #endif
85 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/include/mach/omap34xx.h
86 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h
87 @@ -114,7 +114,8 @@
88  #define VDD2_OPP3      0x3
89  
90  #define MIN_VDD1_OPP   VDD1_OPP1
91 -#define MAX_VDD1_OPP   VDD1_OPP5
92 +/*#define MAX_VDD1_OPP VDD1_OPP5*/
93 +#define MAX_VDD1_OPP   14
94  #define MIN_VDD2_OPP   VDD2_OPP1
95  #define MAX_VDD2_OPP   VDD2_OPP3
96  
97 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.c
98 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.c
99 @@ -513,7 +513,7 @@
100         sr->req_opp_no = target_opp_no;
101  
102         if (sr->srid == SR1) {
103 -               switch (target_opp_no) {
104 +               switch (min(target_opp_no-1,5)) {
105                 case 5:
106                         nvalue_reciprocal = sr->opp5_nvalue;
107                         break;
108 @@ -527,6 +527,7 @@
109                         nvalue_reciprocal = sr->opp2_nvalue;
110                         break;
111                 case 1:
112 +               case 0:
113                         nvalue_reciprocal = sr->opp1_nvalue;
114                         break;
115                 default:
116 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/cpu-omap.c
117 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/cpu-omap.c
118 @@ -148,10 +148,13 @@
119                                                         VERY_HI_RATE) / 1000;
120         }
121  
122 -       clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
123 +       /*clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);*/
124 +       clk_set_rate(mpu_clk, 600000 * 1000); /*N900 hack: set default max to 600MHz */
125  
126 -       policy->min = policy->cpuinfo.min_freq;
127 -       policy->max = policy->cpuinfo.max_freq;
128 +       /*policy->min = policy->cpuinfo.min_freq;*/
129 +       /*policy->max = policy->cpuinfo.max_freq;*/
130 +       policy->min = 250000;
131 +       policy->max = 600000; /*N900 hack: set default to 250-600MHz */
132         policy->cur = omap_getspeed(0);
133  
134         policy->cpuinfo.transition_latency = 300 * 1000;
135 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.h
136 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.h
137 @@ -254,7 +254,7 @@
138  /* XXX: end remove/move */
139  
140  /* SR_MAX_LOW_OPP: the highest of the "low OPPs", 1 and 2. */
141 -#define SR_MAX_LOW_OPP         2
142 +#define SR_MAX_LOW_OPP         3
143  
144  /* XXX: find more appropriate place for these once DVFS is in place */
145  extern u32 current_vdd1_opp;