f399c29f9f0006782d336377ce1df9868ad3a0c7
[kernel-power] / kernel-maemo-2.6.28 / debian / patches / overclock.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 @@ -33,6 +42,16 @@
20         {S550M, VDD1_OPP4, 0x36},
21         /*OPP5*/
22         {S600M, VDD1_OPP5, 0x3C},
23 +       /*overclocking*/
24 +       {S700M, 6, 0x3C},
25 +       {S750M, 7, 0x3C},
26 +       {S800M, 8, 0x3C},
27 +       {S850M, 9, 0x3C},
28 +       {S900M, 10, 0x3C},
29 +       {S950M, 11, 0x3C},
30 +       {S1000M, 12, 0x3C},
31 +       {S1100M, 13, 0x3C},
32 +       {S1200M, 14, 0x3C},
33  };
34  
35  static struct omap_opp omap3_l3_rate_table[] = {
36 @@ -57,6 +76,16 @@
37         {S400M, VDD1_OPP4, 0x36},
38         /*OPP5*/
39         {S430M, VDD1_OPP5, 0x3C},
40 +       /*overclocking*/
41 +       {S430M, 6, 0x3C},
42 +       {S430M, 7, 0x3C},
43 +       {S430M, 8, 0x3C},/*800MHz*/
44 +       {S500M, 9, 0x3C},
45 +       {S500M, 10, 0x3C},
46 +       {S500M, 11, 0x3C},
47 +       {S500M, 12, 0x3C},
48 +       {S500M, 13, 0x3C},
49 +       {S500M, 14, 0x3C},
50  };
51  
52  #endif
53 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/include/mach/omap34xx.h
54 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h
55 @@ -114,7 +114,8 @@
56  #define VDD2_OPP3      0x3
57  
58  #define MIN_VDD1_OPP   VDD1_OPP1
59 -#define MAX_VDD1_OPP   VDD1_OPP5
60 +/*#define MAX_VDD1_OPP VDD1_OPP5*/
61 +#define MAX_VDD1_OPP   14
62  #define MIN_VDD2_OPP   VDD2_OPP1
63  #define MAX_VDD2_OPP   VDD2_OPP3
64  
65 --- kernel-maemo-2.6.28.orig/drivers/cpufreq/cpufreq.c
66 +++ kernel-maemo-2.6.28/drivers/cpufreq/cpufreq.c
67 @@ -823,7 +823,8 @@
68                 goto err_out;
69         }
70         policy->user_policy.min = policy->cpuinfo.min_freq;
71 -       policy->user_policy.max = policy->cpuinfo.max_freq;
72 +       /*policy->user_policy.max = policy->cpuinfo.max_freq;*/
73 +       policy->user_policy.max = 600000; /*N900 hack: set default max to 600MHz */
74  
75         blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
76                                      CPUFREQ_START, policy);
77 --- kernel-maemo-2.6.28.orig/arch/arm/mach-omap2/smartreflex.c
78 +++ kernel-maemo-2.6.28/arch/arm/mach-omap2/smartreflex.c
79 @@ -513,7 +513,7 @@
80         sr->req_opp_no = target_opp_no;
81  
82         if (sr->srid == SR1) {
83 -               switch (target_opp_no) {
84 +               switch (min(target_opp_no,5)) {
85                 case 5:
86                         nvalue_reciprocal = sr->opp5_nvalue;
87                         break;
88 --- kernel-maemo-2.6.28.orig/arch/arm/plat-omap/cpu-omap.c
89 +++ kernel-maemo-2.6.28/arch/arm/plat-omap/cpu-omap.c
90 @@ -148,10 +148,12 @@
91                                                         VERY_HI_RATE) / 1000;
92         }
93  
94 -       clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
95 +       /*clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);*/
96 +       clk_set_rate(mpu_clk, 600000 * 1000); /*N900 hack: set default max to 600MHz */
97  
98         policy->min = policy->cpuinfo.min_freq;
99 -       policy->max = policy->cpuinfo.max_freq;
100 +       /*policy->max = policy->cpuinfo.max_freq;*/
101 +       policy->max = 600000; /*N900 hack: set default max to 600MHz */
102         policy->cur = omap_getspeed(0);
103  
104         policy->cpuinfo.transition_latency = 300 * 1000;