[Nexus 7 Original Development] PJBrs:
tegra3 kernel 3.4 progress report for A2109 (kai)

Hey [MENTION=4619263]sheffzor[/MENTION] , [MENTION=2633638]Ziyan[/MENTION], [MENTION=7401277]DevUt[/MENTION],

Here's a little report on my progress porting kernel 3.4 to A2109.

I've got most issues solved, except two: sound via bluetooth (any suggestions?) and screen flashing (disable HW-overlays for a workaround; I think grouper Lollipop blobs don't have this issue, but then I lose camera; suggestions for an open source V4L camera hal extremely welcome). The rest all seems fine! I'm finally eyeing Marshmallow, still have to sort what to do with the blobs.

Those looking for more inspiration can find my tree at github, name of A2109-linux-tegra-nv-3.4-CLEAN. I applied my commits to nvidia's latest 3.4 tree. I still need to merge it to Google's 3.4 tree. Instead though, I might just switch to your tree and pull in my changes :)

There were some issues that I worked around. Most importantly, I disabled powergating for 3D, because otherwise I got a kernel warning and then Android rebooted (see the commit for details). Furthermore, a couple of files in /sys get placed elsewhere and A2109 blobs don't like that (new grouper blobs don't mind). That's why I reverted many changes to the tegra_fuse driver. (I also had to binary hack libnvrm_graphics.so.) I had to comment out the boost function in the tegra usb gadget driver or suffer reboots as well. Finally, the set smaller voltage range for vmmc was necessary to prevent a kernel panic pretty early on during boot (no adb).

The remainder of the changes should be pretty straightforward. Note that A2109 uses the max77663 regulator, just like some grouper models. Perhaps you can find some inspiration to fix bootloops here? Also, A2109 appears to have a charger circuit (smb349) rather similar to yours (smb347). I had to implement some fixes because somehow certain charger registers didn't get updated correctly anymore.

Here's a list of the commits that I made:

[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/5fd2d3182052050332e98e2b401cd97d0c03d8c3"]5fd2d31 smb349-charger: Add back in Lenovo's charger config[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/68d2a01729f947967f29f28434896069ca986aac"]68d2a01 Disable powergating for TEGRA_POWERGATE_3D and TEGRA_POWERGATE_3D1[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/97d1604f4d1a3658436d3a88e7d9a4e8c150e4e2"]97d1604 Do not release tegra bootloader framebuffer on startup[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/956319fd39ff5710417d7e3e78099b9e99fa7cde"]956319f Add A2109 defconfig[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/5f00ebec37b16a698c07d3439811e32473d09aae"]5f00ebe smb349-charger: work around registers not detecting AC charger[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/8f697ae5409b1138a4b90ea2cf54544eabf601b6"]8f697ae kai: Increase pixelclock to prevent display artifacts[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/ae8c0407278ca6ca3cf55dfc37211c1d1a9a641f"]ae8c040 Comment out the boost function in drivers/usb/gadget/tegra_udc.c[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/b7753d3340d84000cf5f690cdb124ad6e9afa475"]b7753d3 Revert fuse to non-platform driver[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/ba84a9648d9408a885ec8c47b476049b8faab8ad"]ba84a96 Set smaller voltage range for vmmc regulator[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/79a42d0bc54450abebd526303b3fcc8b97fba461"]79a42d0 Add A2109 board file changes for kai[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/967858d09c924538a7cc4970ac0c2181f6d33d01"]967858d Switch to Lenovo's driver and codec for aic326x[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/e6a90ec36a5d253543187ba49e7d50e46f44043c"]e6a90ec bluetooth: bluesleep: add bluedroid support[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/fc60e9936b03cc03be61591957c5cd0668c9ce4b"]fc60e99 Add Solteam JSA1127 Ambient Light Sensor Driver from Lenovo sources[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/8cb6a052c8bd2c7d770292ac91e1175ecc074553"]8cb6a05 Add gpio drivers for power button and Gensor rotation lock switch[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/c8f17f115470e1cd907fe7ed50a37cbeb5e384ff"]c8f17f1 A2109: Add int cl2n_get_board_strap and tegra_get_hw_ramcode[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/f4f9905e2f5ef231ef15c18e31e325a31447796a"]f4f9905 Add tegra camera drivers mt9m114 and s5k5cag[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/935cd979c5b9877dd4fe10acfa7133a484a690d5"]935cd97 Revert "media: video: tegra: mt9m114 sensor kernel driver"[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/e22bad95517b8ca58e4d67c95478b15f86081fc1"]e22bad9 Add lis3dh accelerometer driver[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/8929d5e0760fdf7e65883cb2d4f22b0499730051"]8929d5e Add ft5x06 touchscreen driver[/URL]
[URL="https://github.com/PJBrs/android_kernel_lenovo_kai/commit/2f3b5c5d442f1d2367b67dc529a0e207cddc2397"]2f3b5c5 Add bq27541 battery driver[/URL]

You can find my development thread elsewhere, on androidtablets. I hope some other interested tegra3 developer might find this thread and use it too.