Posted 01 May 2013 - 08:03 PM #1

GOAL

The goal of this kernel is to have a central place for developers in the community, who don't want the burden to maintain their own kernel, to have a place to do so. Many times, developers who work on these devices constantly develop issues with others or don't have time to incorporate new features. Our goal is to avoid all that. Anything and everything will be accepted, granted it doesn't break anything. @show-p1984 has been kind enough to not only host the source but grant the use of his buildbot for this project. Every time source is pushed, the bot will start to build the kernel, zip up the package and finally upload it to my goo.im account. If you'd like to become part of this project then go ahead and reach out to me on twitter (@jassycliq) or PM me on here. My short term goal for this kernel is to add all the hotplug drivers available for mako and incorporate them into this one kernel. As it stands we can only use Qcom's binary, show's mpdecision and faux123's intelli-plug as they have switches to turn them off. These can be changed on the fly, as long as the user turns off all the hotplug drivers first then turns on the desired hotplug method. I'd also like to have an app that can control this, well a proper application to be exact.

Features

* CPU OC up to 1.9ghz, Default to 1.5GHz

* CPU UC down to 162mhz

* UV down to 600,000uVolts

* Intelli-plug hotplug driver

* Qualcomm's MPDecision

* MSM MPDecision (kernel based mpdecision)

* Dynamic FSync

* Sweep2Wake

* Snapdragon S4 and Krait optimizations

* 3-Phase Thermal

* GPU OC up to 487mhz

* Faux's Gamma Interface

* Faux Sound/Speaker Control

* Fast Charge

* Schedulers

FIOPS

SIO

NOOP

ROW

CFQ

DEADLINE (tuned for flash devices)

* Governors:

Interactive

Ondemand

Performance

* Advance TCP Congestion Control

Westood+

Reno

Bic

Cubic

Htcp

Veno

* Compiled with gcc 4.7.3 (Linaro 4.7-2013.04)

* -O3 optimized

* WLAN, TUN and CIFS compiled as modules due to size of kernel from the high amounts of optimizations

Choosing between the 3 hotplug drivers

This kernel comes with 3 hotplug drivers (intelli-plug, qcoms mpdecision and kernel based mpdecision) by default only Qualcomm's MPDecision is used. To turn one of the others you must use their respective sysfs interfaces after turning off the one's you're not using. To make it easier for you, I have included a small little application that helps you turn through this. If you'd like to make an init.d script to choose which one you want on boot then use the following commands

For kernel based mpdecision

echo "0/1" > /sys/kernel/msm_mpdecision/conf/enabled echo "0/1" > /sys/kernel/msm_mpdecision/conf/scroff_single_core

For Intelli-Plug

echo "0/1" > /sys/module/intelli_plug/parameters/intelli_plug_active echo "0/1" > /sys/module/intelli_plug/parameters/eco_mode_active

For Qualcomm's MPDecision

start mpdecision stop mpdecision

Downloads

DanceDance* Too much to write!

What is msm_thermal?

Kernel based 3-phase thermal control!

This replaces your /system/bin/thermald binary which is renamed by the installer to thermald_bck.

It will throttle your cpu speed to keep it cool and unleash it if the cpu has cooled down enough. (3 phases: low, mid and high)



Check /sys/kernel/msm_thermal/conf/ for the thermal configuration



allowed_max_high = highest threshold (phase 3)

allowed_max_low = remove the throttling if we cooled down to this (clr_thrshold)

allowed_max_freq = max frequency if throttled (limit)



[...]mid[...] = same as above, just for phase 2

[...]low[...] = Lowest threshold (phase 1)



check_interval_ms = how often shall we check? (sampling rate)

Default: 100ms (=0.1sec)



shutdown_temp = if we reach this shut down the device!

Default: 80°C



If you want to see msm_thermal doing it's job:



adb shell cat /proc/kmsg | grep 'thermal'

What is msm_mpdecision?



100% kernel based multi core decision! (should cpu1/2/3 be online or not?)

This replaces your /system/bin/mpdecision binary which is renamed by the installer to mpdecision_bck.



Check /sys/kernel/msm_mpdecision/conf/ for the configuration.



startdelay = time until mpdecision starts doing it's magic (20000)

delay = time between checks (70)

pause = if something else plugs in the cpu, fall asleep for 10000ms (10 secs)

scroff_single_core = if the screen is off, don't plug in cpu1/2/3. Additionally: Unplug all cpus except cpu0 when screen is turned off (1)

enabled = enable(1) or disable(0) mpdecision. This does not affect scroff_single_core!

min_cpus = min cpus to be online, cannot be < 1. Default: 1

max_cpus = max cpus to be online, cannot be > 4. (if you set it to 2 and min_cpus to 1 you will basically have a dualcore) Default: 4

idle_freq = a value against that will be checked if a core +/- is requested. (486000)

If cpu0 is below that value and a core up of another cpu is requested, nothing will happen.

If any other cpu is above that value and a core down of that cpu is requested, nothing will happen. (otherwise it would now put down that cpu even though it is still working, which isn't what we want)



Hot plug thresholds (aka now it gets 'complicated')

This small formula calculates which value will be used: (number_of_cpus_online - 1) * 2

The result of this formula will be the nwns_threshold where a new cpu is hotplugged.

The result of this formula + 1 will be the nwns_threshold where a cpu is unplugged.



nwns_threshold_x = runqueue threshold, if this is reached cpuX will be hot/unplugged

twts_threshold_x = time threshold, this amount of time must have passed for the related action to be taken (hot/unplug)



Example:

One cpu is online.

(1 - 1) * 2 = 0 ergo:

nwns_threshold_0 = cpu1 will be hotplugged at this value

((1 - 1) * 2) + 1 = 1

nwns_threshold_1 = cpu0 will be unplugged at this value

Since we can't unplug cpu0 this is '0'.



Two cpus are online.

(2 - 1) * 2 = 2 ergo:

nwns_threshold_2 = cpu2 will be hotplugged at this value

((2 - 1) * 2) + 1 = 3

nwns_threshold_3 = cpu1 will be unplugged at this value



etc...



The default values are:

NwNs_Threshold: 12, 0, 25, 20, 32, 28, 0, 35

TwTs_Threshold: 140, 0, 140, 190, 140, 190, 0, 190

Where the position and function of the number equals the result of the above explained formula.



(all times are in ms)

If you want to see the mpdecision magic happening:



adb shell cat /proc/kmsg | grep 'MPDEC'

How does sweep2wake work? Does it keep my phone awake?



Short answer: No.

Long answer:

Sweep2wake works with IRQs (Interrupts).

In technical terms: An Interrupt interrupts the normal operation of a program and executes "special" code instead.



So if you touch your screen, an interrupt is send on which the touch driver reacts. That's it.

Since we have a capacitive touchscreen you also do not need to worry about any pressure onto the screen.



If you want to disable sweep2wake execute this command on your phone (adb shell or directly), you can also add it to an init.d script.



echo "0" > /sys/android_touch/sweep2wake

Why do I have no WLAN?

adb shell lsmod

tun 14701 0 - Live 0x00000000 cifs 275399 0 - Live 0x00000000 wlan 2964650 0 - Live 0x00000000 (C)

adb shell su . /system/etc/init.d/00wlan

need to have busybox installed

Due to this kernels very high optimization settings it is too big for our boot.img with WLAN included into the kernel, so it is built as a module. That means it needs to be inserted into the kernel upon boot up, which needs to be automated for maximum comfort = userinit (init.d) support.The zip adds init.d support to your ramdisk, if that fails for some reason the wlan module cannot be inserted.ifdoesn't show this:Then init.d support is probably missing.You can test it by going to /system/etc/init.d/ and executing 00wlan.Wait a few seconds and try to enable wifi and repeat the above lsmod command (should now show wlan, you can execute 01cifs and 02tun too).If WLAN now works, init.d support is missing.Youin order to be able to get init.d support going, this shouldn't be a problem for most people, since it is usually installed when rooting your phone anyway.It does not matter if busybox is installed in /system/bin or /system/xbin, my script will detect the location upon flashing and patch the ramdisk accordingly.If no busybox is found, the script will add init.d support to your ramdisk with the default location: /system/xbin/busybox. All you need to do is install busybox there and reboot your phone.

Edited by JassyCliq, 01 May 2013 - 08:23 PM.