Home > Android, Linux, Mediatek MT65XX > Mediatek MT6589 Linux Source Code, CyanogenMod 11 Image for Wiko Stairway Smartphone

Mediatek MT6589 Linux Source Code, CyanogenMod 11 Image for Wiko Stairway Smartphone

Mediatek and their customers have still not gotten into the habit of complying with the GPL license, and releasing the relevant source code such as the Linux kernel. There appears to be at least one smartphone, Wiko Stairway, where the Linux kernel has been released, and chrmhoffmann, a members of XDA developers forums, has even released on unofficial CyanogenMod 11 ROM (Android 4.4.2 Kit Kat) for the device.

Mediatek_Linux_Kernel_Menuconfig

There are three source repositories for the Linux kernel, “android device“, and Android.

I’ve only looked into the kernel which is version 3.4.5. Mediatek has apparently messed up the Linux kernel quite a bit, and you’ll have to do some funny things to build the kernel, and all Mediatek options in menuconfig are in a sub-section called “Mediatek Properitary Configuration” (sic.), and it’s not possible to simply go to System Type menu to change the processor type for instance.

Let’s get the source first:

git clone https://github.com/chrmhoffmann/android_kernel_wiko_stairway
cd android_kernel_wiko_stairway/
ls
bionic  kernel  mediatek  README

So together with the kernel, we’ve got the bionic library, and the modifications done by Mediatek in the mediatek directory. The Makefile is this Linux kernel is set to use the Android gcc toolchain (arm-linux-androideabi-gcc), but I tried to build the kernel with CROSS_COMPILE=arm-linux-gnueabihf- instead, and it failed along the way with the following error:

fs/file_table.c: In function 'get_empty_filp':
 fs/file_table.c:36:20: error: inlining failed in call to always_inline 'fd_show_open_files': function body not available
 extern inline void fd_show_open_files(pid_t pid, struct files_struct *files, struct fdtable *fdt);
 ^
 fs/file_table.c:160:36: error: called from here
 fd_show_open_files(pid, files, fdt);
 ^
 make[1]: *** [fs/file_table.o] Error 1
 make: *** [fs] Error 2

This is from code added by Mediatek, and at first I just disabled it, but a similar problem occurred in the wlan drivers. Some research indicated in may be a toolchain problem, so I’ve installed the latest Linaro Android toolchain and added it to my path:

wget http://releases.linaro.org/14.02/components/android/toolchain/4.8/android-toolchain-eabi-4.8-2014.02-x86.tar.bz2
tar xvf android-toolchain-eabi-4.8-2014.02-x86.tar.bz2
export PATH=$PATH:~/edev/Mediatek/android-toolchain-eabi/bin/

And started the build:

cd kernel
TARGET_PRODUCT=wiko MTK_ROOT_CUSTOM=../mediatek/custom/ make -j8

Same error. So I gave a last try with an older Linaro Android toolchain using gcc 4.6, and this did the trick:

  LD [M]  mediatek/platform/mt6589/kernel/drivers/devapc/devapc.ko
  LD [M]  mediatek/platform/mt6589/kernel/drivers/dual_ccci/ccci_plat.ko
  LD [M]  mediatek/platform/mt6589/kernel/drivers/devinfo/devinfo.ko
  LD [M]  mediatek/platform/mt6589/kernel/drivers/gpu/pvr/mtklfb.ko
  LD [M]  mediatek/platform/mt6589/kernel/drivers/gpu/pvr/pvrsrvkm.ko
  LD [M]  mediatek/platform/mt6589/kernel/drivers/masp/sec.ko
  LD [M]  mediatek/platform/mt6589/kernel/drivers/videocodec/vcodec_kernel_driver.ko
  AS      arch/arm/boot/compressed/piggy.gzip.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready

As for the current CM11 ROM, phone calls, SMS, data (2G, 3G), Wi-Fi, audio, and most sensors are working fine, but there’s still more work to do as the second SIM card, the camera, hardware video decoding, GPS, Bluetooth, FM radio and some MTK specific features are not supported yet. It may not be wise to try it on MT6589 hardware other than Wiko Stairway, as you may brick your device.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. Diego.
    March 13th, 2014 at 15:31 | #1

    I really hate when hardware vendor release (or even try not to release) broken software. Sorry Mediatek, I won’t buy you.

  2. March 13th, 2014 at 17:37 | #2

    It’s actually a proper release from Wiko – http://geek.wikoplus.com/index.php?telephone=STAIRWAY&region=FRANCE-FR

    And it’s not the first device with GPL source code from manufacturers:
    http://developer.sonymobile.com/downloads/xperia-open-source-archives/open-source-archive-for-build-16-0-a-0-47/
    https://github.com/oppo-source/R819-Kernel-Source-4.2
    etc…

    More @ http://www.hacktohell.org/2013/07/mediatek-mt6589-complete-source.html

    Of course the ThL, Zopo, Tronsmart.. of this world did not release anything…

  3. Harley
    March 13th, 2014 at 23:14 | #3

    Any VPU libraires or scource code for hardware video decoding on Mediatek SoCs from themselves or its partners?

  4. Diego.
    March 14th, 2014 at 17:07 | #4

    @cnxsoft
    By broken software I mean the bad habit of not even remotely thinking of merging work upstream, and hacking something that works only on kernel x.y, builds only on toolchain A version B, dropping tar.gz instead of publishing on git, etc. I know that’s “open source” too, but I tend to don’t buy everything that is and probably won’t be merged in mainline. Support is likely going to last less than 1 year instead of several decades (as it’s the case for Intel 486).

  5. Diego.
    March 14th, 2014 at 17:08 | #5

    @Diego.
    I meant “that is not merged in mainline”.

  6. DerTeufel
    April 21st, 2014 at 14:25 | #6

    compiling errors, caused by newer toolchains and related to inlinig aren’t something special for mtk. i have had this as well on samsung and nexus devices. fixing it isn’t too hard…

  7. DerTeufel
    April 21st, 2014 at 14:29 | #7

    btw: trying to compile with linaro 4.8 toolchain is kind of funny. there are plenty of android kernels out there which don’t compile with it, without modifying the source. and even if it builds, the kernel often doesn’t boot.

  1. No trackbacks yet.