FORUMS
Remove All Ads from XDA

[Kernel][2.6.32][OC/UV][Up to 1.4ghz configurable][2nd Dec][Froyo][Fast Scaling]

713 posts
Thanks Meter: 41
 
By raspdeep, Senior Member on 28th October 2010, 05:27 PM
Post Reply Email Thread
New Directions:
As there will be more tweaks and findings out by xda members, i will not include much tweaks (unless those i run) into my kernel but to release source so others can incorporate my oc/uv into their "all-in-one" kernel threads.

im glad someone took the liberty to add voodoo kernel and hope he eventually get voodoo to merge nicely with modded cwm.

UV control version 2.1 and above
- voltage scaling
- full UV user control via sysfs
- works on all governor
- echo "50 50 150 75 75 100" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
- column 1 for 1.2ghz, 2 for 1ghz, 3 for 800mhz, 4 for 400mhz, 5 for 200mhz, lastly 100mhz
- values are mV
- Use latest xan's app if you dont want to mess with commands - here

Info:
- based from the jpm froyo 2.6.32.9 kernel drop
- using sztupy ramfs (it has sztupy modded cwm but i did not test all options esp lag fix)
- Mem config based from here - free 341mb
- BLN by Neldar
- sysfs user configurable Undervolt
- FS supports - ext2 / ext4 / JFS
- sourcery 4.4.1 g++ 2009q3
- linpack 16 MFLOPish
- supported frequencies 100/200/400/800/1000/1200
- rooted adb shell

Stock voltage info
1200000 - 1300 (<-added)
1000000 - 1275
800000 - 1200
400000 - 1050
200000 - 950
100000 - 950
Max vdd_arm is 1.31v according to datasheet so dont go crazy OV'ing


To-do
- a lot

How to install:
- download any latest .7z file
- extract .tar from the .7z file
- use odin, load tar file under pda and flash

Credits
- sztupy
- supercurio
- unhelpful
- hardcore
- xan
- neldar

enjoy!

OC / UV 101
This question has been asked a lot so I will try my best to answer this question to my knowledge. Our phone although uses the same hardware, they can vary in terms of stability and performance. I believed even same hardware varies because of production tolerances & variations. Our stock 1ghz system per datasheet should run at 1.2v, however, in the source code, samsung set it at 1.275v. There are a lot of speculation why this happens but my personal believe is due to production fallouts. In production environment, to increase the yield, they increased the voltage to make them more stable. This is the easiest way to increase yield and sound most logical in business standpoint.

Our phones do frequency scaling. Meaning it doesnt stay at a particular frequency all the time, the frequencies fluctuate depending on load and thresholds. At high load, it will go to high frequencies and when low load or idle mode, it will stay around 100-400 range. In this way, you get load balance and uses lesser power.

Back to how adjusting UV to suit your phone. I've enabled via sysfs (/sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table) the ability for user configurable UV, unlocking this allows for UV'ing at all supported frequencies 100/200/400/800/1000/1200mhz. In this table is an array of values in mV, column 1 for 1.2ghz, 2 for 1ghz, 3 for 800mhz, 4 for 400mhz, 5 for 200mhz, lastly 100mhz. What this means is each column allows an UV setting at you can change to suit your phone. In boot up stage, all the values in the array is zero hence no UV'ing. You can set it and here is how it works:
Taking for example, you echo "0 50 50 75 75 100" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table, looking at the stock voltage info I've described above, you will get:
1200000 -> 1300-0 = 1300mV
1000000 -> 1275-50 = 1225mV
800000 -> 1200-50 = 1150mV
400000 -> 1050-75 = 975mV
200000 -> 950-75 = 875mV
100000 -> 950-100 = 850mV

At 1.2ghz, i disabled UV by setting the value to 0. This is because 1.2ghz is already OC'ed so some phones may not be able to run stable so UV'ing makes the situation worst. At 1ghz, i reduced by 50mV, this is trial and error, i wouldnt know if this is stable unless i do some benchmark, run some programs, etc. So the question is "how do i know the UV i set is stable?" You can do this by a few ways. For my case, this is how I do it:
1) Set the voltage for 1ghz at 25mV
2) Use SetCPU to limit max and min scaling frequency to 1ghz
3) Run test, play some media, surf the web, open market place, etc.
4) Run it for 30-45 mins and if it doesnt crash, its good.
5) Increase the mV to 50mV and repeat 2-4 until it hang or crash
6) Find the mV that you phone likes without hanging or crashing then move to 800mhz

For lower frequencies, you can "usually" have higher UV but you cannot use setcpu to test the lower frequencies as the system will run above the max scaling frequencies even if you try to limit it lower (edit: this happens only if min and max frequency is not equal). For example, you limit the max scaling frequencies to 200mhz, it wont stay max at 200mhz but jump higher. The easiest way to test the lower frequencies UV is by letting your phone standby, sleep or do less intensive stuff and see if it runs stable, I believed most phones can do 75mV at 100-200mhz range but you can try more and see how it works out for you.

You can also test the lower frequencies by setting both min and max scaling to the same frequency. However, do note that setting low frequency will be very slow especially if you try it at 100mhz. It may take several seconds just to change apps.


FAQs
Q - What is UV? Why UV?
A - UV stands for Undervolt. The idea is to run at lower than stock voltage at any frequencies hence saving battery and longer battery performance

Q - Does UV also slow down the performance?
A - Theoretically it doesnt but under certain circumstances when the voltage gets too low for the cpu to operate properly, you may encounter some glitches so the idea is not to run it at the all the way down but find a suitable voltage that it doesnt happen. For example, running 75mV is stable but sometimes see some slow down so up it to 50mV and it should run fine.

Q - I am not convinced, I do not want to OC, how can I stop that?
A - Simple, using xan's app, check the box "limit max clock to 1ghz (no overclocking)" or using adb shell echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq


Changelog
v300
- ULF v0.4pre
-frequencies supported are 1400/1360/1280/1200/1120/1000/800/400/200/100 (in this order)
- echo 0 0 0 1 0 1 1 1 1 1 > /sys/devices/system/cpu/cpu0/cpufreq/states_enabled_table
- Frequencies state can be enabled by echoing a "1" into the column position (1.4ghz - 1st column, 1.36ghz - 2nd column, 1.28ghz - 3rd column,... etc)
- examples above will enable 1200/1000/800/400/200/100
- At default stage, all the OC frequencies will be disabled so user will have to enable if they want to OC.. it will only run ONCE when scaling start (so using init.d to set the states) but i've added a trigger called /sys/devices/system/cpu/cpu0/cpufreq/update_states which by default will be 0. echoing a 1 will force an update if you want to change the state.
- There will also be UV for each frequencies same as previous version
- Stock voltage
1400000 - 1300 (<- added)
1360000 - 1300 (<- added)
1280000 - 1300 (<- added)
1120000 - 1300 (<- added)
1200000 - 1300 (<-added)
1000000 - 1275
800000 - 1200
400000 - 1050
200000 - 950
100000 - 950
Max vdd_arm is 1.31v according to datasheet so dont go crazy OV'ing


v217 UV alpha
- quick fix on corrupted /system
- /sbin/busybox mount -t rfs -o check=no /dev/block/stl9 /system

Highly Experimental 1.28Ghz / 1.4Ghz kernels v216
- Only for those that know what they are doing - no support
- BACKUP YOUR STUFF
- Disable UV and UV startup script
- Post your benchmark for bragging rights
- Linpack 17.9 (1.28Ghz) / 19.8 (1.4Ghz)

v216 UV alpha
- added BLN
- release source for 1.12ghz

v215 UV alpha (1.2ghz and 1.12ghz OC support)
- 100->400mhz fast scaling (less aggressive than v212 for better battery life)
- tweak for faster response
- bootanimation support
- do Linpack benchmark of your current kernel vs my kernel for comparison. Only benchmark 5 mins after system bootup (without USB cable attached)
- Linpack: 13.9-14.2@1ghz, 15.3-15.7@1.12ghz,16.5-16.9@1.2ghz

v212 UV alpha
- hz = 300
- fast scaling speed jump
- tweak for faster response
- fix sztupy's startup script so it will run any files in /etc/init.d at startup
- may use more battery so keep track and let me know

v2.1 UV alpha debug
- full UV user control via sysfs
- works on all governor
- echo "50 50 150 75 75 100" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
- column 1 for 1.2ghz, 2 for 1ghz, 3 for 800mhz, 4 for 400mhz, 5 for 200mhz, lastly 100mhz
- values are mV
- Use latest xan's app if you dont want to mess with commands - here

v2.0 UV alpha
- PMIC VS UV
- user configurable UV settings (default value = 0 for UVLF and UVHF) for conservative governor only
- /sys/devices/system/cpu/cpu0/cpufreq/conservative/UVLF_mV (for 100-800mhz)
- /sys/devices/system/cpu/cpu0/cpufreq/conservative/UVHF_mV (above 800mhz)
- for example # echo 50 > /sys/devices/system/cpu/cpu0/cpufreq/conservative/UVLF_mV (will UV by 50mV for 100-800mhz)
- for example # echo 25 > /sys/devices/system/cpu/cpu0/cpufreq/conservative/UVHF_mV (will UV by 25mV for 1-1.2ghz)
- If you do not want to mess with commands, use Xan's app for easy GUI control - here
- if you tried 100mV and still doesnt crash, use command method to set higher. my phone crashed when i set 125mV @ UVLF and 75mV @ UVHF
- Hz @ 500
- source patch attached

v1.0 UV alpha
- bug fixes
- optimization flag back to O3

v1.1 alpha
- added JFS
- compile optimization level to O2 from O3
- Mem config based from here - free 341mb
- release alpha patch source code

v1 alpha
- initial release
Attached Files
File Type: 7z oc120_froyo_v217_alpha.7z - [Click for QR Code] (6.48 MB, 1894 views)
File Type: 7z oc128_froyo_v217_alpha.7z - [Click for QR Code] (6.48 MB, 1524 views)
File Type: 7z oc112_froyo_v217_alpha.7z - [Click for QR Code] (6.48 MB, 589 views)
File Type: 7z oc_froyo_v300_alpha.7z - [Click for QR Code] (6.48 MB, 3011 views)
File Type: zip files.zip - [Click for QR Code] (35.1 KB, 961 views)
The Following 12 Users Say Thank You to raspdeep For This Useful Post: [ View ] Gift raspdeep Ad-Free
 
 
28th October 2010, 05:30 PM |#2  
Senior Member
Thanks Meter: 104
 
More
Oc to what? xD

Sent from my GT-I9000 using XDA App
28th October 2010, 05:32 PM |#3  
Member
Thanks Meter: 0
 
More
thx will give it a try!
28th October 2010, 05:33 PM |#4  
Senior Member
Thanks Meter: 8
 
Donate to Me
More
Quote:
Originally Posted by jaju123

Oc to what? xD

Sent from my GT-I9000 using XDA App

- supported frequencies 100/200/400/800/1000/1200
28th October 2010, 05:33 PM |#5  
Senior Member
Thanks Meter: 6
 
More
look forward to hardcore incorporating this into his kernals.
28th October 2010, 05:34 PM |#6  
Member
Flag Toronto
Thanks Meter: 7
 
More
REALLY interested in this.
I'll install this when it's further in the development stage.

Will you be adding features/themes to this rom or will it be OCing only?
28th October 2010, 05:42 PM |#7  
vanahaim's Avatar
Senior Member
Flag Prague
Thanks Meter: 20
 
More
Quote:
Originally Posted by INeedYourHelp

look forward to hardcore incorporating this into his kernals.

Me too..! (I have 14MFLOPS with the latest hardcore┬┤s kernel.. and with OC it can be really interesting)
28th October 2010, 05:51 PM |#8  
OP Senior Member
Thanks Meter: 41
 
More
Quote:
Originally Posted by Aery

- supported frequencies 100/200/400/800/1000/1200

he was right, i forgot about frequencies until he asked
28th October 2010, 05:55 PM |#9  
Retired Recognized Developer
Stockholm
Thanks Meter: 2,667
 
Donate to Me
More
Thanks, tha OC King is back

Update: functional on Doc_Kalpik 5/6 roms
28th October 2010, 05:58 PM |#10  
Senior Member
Thanks Meter: 3
 
More
http://forum.xda-developers.com/showthread.php?t=821514

maybe you can share your knowledge with those guys, they said they want to port that that kernel to every modell

But good work =)
28th October 2010, 06:02 PM |#11  
Retired Recognized Developer
Stockholm
Thanks Meter: 2,667
 
Donate to Me
More
Impressive: Linpack 17.4 ,
Quardrant, no lagfix, 1150+
Post Reply Subscribe to Thread

Tags
3qq

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

Advanced Search
Display Modes