FORUMS
Remove All Ads from XDA
H10 Turbo

[Module] X8Overclock | v004 - Multiple freq | X8 | X10 mini | X10 mini pro | 11-04-11

1,263 posts
Thanks Meter: 4,784
 
By doixanh, Recognized Developer on 3rd April 2011, 10:20 AM
Post Reply Email Thread
Rom cookers: if you include this module in your ROM, please make a link to this post in your release post, so your users can know how to work with it and update the module themselves

Intro: (dev post)
Since the X10 kernel is working, we might have a hope that someday we will have our custom kernels. If we can have custom kernels, we can do the overclocking easily.

Until that day, we will still have to overclock with modules. To make overclocking works with our current kernel, as far as I can see, we need to do the following things:
1. Patch cpufreq data to change maximum reported freq (these value will be read by Android for further controls). cpufreq will then call the low-level acpuclock functions to change real cpu freq.
2. Patch acpuclock data + code to change real cpu freq.

Right now I'm working a proof-of-concept module, with finished 1 and half of 2. I will need to patch acpuclock code in the running kernel to make the frequency applicable.

That means, right now, Android reported that I have a 800MHz MSM7227, although it's running at 600MHz, and cpufreq's governor accepts to change to the maximum 800MHz (it's 600MHz for real). We will need to patch acpuclock code to change PLL and apply the correct divisor.


Source on github : https://github.com/doixanh/X8Features

Release history
  • April 11. v004. Default to 691MHz. Multiple frequencies are available for SetCPU: from 614MHz to 826MHz. You can now change frequencies with SetCPU - much like with custom kernels! You can even SetCPU freq at boot.
  • April 07. v003. Compatible with SetCPU. Easier for code maintenance.
  • April 06. v002 for mini pro. x8oc module for x10 mini pro released! Be warned: I didn't have your x10mini pro hardware so I didn't test it throughoutly.
  • April 06. v002 for mini. x8oc module for x10 mini released! Be warned: I didn't have your x10mini hardware so I didn't test it throughoutly. 710MHz was reported not too stable. A lower freq is more stable.
  • April 06. v002. Experimental! It maybe very unstable! Undervoltage for all frequencies except the max freq (Reduced voltages for 128MHz, 245MHz, 320MHz, 480MHz). This can potentially save battery. I need test results for saving battery from you guys
  • April 05. v001. Default to 710MHz.

Requirements:
- Rooted
- Baseband x15
- xRecovery (for automatic installtation)
- Dare!


Installation:
a. Manual installation : it will be better if you can do this way.
- Download appropriate x8oc-vXXX.zip (for X8), or x8oc-vXXX-x10m.zip (for X10 mini), or x8oc-vXXX-x10mp.zip (for x10 mini pro) below, unzip
- Remount /system as rw
- Push x8oc.ko in to /system/lib/modules
- Edit /system/etc/hw_config.sh, add one line at the beginning
Code:
insmod /system/lib/modules/x8oc.ko # x8 overclock
For people who want to set specific freq at boot, write the following instead of the code above:
Code:
# x8 overclock
insmod /system/lib/modules/x8oc.ko 
sleep 2
echo xAB > /proc/x8oc
Where AB is your desired code for that frequency. Test the frequency carefully before applying it at boot!
(you can edit hw_config.sh by pulling it to your PC, edit, and push it back)
- Reboot your phone

b. Automatic installation : much like x8gesture, I will have to prepare update.zip for each ROM. I'm pretty busy now, so be patient.

General instruction
- When you install x8oc, SetCPU will not recognized the new max frequency. Don't touch the slide and/or change the governor. If you do that, the new frequency will be lost. You will have to reboot your phone to get the new freq.
- For geeks only: it is possible to change maximum frequency after you install x8oc. With following command, you can replace AB to other values to change max freq:
Code:
echo xAB > /proc/x8oc
20 to change to 614MHz
21 to change to 634MHz
22 to change to 653MHz
23 to change to 672MHz
24 to change to 691MHz
25 to change to 710MHz
26 to change to 730MHz
27 to change to 749MHz

For example, set to 749MHz:
Code:
echo x27 > /proc/x8oc
This feature still works with v004

Somebody asked about the meaning of AB above. If you look at the source you will understand
In short :
- AB is stored in hexadecimal
- Max frequency = AB (in decimal) * 19.2MHz
Example:
AB = 27 means AB = 0x27 = 39 (in decimal)
Real frequency = 39*19.2 = 748.8 MHz
You can put 28, 29, for even higher frequency... but I don't recommend to do that. It was unstable for me.

x10 mini / x10 mini pro users:
Support for x10 mini / x10 mini pro has been added since 06-04-11. However, I don't have your hardware so you must test this module before install it:
- Push x8oc.ko to /system/lib/modules
- Run the following command
Code:
insmod /system/lib/modules/x8oc.ko
If the phone is still working, no crash, no black screen, then it works.
Until you're sure that it works with your hardware, don't install it to hw_config.sh or you will get boot loops and may severely damage your hardware

Disclaimer
This module is dangerous! It may cause severe damage to your hardware. I'm not responsible if this module kills your lovely phone. Use it at your own risk!

Donations are welcome


PLEASE DON'T SPAM IN THIS THREAD WITH UNCONTRIBUTED POSTS.
Attached Files
File Type: zip x8oc-v003.zip - [Click for QR Code] (4.2 KB, 2930 views)
File Type: zip x8oc-v003-X10m.zip - [Click for QR Code] (4.2 KB, 403 views)
File Type: zip x8oc-v003-X10mp.zip - [Click for QR Code] (4.2 KB, 1048 views)
File Type: zip x8oc-v004.zip - [Click for QR Code] (4.7 KB, 38801 views)
File Type: zip x8oc-v004-x10m.zip - [Click for QR Code] (4.7 KB, 1351 views)
File Type: zip x8oc-v004-x10mp.zip - [Click for QR Code] (4.7 KB, 3437 views)
The Following 107 Users Say Thank You to doixanh For This Useful Post: [ View ]
 
 
3rd April 2011, 11:26 AM |#2  
ponanovn's Avatar
Senior Member
Thanks Meter: 669
 
More
Can you share the source code of your module?
The Following User Says Thank You to ponanovn For This Useful Post: [ View ] Gift ponanovn Ad-Free
3rd April 2011, 11:49 AM |#3  
I was too lazy to build a separated module for OCing Everything is a mess inside my current x8gesture module

I'll try to do something more and then separate OC into a new module.
The Following 4 Users Say Thank You to doixanh For This Useful Post: [ View ]
3rd April 2011, 05:13 PM |#4  
Senior Member
Flag Kaunas/Kėdainiai Lithuania
Thanks Meter: 30
 
More
info about MSM7227 CPU:
http://pdadb.net/index.php?m=cpu&id=...alcomm_msm7227
The Following User Says Thank You to ojojoj For This Useful Post: [ View ] Gift ojojoj Ad-Free
3rd April 2011, 05:33 PM |#5  
Holy sh*t. They included bunches of controllers inside this MSM 7227
Quote:

Max. 800MHz Qualcomm MSM7227 Turbo, Embedded 320MHz DSP (GSM, GPRS/EGPRS Multislot Class 12, EDGE, UMTS Release 6, 7.2 Mbps HSDPA, HSUPA 5.76 Mbps, MBMS baseband), 400MHz modem processor, Adreno 200, OpenGL ES 2.0, OpenGL ES 1.1, OpenVG 1.1, EGL 1.3, Direct3D Mobile, SVGT 1.2, DirectDraw,

The Following 4 Users Say Thank You to doixanh For This Useful Post: [ View ]
3rd April 2011, 06:18 PM |#6  
Senior Member
Flag GuimarĂ£es
Thanks Meter: 37
 
More
Is there anyway to enable that turbo mode by moding? It must be locked somewhere, the safe clock is 600mhz, but it might run 800mhz or more stable too, might be battery draining issue, or overvoltage necessity but with scaling that should not be a real issue, if only used to extreme situations, and, for a bit of time.
3rd April 2011, 07:16 PM |#7  
Senior Member
Flag Kaunas/Kėdainiai Lithuania
Thanks Meter: 30
 
More
f.e. Samsung Galaxy Ace has same CPU and it run at 800Mhz
3rd April 2011, 07:36 PM |#8  
Inactive Recognized Developer
Thanks Meter: 881
 
Donate to Me
More
This is a great project and it looks very promissing.
ZTE Blade has same cpu and they had problems overclocking just the main core, but in the end they solved it, I guess you could take a look at their solution as well.

And thanks again for the dualtouch module.
3rd April 2011, 08:35 PM |#9  
I read many overclocked kernel sources for MSM7227 in difference devices. What they did was to modify acpuclock.c :
1. add new freqs to freq_table
2. add new freqs to clkctl_acpu_speed arrays
3. modify acpuclk_set_div to set PLL for overclocked freqs

Because acpuclock is initialized very early during boot process, cpufreq (initialized much later) will read those available freqs from acpuclock to apply to its governors.

In our case, because we cannot modify acpuclock in the kernel before it's initialized, our module will be loaded much later than both acpuclock and cpufreq. Therefore, my approach is to modify (inline patch) both acpuclock and cpufreq in memory, while the kernel is running.

So far, as mentioned in OP, I modified cpufreq and acpuclock data (as in 1. and 2.), so that Android thinks that max freq is set at 800MHz. We will have to do some inline memory patches to acpuclock function to change PLL for freqs more than 600MHz during runtime. More precisely, we need to patch acpuclk_set_div function.

I did a quick study about ARM instruction set, looked for branch (and branch with links) instructions. I managed to redirect calls to acpuclk_set_div to my own function in module, so that acpuclock_set_rate calls to my function, instead of the original one. However, it seems that the param received by my function is always NULL.

Looking for reasons and solutions. Any suggestions?

@racht: no, we thank you for your hard work in your Hackdroid ROMs.
The Following 2 Users Say Thank You to doixanh For This Useful Post: [ View ]
3rd April 2011, 09:45 PM |#10  
It seems that I made a mistake. acpuclk_set_div was not separated as a function. Instead, the compiler included it in the caller function (acpuclk_set_rate). This will be a big big big problem for us to hijack the call.....
The Following User Says Thank You to doixanh For This Useful Post: [ View ]
3rd April 2011, 10:23 PM |#11  
LFSPovo's Avatar
Senior Member
Flag Dublin
Thanks Meter: 20
 
More
Hope everything works out! 200mhz is a big jump
Post Reply Subscribe to Thread

Tags
e15, overclock

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes