[Nexus 7 Original Development] _motley:
motley kernel for the Nexus 7 and Jellybean

Disclaimer: You know the gig...I am not responsible for damaging your device or voiding your warranty. Play at your own risk!

ROM devs/cooks: If you want to use this kernel in your ROM, I am fine with that, but please include a "thanks" and a link back to this thread. Thanks!

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

You must be unlocked and rooted.

You must have custom recovery installed (CWM or TWRP) to install the kernel.

Busybox is required for init.d support.

Do a backup using custom recovery (CWM or TWR) so you can restore your boot.img and ROM if necessary!

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

System Tuner is recommended for tuning the CPU, especially for voltage control.

Main Features

GPL compliant - source is kept up to date at github.com and released at the time the kernel is released to the public for

all

builds. Ask other devs to do the same!

Asus\Nvidia\Google Linux 3.1.10 base. All stock features are supported (camera, OTG, NFC etc.)

OC to 1.6GHz (optional)

Voltage control - be careful to not save the setting on boot until you are 100% sure!

GPU OC from 416 to 520MHz (default is 446, adjust as you wish up to 520MHz)

Dynamic EDP - allows EDP to remain enabled (safer), but with an added simple temperature throttle switch (based on Asus Prime)

Compiler optimizations (-O2) - using Linaro 4.7 ARM toolchain

I/O schedulers - row (default), SIO, V(R), CFQ, NOOP, and deadline

TCP Congestion Control - default cubic + several different algos to choose from.

ZRAM - must be enabled by a script

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

initramfs - insecure (your ROM must have busybox)

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

fsync sysfs enable/disable switch (defaults to fsync enabled)

kexec with hardboot (for supporting Linux/MultiROM)

Many other misc patches and tweaks (see github link below)

Install:

Check the requirements above!

Flash the zip using custom recovery (no need to wipe anything)

See post 2 for performance tweaks and more info

build #249 for Jellybean 4.2.2 - WiFi and 3G 2013-02-24

Added ability to change GPU clock speed at runtime (referenced franco, morific, and metallice git repos)

Added row io scheduler and set as default (Tatyana Brokhman)

Added TCP Congestion Control, several different algos to choose from. Default is cubic (stock).

Added optimized ARM RWSEM (Ezekeel)

Input patch (Henrik Rydberg)

View attachment 1757649

build #247 for Jellybean 4.2.2 - WiFi and 3G 2013-02-17

Merged 4.2.2 patches

Updated Linaro toolchain to 2012.12

View attachment 1738882

build #246 for Jellybean 4.2.1 - WiFi and 3G

kexec\MultiROM support

Download from here since I posted in the MultiROM thread

build #244 for Jellybean 4.2 - WiFi and 3G - Recommended for WiFi and 3G on 4.2.x

446 GPU build (stock + 30MHz). Let's see if this fixes touchscreen issues for those having them. My theory is that after the GPU heats up, this starts to affect touchscreen behavior on some devices. This is likely what happened to me on build 234 when I was testing. The GPU definitely gets hot on this device even with normal usage at 484+. At 446 this doesn't happen. IMHO, we are reducing the life of the device by overheating the GPU repeatedly. My Antutu scores actually tested higher after I flashed the 446 build.

Supports Android Jellybean 4.2.x

Reverted some commits from 233

Removed KSM from config, no ROM is using this AFAIK

Panel clock reduced to match Nvida cardhu sources (74180000). Having the panel clock cranked up fakes out scores on some benchmark tests, but adds no real value.

View attachment 1570362

Previous builds and release notes

build #234 for Jellybean 4.2 - First properly working 3G build

Supports Android Jellybean 4.2.x

Only change - added CONFIG_USB_NET_RAW_IP=y to hopefully address any issues with 3G (reported working by DiamondBack)

View attachment 1526085

build #233 for Jellybean 4.2 - if you don't have issues with GPU OC @484, this build may work well for you.

Supports Android Jellybean 4.2.x

Updated to latest Linaro toolchain 2012.10.22 and tweaked some compiler options.

Should support 3G as I have merged the Google patches, but I have not tested this.

Removed WiFi PM_FAST toggle as I see no need for this (PM_MAX for better battery is already the default in stock)

Stopped logging temp warnings until lit gets to 65C near the EDP throttle limit.

Quad-core tweaks - referenced showp1984's bricked grouper kernel source

See github for other minor details.

View attachment 1523179

build #232 - Recommended for WiFi on 4.1.2

Added support for Android Jellybean 4.1.2

Updated to latest Linaro toolchain 2012.10.22.

View attachment 1527542 (GPU OC 484MHz)

stable v1.1.1 - builds #218-220 - Recommended for WiFi on 4.1.0 or 4.1.1

Supports Android Jellybean 4.1.1 or 4.1.0

DVFS tweaks and drop top cpu frequency to 1600, not much is lost and it should now be stable for everyone I hope. We pushed the envelope to 1.7 and 1.624 and now we are back to real world sensible decisions. My Nenamark2 520 GPU scores actually went up.

Dynamic EDP temp adjusted from 67 to 68C to catch temp notifier quicker when cooling back down.

Other miscellaneous patches

Just in case, please note and then unset your saved voltage control settings before using the new version. You may need to clear your System Tuner App data to see the correct frequencies. Remember that the DVFS table and the scaling frequencies are different in some cases (see the second post for details)

View attachment 1252910 (GPU stock 416GHz)

View attachment 1252909 (GPU OC 484MHz)

View attachment 1252907 (GPU OC 520MHz)

alpha v1.1.0 - builds #213-215

Added fsync sysfs enable/disable switch (thanks Ezekeel). fsync is still enabled by default. For more info and how to disable, see post 2.

Experimental: now forging speedo id 4 and process id 2 so that EDP limits are slightly raised and it narrows everyone down to a common DVFS record for everyone. Raised Dynanic EDP governor to 67C (from 60C) to give a little more room before edp is allowed to enable.

Minor cpu voltage table tweaks aiming for slightly better battery for those that don't undervolt.

Lowered the cold offsets from 50 to 25 for the top 4 cpu voltage slots. This will give folks a little more breathing room when undervolting and may help cold performance a bit if your voltages are lowered close to their lower limit.

Deadline i/o scheduler (morfic's secret 1:1 sauce that I remember back from my Iconia A500 days!). SIO is still the default, but we can try it out and see what we think.

OnDemand really wasn't usable in it's stock state since it was so laggy, so I have made some tweaks to the tuneables and it seems to be better now for those that want to give it a spin. Interactive is still the default governor.

cpu transtition latency lowered - fairly certain that it only affects OnDemand governor and not Interactive (reference morfic and http://permalink.gmane.org/gmane.linux.ports.tegra/1649)

Reverted most of the adjustments to the tegra 3 algorirthim for bringing cpus online and offline. I think it livened it up, but at the expense of battery.

Added kernel config option BCMDHD_WIFI_PM (thanks Ezekeel). See post 2 on how to enable it (not recommended unless you have music steaming issues when the screen is off). Not yet tested.

Other miscellaneous tweaks

Just in case, please note and then unset your saved voltage control settings before using the new version. You may need to clear your System Tuner App data to see the correct frequencies. Remember that the DVFS table and the scaling frequencies are different in some cases (see the second post for details)

View attachment 1250364 (GPU stock 416GHz)

View attachment 1250361 (GPU OC 484MHz)

View attachment 1250363 (GPU OC 520MHz)

stable v1.0.12 - builds #175-177

Changed highest frequency back to 1.624GHz and core voltage back to 1200mV. After experimenting with higher core voltages and 1.7GHz probing our limitations, it just doesn't seem right on this tablet. Why fry the butter?

CPU voltage is capped at 1237, so don't set it higher than that if tuning.

Refresh rate now adjusted with GPU OC clock at compile time. Higher FPS should be realized at 484 and 520 for most (thanks to clemsyn for sharing his research and findings)

Adjustments to the tegra 3 algorirthim for bring cpus online and offline, especially for the OC frequencies.

Fixed GPU clock compile time switch. Removed 500MHz choice.

Set cpu frequency policy to 1.3GHz on startup. This should help with heat build-up on startup and users where the highest OC clock rate is not desired.

Lowest brightness setting set back to stock since several users were requesting it (18 back to 13).

Minor adjustment to the interactive governor to make it slightly more responsive when demands increase.

PowerHAL change so it doesn't mess with a couple other interactive governor tunables on init.

All frequencies throughout the power range should be used in a more balanced manner.

Just in case, please note and then unset your saved voltage control settings before using the new version. You may need to clear your System Tuner App data to see the correct frequencies. Remember that the DVFS table and the scaling frequencies are different in some cases (see the second post for details)

View attachment 1240026 (GPU stock 416GHz)

View attachment 1240020 (GPU OC 484MHz)

View attachment 1240024 (GPU OC 520MHz)

alpha v1.0.11 - builds #126-128

Changed highest frequency from 1.624 to 1.7GHz

Increased core voltage for the highest frequency to 1250mV. This should bring some increased stability at the highest two overclock frequencies (thanks to clemsyn and Pinoyto for their help)

Tweaked DVFS table for the GPU. It should now scale a bit better and still bring the same performance and the top end.

Lowest brightness setting increased from 13 to 18 (thanks to clemsyn). Lets give this a try and we can increase it further if need be. The brightness levels can be tweaked on the ROM side as well in the N7 device tree, at least when you build from scratch, so we don't want to be too limiting here.

PowerHAL fix now included /vendor/lib/how/power.grouper.so (thanks to imoseyon). See this post to see the code I changed.

(Removed download links since many were reporting random reboots. I think v1.0.12 is better anyhow;))

stable v1.0.10 - build #110/111

CPU frequecies back to 1400, 1500, 1600, and 1624 (leaving the new highest setting)

DVFS table tweaks

Frequency table fix fix for 1624 (thanks to Clemsyn for bringing to my attention!)

Only stock and 484MHz GPU OC version - code switch is still there for those that want to compile and experiment. Moving beyond 484 doesn't show any benefit. My best Nenamark2 score 62.7 was achieved on 484MHz.

Just in case, please note and then unset your saved voltage control settings before using the new version. You may need to clear your System Tuner App data to see the correct frequencies. Remember that the DVFS table and the scaling frequencies are different in some cases (see the second post for details)

experimental v1.0.9 - builds #102-105

CPU OC to 1.624GHz - higher end CPU frequencies are now at 1408, 1504, 1600, and 1624 (old 1400, 1500, 1600, N/A)

DVFS table tweaks -

Just in case, please note and then unset your saved voltage control settings before using the new version.

GPU versions stock, 484, 500 and 520MHz builds for testing

Added a GPU OC kernel config choice switch to allow compile time selection of GPU speed (446, 484, 500, or 520MHz).

NTFS r/w enabled

PegasusQ governor no longer built in, but code remains if we want to look further into when time allows.

Reduce some temp reporting kernel log spam until the temp gets a little higher

stable v1.0.8 - build #77/78

Added PegasusQ governor - experimental only, not enabled by default (thanks Samsung SGSIII source and gokhanmoral for tweaks)

Revert "HACK: block fbearlysuspend to not break androids crt-off animation"

Added LulzActive governor, but not built-in due to issues.

stable v1.0.7 - build #70/71

Voltage Control tweak - let's ignore the highest freq slot for show and

save since it shows 1.6GHz twice in the voltage table in System Tuner.

We are are only allowing 1200mV for 1.6, so the top slot is not

currently used. See my notes in post 2 about voltage control.

cpu-tegra: let's skip the temporary downclock and kernel log spam if the

custom Dynamic EDP throttle is not currently enabled.

ARM/VFP compiler optimization

compilation: fix annoying and serious warnings (thanks faux123!)

video: tegra: host: Fix error case memory leaks

When a submit fails, the related nvhost_job is not freed. Add an

explicit free. Also, 3D is mapping the save buffer, but it is not

unmapped (Nvidia)

mm: Ensure pte and pmd stores ordering (Nvidia)

Get rid of some more kernel log spam.

HACK: block fbearlysuspend to not break androids crt-off animation

(thanks codeworx, drewis (repo) and aaronpoweruser for pointing it out). This is untested (by me), but this may help with ROMs that

have this functionality (AOKP etc.)

cpu-tegra3: modified the hot-plug governor down_delay to be 1s

instead of 2s

stable v1.0.6 - build #47/48

GPU clock increased to 484MHz - Nenamark2 scores of 61+

More compiler optimizations (-fmodulo-sched, -fmodulo-sched-allow-regmoves, -funswitch-loops, -fpredictive-commoning, -fgcse-after-reload, -ftree-vectorize, -floop-interchange, -floop-strip-mine, -floop-block, -mfpu=neon )

Now using Koush's AnyKernel delivery method. Uses your existing ramdisk so you can easily use with any ROM.

stable v1.0.5 - build #39

Honor your max frequency fix - no more spikes

alpha v1.0.4 - build #38

Fixes units that can't OC (process_id = 3)

Linaro 4.7.1 toolchain -O2 (2012-06-25)

Increased panel clock rate - increases fps without further GPU clock Nenamark2 scores 59.6 best score so far for Nexus 7

ramdisk added back in boot 1.3GHz, but device still spikes to max allowed CPU freq sometimes (see update below, will be fixed in 1.0.5)

Minor clock and voltage adjustments - should run a bit cooler and use less battery.

Added GPU OC compile switch in case we want a non-OC GPU build.

Added some VPN/networking capabilities for those that need it (L2TP, IP_GRE_DEMUX,INET_AH, INET_XFRM_MODE_BEET)

Some unnecessary debugging options turned off. Should save kernel RAM usage.

Some say it made wifi signal stronger again for them, but I never had any issues. Might be the toolchain and its effect on the broadcom driver. Reports that it is better are fine with me!

alpha v1.0.3 - build #17

UV support, minor voltage adjustments

V(R) i/o scheduler added

ramdisk removed custom init.rc line...hope this will fix the stock units that weren't booting!

alpha v1.0.2 - build #6

Mild GPU OC from 416 to 446MHz - baby steps...its been rock solid so far. NenaMark 2 scores are up from 55 to 57.2fps. A future release may have two versions, one with GPU OC and one without.

Upgraded toolchain to GCC v4.6.3 optimized google version by ezterry, see http://xdaforums.com/showthread.php?t=1686310)

alpha v1.0.1 - build #4

Limit frequency to 1.3GHz on boot. It can then be OC'ed from there. This should make it safer for those that can't OC or don't want to.

Changes to allow OC for Process ID's 0 and 1. Theoretically, these should be earlier release versions like IO and earlier.

alpha v1.0.0 - build #1

This initial alpha release is working well on a Nexus 7 16GB (Speedo ID 7/Process ID 2) on JB 4.1.1. There are no open issues that I know about. Looking for some advanced users and testers to give some feedback, and then we can hopefully make it even better!

Thanks to:

fordwolden - for his generous donation of a Nexus 7

Google and Asus for releasing a nice, open, and inexpensive tablet for the masses.

drewis (Andrew Sutherland) - for the base kernel on github

paulobrien - thanks for the CWM touch recovery

birdman and FadedLite for their Unlock\Rooting instructions

clemsyn for his ideas and insight

Git repo:

https://github.com/motley-git/Kernel-Nexus7

(http://www.gnu.org/copyleft/gpl.html)