Mittwoch, 11. August 2010

How To Patch Google's Android 2.6.32 Kernel

Just a short write-up for anyone who is interested in porting/playing with the current android kernel on their GW620/eve.

DISCLAIMER:
This patch only contains the bare minimum to get the kernel booted.
Only serial console and usb/adb works.
No (and i really mean _NO_) additional hardware beside board/cpu/serial/usb is supported (yet).
This is only useful for developers try to help porting!

you have been warned ;-)
  • First of all, get the sources:
    # mkdir android-msm-2.6.32 && cd android-msm-2.6.32
    # git clone git://android.git.kernel.org/kernel/msm.git .
  • Now get my patch:
    # wget http://github.com/maldn/eve/raw/master/google-32-eve-minimal.patch
  • And apply the patch:
    # cat google-32-eve-minimal.patch | patch -p1
  • Configure kernel:
    add CONFIG_MACH_EVE to your kernel-config (or if you use menuconfig, select System Type -> [*] eve)
  • Build:
    i use ccache, so my cmd-line looks like this:
    # make -j3 ARCH=arm CROSS_COMPILE="ccache /home/maldn/android/eclair/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-"
... that's it. How to get this running is subject to another post, so stay tuned :-)


maldn

Mittwoch, 4. August 2010

got 2.6.32 booting!

although this is a few weeks old ( i posted over at xda-developers about this already), i wanted to post it here too.

Booting Linux....
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.32.9-27239-g8097ca0-dirty (maldn@g550) (gcc version 4.4.0 (GCC) ) #12 PREEMPT Thu Jul 29 16:40:09 CEST 2010
[ 0.000000] CPU: ARMv6-compatible processor [4117b362] revision 2 (ARMv6TEJ), cr=00c5387f
[ 0.000000] CPU: VIPT aliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: eve-google-32
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] On node 0 totalpages: 57344
[ 0.000000] free_area_init_node: node 0, pgdat c03ed090, node_mem_map c04a5000
[ 0.000000] Normal zone: 448 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 56896 pages, LIFO batch:15
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 56896
[ 0.000000] Kernel command line: no_console_suspend=1 console=null

.. and so on.

thats a big step forward to get android 2.2 aka froyo working on the eve.

here is how i did it:
the first goal was to understand in which way the LG-supplied sources for 2.6.29 differed to "official" android kernel sources.
besides the google-kernel (http://android.git.kernel.org/) there is kernel code at codeaurora.org. LG forked their tree off of the codeaurora code.
so... forward port the LG specific code to the 2.6.32 branch of codeaurora and we're done, right?
well... the codeaurora forum is run by qualcomm, the company that builds the chipsets used in most (all?) android smartphones. and they want to sell new/more chipsets/phones, so their 2.6.32 code doesnt support the msm7201a chipset we use anymore. :-(
the google code does.
but it took me some time to figure that out.

first of all, i was looking at what LG changed to the kernel they forked from.
... and i was amused and shocked at the same time. i am pretty sure i have a better grasp of the kernel code than the lg engineers have, after i played with the code for about 3 weeks.
so much useless (as in dead) code, their own strange error-handling/displaying and whatnot... seriously, their code is mostly a mess. at least they marked all their changes within the code.
after a few days i had ripped most of the changes from lg out of their 2.6.29 tree. everything still working.

then i went on to port the minimal changes needed to get the kernel booting over to the 2.6.32 kernel from google. and .... it worked almost instantly! usb/adb took me another hour or so.
thats it for now. next big problem is the difference between codeaurora and google implementation of the drivers for the chipset. especially the mddi (google that) interface for the display drivers is completely different. that will take some time. maybe i will rant about that in another post ;-)


maldn