[Lenovo Vibe K5 Plus ROMs, Kernels, Recoveries, & O] Luiz Paulo Damaceno:
Hello everyone! I'm here to share with you my custom kernel for lenovo vibe k5. this kernel contains overclock for CPUs and GPU, also undervolting and overvolting. This kernel is based on CM13 kernel source of @Shreps and @scritch007 ... now I will tell some specs of the overclocks and some resources...

Minimum and Maximum CPU regulator voltages: 1,03V - 1,355V -> stock: 1,05V - 1,35V;

Minimum and Maximum GPU regulator voltages: stock: 1,225V / 1,225V -> modified: 1,285V / 1,285V;

PLL Voltages:

-SVS (Smart Voltage Scaling) mode: 1,725V;

-NORMAL mode: 1,8V (stock is 1,8V) ;

-TURBO mode (used in performance governor): 1,885V (+85mV, stock is 1,8V too).

Voltage levels for CPU:

level 1 to level 13: 1,03V (stock is 1,05V, so is -20mV undervolted);

level 14: 1,075V (stock is 1,1V, so is -15mV undevolted);

level 15 1,1V;

level 16 1,125V;

level 17: 1,133V;

level 18: 1,134V;

level 19: 1,13425;

level 20: 1,135V;

level 21: 1,136V;

level 22: 1,162V;

level 23: 1,1705V;

level 24: 1,1875V;

level 25: 1,2005V;

level 26: 1.2675V;

level 27: 1,2875V;

level 28: 1,345V.

*all the stock voltages starting from level 15, in stock is 1,1375V, so level 15 to level 21 is undervolted. Starting from level 22 to level 28, all is overvolted to sustain the overclock.

Now, the frequency levels, associate it to voltage tables:

-> For BIG cores:

1 200MHz

2 345MHz

3 400MHz

4 422MHz

5 499MHz

6 533MHz

7 652MHz

8 729MHz

9 800MHz

10 80MHz

11 883MHz

12 960MHz

13 1036MHz

14 1113MHz

15 1190MHz

16 1267MHz

17 1344MHz

18 1363MHz

19 1420MHz

20 1459MHz

21 1497MHz -> stock maximum

22 1536MHz -> OVERCLOCK

23 1574MHz -> OVERCLOCK

24 1612MHz -> OVERCLOCK

25 1632MHz -> OVERCLOCK

26 1651MHz -> OVERCLOCK

27 1689MHz -> OVERCLOCK

28 1950MHz -> EXTREME OVERCLOCK

For LITTLE Cores:

1 200MHz

2 249MHz

3 400 MHz

5 499MHz

12 800MHz

16 998MHz

17 1113MHz

21 1209MHz

26 1335MHz

27 1866MHz

So... Stock clockrates is undervolted a lot and overclocked clockrates is overvolted a lot too, but i've been tested all of them and my phone didn't burn, i hope your phone don't burn too :D

Oh... I've added some voltage quotient adjustments too, so, in last frequency more 45mV will be added depending of system load and -25mV will be decrased too in stock frequency depending system load.

Another things... This kernel haven't custom governors because i'haven't time already for add them but have a lot of needed stuff for hardware what isn't installed on lenovo stock rom and another custom roms... Some of these thins are:

-Qualcomm SVS (Smart voltage scalling with clock);

-WCD9306 HiFi processor drivers;

-QDSP6v2 Ultrasound HW driver;

-Thermal scaling drivers;

-Hardware monitoring with ADC current meter;

-Thermistor support (for battery safety in subsystem);

-Qualcomm camera header 3.1;

-Face detection engine support;

I'm forgetting... I've been incrased SM5414 charger charging current too! So your phone will charge too much faster with more charging current matching with Qualcomm Quick Charger 2.0 specifications.

So... you can see the tests on the screens, on benchmarks i not see a BIG difference on scores (tested with Antutu Benchmark) but in games like asphalt extreme... im running in full configurations without lags! But... BE CAREFUL, CAN OVERHEAT YOU PHONE WITH EXCESSIVE LOADS!

For my tests i've been stopped core control, thermal engine, vdd restriction, everything what can drops performance if temperature incrases, to stop thermal-engine you can type in terminal this two commands: "su" and "stop thermal-engine" -> I'm not responsible for anything what can damage your phone, you do what you want.

Stock and moded thermal engine configurations can variate the scores because the ambient temperature can be influent in this things... on my tests, i've tested in a 25�C room (my work laboratory).

Kernel Source: https://github.com/Vgdn1942/android_kernel_lenovo_msm8929

Original Source Code: https://github.com/boulzordev/android_kernel_lenovo_msm8929

Collaborators: [MENTION=5338358]Luiz Paulo Damaceno[/MENTION] , @scritch007 , @Shreps , @vgdn1942 , [MENTION=6158043]Dreamstar[/MENTION]

Thanks everyone!

Kernel flashable zip via TWRP Link: https://www.androidfilehost.com/?w=files&flid=138556 -> Future updates will be added here!

Tested on Lenovo VIbe K5 A6020l36 with Snapdragon 616! (1,5GHz BIG - 1.2GHz LITTLE) - Dont work on Snapdragon 415 versions because this kernel have a really big overclock in both clusters in clocks driver.

Changelog 06/12/2016

Added more governors

Added more overclock

Added Adreno Idler

Linux 3.10.51

Power Efficient Workqueues

Incrased UnderVoltage at stock clocks and lower clocks also, reduced the maximum overvoltage with overclock too ( -20~ -60 ~

-60 ~-120 )

Changelog 28/12/2016 - The last of the year 1

AnyROM Patch (thanks to [MENTION=6158043]Dreamstar[/MENTION]);

Added Faux sound control (thanks to [MENTION=6158043]Dreamstar[/MENTION]);

Added Simple GPU Algorythm;

Improved Adreno Idler;

Added Dynamic Fsync for higher I/O performance causing overall UX performance;

Added User Level thermal control working with thermal-engine -> this allow user control one of throttle temperatures (in this case pm8916tz, the temperature of power management IC);

Added Pocket Mod (for future ROM compilations);

Incrased swapness for an acceptable value;

Added O3 optimizations in kernel build;

Updated voltage mode battery management system with last codeaurora updates;

Reduced ncp6335d regulator slew rate and incrased maximum frequency from 670kHz to 710kHz to improve power efficiency and reduce overheating incrasing inductors impedance of buck converter;

Reduced fan53555 regulator slew rate;

Reduce stock frequencies voltage tables again (more automatic undervolt, something about -52mV for stock frequencies (1.49GHz and 1.20GHz);

Make mdss bandwidth value adaptive - 2,1GB/s ~ 2,35GB/s (Stock is 2GB/s);

Incrased a little more AC Charging current (but, its matching with SM5414 Charger IC limits);

Updated a little KGSL drivers;

Updated 2 years old some SOC audio files;

Minimum GPU Frequency reduced to 19MHz when in really IDLE state;

Added Alucard Hotplug;

Maked Power Efficient Workqueue enabled by default for awaked CPUs to save some power;

Overall Linux and Drivers minor update;

SW2Awake and DT2W is under developement, but, for DT2W you can use "half" function to awake device;

#include <some audio optimization file for enable 192kHz sample rate by default>;
#include <optimized init.qcom.post_boot.sh>;
#include <optimized thermal-engine for balanced heating / performance>;
#include <wlan.ko module>;

Now a little tutorial: How to obtain maximum performance with this kernel in benchmarks.

After installed, disable any powersave option from kernel configurations with any kernel configuration app, disable hotplug, set the maximum temperature to arround 63�C in kernel configuration app, and enable all cores, set they frequency to maximum as possible (1,95GHz for BIG and 1,86GHz for LITTLE); Now the dangerous part: go to terminal emulator and type:

su // to obtain superuser privileges
stop thermal-engine //to stop thermal-engine service

Now, go to your benchmark app and test, i recommend to you do this ONLY in cold days or with good refrigeration, for example, you can use the family's fridge for this :D .

Remember: the kernel doesn't enable automatically overclock, you need to do this by selecting maximum frequency you want, by stock I selected default frequencies to safety.

-Changelog 30/12/2016 - See you soon...

Updating regulator voltages for more undervolt at stock frequencies again (more again);

Added ClusterPlug for hotplug LITTLE Cluster when the system aren't in heavy parallel loads and enable all little cores when high parallel loads start;

Added an sysfs file for user put desired charging current (explanation at end) sm5414 charger specific modification;

Another updates in linux base;

Alucard hotplug disabled by default, but you can enable it to hotplug BIG cores based on system load;

Re-enabled Adaptive Low Memory Killer;

Updated sleep drivers;

Debugging DTS-Eagle API Driver to full support at DSP;

Added kernel level 192kHz for sound driver;

Some audio routing corrections;

Incrased torch brightness a little;

Thermal throttle set to 65�C;

Added new bootlogo, if you dont desire this, download the version with stock bootlogo;

Gesture functions stay buggy, only working half DT2W :(

-Changelog 07/02/2017

Under and Over voltages regulated again;

GPU Overclock Frequency reduction and added more frequency (powerlevels) steps to GPU;

Modification at DC/DC converters (clocks and maximum currents);

QuickChargeCurrent file minimum value modification;

ALSA updates;

Stills with UBER 4.9 TC;

Light RAM Overclock;

Bandwidth between GPU and Display reduction to reduce random reboot chances;

Little updates at Linux base and KGSL Drivers (kernel side);

F2FS Support;

Gesture functions stay buggy :( .

-> for user control maximum charging current:

--This mod will allow user set the maximum current of USB port when connected in AC charger, when is on USB, the charger is't changed, always 500mA!

--The SM5414 IC can deliver 2500mA without problems, but i limited the maximum at 2250mA.

--For the normal charge, i set 1650mA maximum, but you can go up to 2250mA without problems, also you can set values of 100mA to 2250mA with 50mA steps, for example: 100mA to 150mA, not to 120mA or 140mA, the driver will make approximations to the next or last step current. But you can jump for example of 1000mA for 2250mA, after 1 minute you saved the value the charger module will read the new value and set maximum corrent.

--The file is /sys/modules/sm5414_charger/parameters/quickchargecurrent , when you open file you will see 1650 number, this is my default value when maked the mod on driver, you can set according already explained.

OBS: if you try to set values up to 2250mA, the driver will not read and set to the maximum limited value, in this case, 2250mA.

OBS2: the readed current in apps like ampere or hwmonitor is an post-regulated current, so can be more than the USB current because inside we have buck converters, this converter type reduces the voltage (in case of charger form 5~6V to 4,4V for battery) and incrases the output current, because P=V*I in both sides, input and outpt (in ideal mode).

So... For 2016 its this.

Last Antutu Test with CM-14.1:

View attachment 3981917

New Antutu Benchmark tests with lineage-14.1:

View attachment 4033273

:silly: :cool: