[Nexus 4 Android Development] thracemerin:
m_plus kernel for Nexus 4 (mako)!

Hi all, since _motley has been MIA of late and his work was my favorite kernel for the Nexus 4, I have decided to continue his work in his absense. As a result much of this thread will look very similar to _motley's original thread here: http://xdaforums.com/showthread.php?t=2021437. I would like to personally thank _motley for his work and dedication to this project, I only hope I can keep his loyal users happy in his absence.

Disclaimer: As usual, I am not responsible for anything that may or may not happen to your device as a result of using this kernel or any other flashable zips posted by me in this thread.

Features

Highly customizable with scripts. See post #2 for all the tuning options.

Google 3.4 base. All stock features are of course supported (camera, NFC etc.)

Compiler optimizations (-O2 + others) - using 2012.12 Linaro toolchain

Full ramdisk install with init.d support for stock/AOSP (CM already has support, for stock you must install busybox!)

CPU Overclock steps 1.56, 1.62, and 1.67GHz (default freq is still stock on boot, OC is optional)

304MHz lowest CPU freq step added with lower voltage than stock, since the device spends a lot of time at this frequency.

Safe UV by default for nominal, fast, and faster binned chips.

Voltage control - be careful to not save the setting on boot until you are 100% sure it is stable! (thanks faux123! + my tweaks)

In-kernel auto_hotplug (thanks to thalamus). I have added and exposed all the tuning parameters and a debug mode to userspace.

Customized in-kernel thermal solution smart scaling, dynamic polling, and configurable throttle temp.

Custom PowerHAL module (spam-free Android log from PowerHAL events)

Controllable touchboost frequency and duration

Gamma and Sound control (thanks faux123!)

Fsync control (3 modes)

USB Force Fast Charge

I/O schedulers - SIO(optimized), deadline (optimized), row, cfq, noop, and fiops

TCP Congestion Control (several choices available) - veno is the default

Governors - Interactive (default), OnDemand, PowerSave, Conservative

CIFS, NFS, NTFS r/w, TUN - built-in, no need for any kernel modules

Other misc patches and tweaks (see github link at the bottom of this post)

GPL compliant - source is kept up to date at github.com and released at the time the kernel is released to the public via this post. Demand that other devs do the same!

Requirements (please read carefully and visit the other dev threads as necessary)

Boot-loader must be unlocked and you must have a custom recovery installed (CWM or TWRP).

Have your ROM zip on your /sdcard so you can restore your whole ROM if necessary.

Do a complete backup using custom recovery so you can restore your boot.img and ROM if necessary!

System Tuner is recommended for monitoring/tuning the CPU, especially for voltage control. Other kernel apps like faux123's will likely work as well, but they have not been tested.

AOSP ROMs including stock - for init.d support, you must have a working busybox install in /system/xbin.

Installation

Check the requirements above and read release notes below for the build # you are installing for any extra instructions!

If coming from another kernel, read the instructions in red below and follow them before flashing.

Flash the the kernel zip using your custom recovery.

Optional: if you want to revert back to what you had, restore your backup of your boot.img in recovery. Another option for reset back to stock is to flash the stock reset zip above. For other custom ROMs, dirty flash your custom ROM in recovery to get your default kernel and ramdisk back.

If you have issues and are coming from another custom kernel or ROM, follow these instructions first before the install. Many custom kernels are changing the ramdisk or other binaries that require a reset before moving back to stock or another kernel.

Reset for Stock ROM - flash this reset package that includes the stock kernel, ramdisk, thermald, mpdecision, and PowerHAL binary. This can also be used if you are using the stock ROM and want to go back to stock.

Download - N4_422_stock_kernel_and_components.zip

MD5 - f801fc7702e29d85447e9b6fdc880549

Reset for any non-stock ROMs like CM, AOKP etc - dirty flash your current ROM or nightly zip then your gapps in recovery (just flash, no wiping). This will give you back your original ramdisk, kernel, and other binaries that other kernel devs may have tweaked, renamed, replaced etc.

Builds

Personal Request: If you plan to make unofficial builds with features not included in the builds posted by me, please don't link them in the thread, all this does is result in confusion especially if someone has a problem with something you have added, it is much easier for me to provide support if I know that everyone in the thread is running the same builds I am. If you want to make a kernel with these features, feel free to start another thread so that they can be discussed and supported as appropriate.

Current Buildbot Status:

Source: https://github.com/thracemerin/kernel-Nexus4

As with _motley's builds, the stable version will be a base build which includes the ramdisk and other component binaries to make the kernel work as expected, you will need to flash the stable version prior to flashing any experimental versions or something may not work as expected.

All files are now available from goo.im: http://goo.im/devs/thracemerin/mako/m_plus

Note: Due to goo.im file naming rules I had to change the name of the zip to m_plus from m+, this has no effect on the content, the ones on goo.im are identical to those that were on dev-host other than the names.

Change Logs

Note: The builds below are for 4.2.2 only, for the latest 4.3 alpha builds check the last few pages of the thread. *4.3 builds will appear on goo.im when they are closer to being official production builds.

This thread is for 4.2.X versions only, use the following threads for 4.3:

JW Builds: Thread not available yet, Alpha 3 is still here: http://xdaforums.com/showpost.php?p=43993185&postcount=860

JS Builds: http://xdaforums.com/showthread.php?t=2385840

Build 10 (Exp) - July 15, 2013

Note: You must be on Build 1 or later. (Build 8 if you are on MIUI)

Various patches to the kernel to prevent out of bounds access to memory (see github for details)

Added sweep2wake, it is disabled by default, see post 2 for info (thanks to show-p1984)

Added a patch to fix some unusual behavior with the LEDs (thanks to CM)

Build 9 (Exp) - July 3, 2013

Note: You must be on Build 1 or later. (Build 8 if you are on MIUI)

Added the simple GPU governor for Qualcomm Adreno GPUs thanks to Faux123 (set as default, no need for the script required in the Alpha). Tunables explained in Post 2.

Build 8.1 (Exp) - June 20, 2013

Note: You must be on Build 1 or later. (Build 8 if you are on MIUI)

Actually reverted some of the msm_hsic patches because they seem to cause data drops (I only pretended I did in Build 8, oops :p)

Build 8 (Exp) - June 18, 2013

Note: You must be on Build 1 or later.

Reverted some of the msm_hsic patches because they seem to cause data drops

Now build with the Linaro 4.8.2.2013.06 toolchain

Switched the allocator from SLUB to SLAB because SLUB wouldn't boot when compiled with 4.8

Various fixes to allow building with 4.8

Build 7 (Exp) - May 26, 2013

Note: You must be on Build 1 or later.

goo.im seems to be a little flaky this afternoon, alternative downloads here: http://xdaforums.com/showpost.php?p=41865828&postcount=416

Patches to freezer from Colin Cross

More patches to workqueue from CAF

Patches to the cpufreq driver from CAF

Reverted lowest frequency step to 384MHz (See Post 3 for why)

Fixed board-mako-regulator.c to allow for UV to work (Warning: Reset your UV settings if you have UV below 850mV, if you flashed the previous alphas this is probably not necessary.)

Reset undervolting to stock from Google, just in case the above causes problems for new adopters (You still have full access to undervolt to 600mV if your chip can handle it)

Added the change pointed out by veyka here: http://xdaforums.com/showpost.php?p=41730297&postcount=380

Some more patches to the hsic controller that were in my other project but not this one.

Build 6 (Exp) - May 19, 2013

Note: You must be on Build 1 or later.

CAF changes to cpufreq

CAF changes to workqueues

Build 5 (Exp) - May 12, 2013

Note: You must be on Build 1 or later.

CAF patches to block.

CAF patches to the charging and battery management system.

CAF patches to the video driver.

Build 4 (Exp) - May 5, 2013

Note: You must be on Build 1 or later.

A few more sched patches from CAF

Patches to android lowmemory killer from CAF

Headphone poweramp controls (thanks to Faux123)

Build 3 (Exp) - May 3, 2013

Note: You must be on Build 1 or later.

Various sched patches that were in _motley's 4.2.1 kernel and not his 4.2.2 kernel

FIOPS i/o scheduler is back

192mhz frequency step added (thanks to showp1984)

Note: The ramdisk currently forces the minimum to 304mhz so i added an init.d script to force it to 192mhz so I didn't have to redo the ramdisk.

I'll fix this in the next base build.

If you still want to use 304mhz as your lowest step, see post 3 for details on how to do this.

Note 2: The voltage is the same as the one _motley used for 304mhz for stability reasons, it will still use less power, but feel free to uV it if you like.

Build 2 (Exp) - April 30, 2013

Note: You must be on Build 1 or later.

Update ROW i/o scheduler to the latest from CAF, now default i/o scheduler

FIOPS i/o scheduler was removed because _motley added FIOPS and ROW as 1 commit and messing with ROW screwed it up.

Hardcode ROW magic values (thanks to franciscofranco & osm0sis)

Update interactive governor to the latest from CAF (it may be a little less aggressive)

Krait Retention (thanks to CAF, faux123)

Build 1 (Base) - April 29, 2013

Everything from _motley's b49 build up to this point.

Built with the linaro 2013.04 gcc-4.7 toolchain

Thanks

Google - For AOSP sources

LG - for building the N4

Qualcomm/CAF - for their updates to the N4 kernel

_motley - for all his work on this kernel

faux123 - patches included that were initially written by him

franciscofranco - patches included that were initially written by him

showp-1984 - patches included that were initially written by him

anyone else i've neglected to include, if you feel you deserve to be thanked by name by all means PM me :D