Home > AMLogic, Linux > Amlogic GPL Source Code Release – Kernel 3.10, U-Boot, and Drivers (Wi-Fi, NAND, TVIN, Mali GPU)

Amlogic GPL Source Code Release – Kernel 3.10, U-Boot, and Drivers (Wi-Fi, NAND, TVIN, Mali GPU)

Last month, I noticed Amlogic provided links to the Android SDK for S802 / M802 on their open source website, but the only way to get the source was to share your SSH public with Amlogic, so that they give you access. It did not happen, but the company has released the source for Linux 3.10.10, U-boot 2011.03, Realtek and Broadcom Wi-Fi drivers, NAND drivers, “TVIN”drivers, and kernel space GPU drivers for Mali-400 / 450 GPU. There are also some customer board files for Meson 6 only (AML8726-MX / M6) but they do not seem to match the kernel…


If you want to build the kernel, including the drivers, you’ll need to download a bunch of files:

wget http://openlinux.amlogic.com:8000/download/ARM/kernel/arm-src-kernel-2014-03-06-d5d0557b2b.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/wifi/rtk8192du-2014-03-06-7f70d95d29.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/wifi/rtk8192eu-2014-03-06-9766866350.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/wifi/rtk8192cu-2014-03-06-54bde7d73d.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/wifi/rtk8188eu-2014-03-06-2462231f02.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/wifi/brcmap6xxx-2014-03-06-302aca1a31.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/wifi/wifi-fw-2014-03-06-d3b2263640.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/modules/aml_tvin-2014-03-06-fb3ba6b1c8.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/modules/aml_nand-2014-03-06-39095c4296.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/customer/aml_customer-2014-03-06-76ce689191.tar.gz
wget http://openlinux.amlogic.com:8000/download/ARM/gpu/gpu-2014-03-06-0425a1f681.tar.gz

You’ll need to extract these tarballs in specific directories:

You can also extract the customer file into the kernel directory to add some drivers. As I said above I’m not sure the source code inside matches the Linux kernel 3.10.10, because there’s now device tree file for the boards. In arch/arm/plat-meson/Kconfig, there are (commented out) references to customer/meson/dt/Kconfig and customer/drivers/Kconfig. The device tree is not available, but the drivers is, so you could give a try in order to build the touchscreen and sensors drivers available in the customer tarball:

Finally, the development tree is ready to build the kernel. There must surely be a script somewhere to do that… I haven’t used the file wifi-fw-2014-03-06-d3b2263640.tar.gz, as the kernel did not complain about it, and it looks like it’s just for Android Kit Kat. There are four scripts to build the kernel: mk_m6.sh, mk_m6tv, mk_m6_tvd.sh, and mk_m8.sh. The first three are for meson6 (dual core processor), and the last one meson8 (quad core S802/M802).

Let’s go with M8 build:

Please not that I had to change mk_m8.sh, as it should just make computer hand requiring a hard reset. The culprity was the line:

The manpage indicates “If the -j option is given without an argument, make  will  not  limit  the number of jobs that can run simultaneously”.  It does not seem like a good idea… ,s so I changed that to

Upon successful build, the end of log you look like:

UIMAGE arch/arm/boot/uImage
Image Name: Linux-3.10.10
Created: Mon Mar 10 11:48:52 2014
Image Type: ARM Linux Kernel Image (lzo compressed)
Data Size: 7099978 Bytes = 6933.57 kB = 6.77 MB
Load Address: 00008000
Entry Point: 00008000
Image arch/arm/boot/uImage is ready
/home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/scripts/amlogic/aml2dtb.sh /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dtd
DTD_FILE: /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dtd
the middle dts file: /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts
process file /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts start
processing... please wait...
process file /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts end

CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
DTC arch/arm/boot/dts/amlogic/meson8_skt.dtb
rm /home/jaufranc/edev/AMLogic/s802/linux-amlogic-3.10-bringup/arch/arm/boot/dts/amlogic/meson8_skt.dts
-rw-r–r– 1 jaufranc jaufranc 11244948 Mar 10 11:48 ./m8boot.img
m8boot.img done

If you want to get U-boot code it’s not quite as messy, you jut need to download and extract two files:

Then just select a board in customer/board/ to build U-boot for your hardware. For example:

The build failed for me, but it might be I may need to use another compiler, e.g. arm-none-eabi-gcc.

[Update: arm-none-eabi-gcc does seem to go further, but you’ll also need an arc compiler as shown in my previous Amlogic U-boot build instructions].

Thanks to M][sko for the tip.

  1. Harley
    March 10th, 2014 at 16:59 | #1

    Nothing about Android 4.4 (KitKat) SDK, kernel, or other source code yet?

  2. dekswizard
    March 10th, 2014 at 18:59 | #2

    It’s amlogic, what do you expect…

  3. March 10th, 2014 at 20:31 | #3

    Harley :
    Nothing about Android 4.4 (KitKat) SDK, kernel, or other source code yet?

    Aml never released any of its full sources, you have to sign SLA with them for that. However, on their openlinux they claim kitkat and its kernel (3.10) also supports MX g18ref board, but I cant confirm that, these files still downloading (poor speed) and dont have yet access to kitkat repository. 4.3 didn’t have MX support.

  4. March 10th, 2014 at 20:59 | #4

    The kernel I’ve built in this post is for Android. (CONFIG_ANDROID=y).
    I doubt they release the Android SDK, because they don’t have to (Apache license).
    But as far I can see they’ve released pretty much everything, except the Android SDK. We have to see if it can work on actual hardware. Their code will only work on their development kit, which we can’t buy, so people will still have to modify the code themselves, unless the manufacturers release the code for their devices.

  5. March 10th, 2014 at 22:49 | #5

    Github mirror, except for wifi-fw – https://github.com/Stane1983/amlogic-mx-m8

    As mentioned, these sources are taken from full droid source tree. everything in kernel/hardware folder should be outside of kernel folder or Kconfig and Makefiles have to be modified. There is good chance that kernel will work with MX also as it has meson6_defconfig and device tree files for g18, g24, g33 and g35 boards.

  6. anonymous
    March 10th, 2014 at 22:53 | #6

    No meson3 support?

  7. March 10th, 2014 at 22:59 | #7
  8. March 15th, 2014 at 10:05 | #8

    Kernel mentioned here patched to version 3.10.22 and booting on Visson ATV-102s device: http://pastebin.com/Z1sZv5gk

  9. m][sko
    March 15th, 2014 at 22:02 | #9

    Another news
    they also release buildroot

  10. m][sko
    March 15th, 2014 at 22:07 | #10

    Stane1983 :
    Kernel mentioned here patched to version 3.10.22 and booting on Visson ATV-102s device: http://pastebin.com/Z1sZv5gk

    Except two backtraces and we are ready to go 🙂

  11. m][sko
    March 15th, 2014 at 22:09 | #11

    and new kernel

  12. m][sko
    March 15th, 2014 at 23:01 | #12

    There is mali r4p0-01 driver in buildroot
    but they have two separate r3p2-01re3 drivers for mali 400 and 450
    and some driver called r3p2-EAC

    there is also amlogic all player 🙂 libplayer for m3,m6, m8

    and they made gstreamer 0.10/0.11 plugins.

  13. m][sko
    March 15th, 2014 at 23:35 | #13

    btw latest kernel from amlogic page is old 3.0.50

  14. SpAiK
    May 12th, 2014 at 23:25 | #14

    Hi people! I’m new to Android source and I was investigating on compiling the source for my tvbox (AML8726-MX based, Gbox Midnight MX2). I see Amlogic’s Openlinux website has Kitkat available for this, but as mentioned I need to be granted access to it. Isn’t there any other way to get it?

  15. Alain Theriault
    May 13th, 2014 at 00:40 | #15

    How would I get Linux running on my M8 with these files?

  16. May 13th, 2014 at 20:25 | #17

    Thanks for your work! I have compile the kernel, but found two thing:

    1.The 3.10.10 kernel doesn’t support sd cardreader at present? There was cardreader support in 3.0.50. But one line (related to cardreader) was commented out in drivers/amlogic/Kconfig. I tried to uncomment it, but get error when compiling.

    2.I turn on the CONFIG_AMLOGIC_USB, but still get no usb support.(that means, when I plug a usbstick, there is no message in dmesg, and no device such as /dev/sda).

    Thanks for your time!

  17. May 13th, 2014 at 20:28 | #18

    Forget to mention, the usb support problem is in 3.0.50 as well. But since with 3.0.50 kernel I can use sd card as rootfs, that’s not a big problem. But as in 3.10.10, there is no sd card support as well as usb support, I can boot from nowhere.

  18. May 13th, 2014 at 21:30 | #19

    I’ve just tried a USB flash drive, and I can mount it. (/dev/sda1)
    Same for the micro SD card (/dev/mmcblk0p1).

    Are you sure you’ve got the right DTD file?

  19. May 13th, 2014 at 22:08 | #20

    Thanks for reply so fast! I ‘m quite new to kernel on arm. What is DTD file?(I ‘m sorry if it sound stupid).

  20. May 13th, 2014 at 22:22 | #21

    Ok, by googling I found this page http://superuser.com/questions/736500/what-is-a-u-boot-dtb-file-and-how-do-i-use-it-beagleboard-xm . So I think dtd(dtb?)file is the file from uboot to tell the kernel “where to communicate with hardware”. Am I wrong?

    Now the problem is, I compile the kernel by a script (mk_m6.sh), and it read:

    make meson6_skt.dtd
    make meson6_skt.dtb

    #cd ../root/g18
    #find .| cpio -o -H newc | gzip -9 > ../ramdisk.img

    #rootfs.cpio — original buildroot rootfs, busybox
    #m8rootfs.cpio — build from buildroot

    #cd ..
    ./mkbootimg –kernel ./arch/arm/boot/uImage –ramdisk ./${ROOTFS} –second ./arch/arm/boot/dts/amlogic/meson6_skt.dtb –output ./m6boot.img
    ls -l ./m6boot.img
    echo “m6boot.img done”

    Is this right? Do I have to modify something?

    Thanks for your time!

  21. May 13th, 2014 at 22:39 | #23

    Thanks for your reply! I ‘ve tried your method, but get sad result:

    ➜ MBX ../split_bootimg.pl boot.img
    Page size: 2048 (0x00000800)
    Kernel size: 3407417 (0x0033fe39)
    Ramdisk size: 1050638 (0x0010080e)
    Second size: 0 (0x00000000)
    Board name:
    Command line:
    Writing boot.img-kernel … complete.
    Writing boot.img-ramdisk.gz … complete.

    There ‘s only two files, no “second file”……

  22. May 14th, 2014 at 10:21 | #24

    That’s because the firmware is using 3.0.50, right?
    So there’s no device tree file. By the way DTS/DTD are text files, and DTB is the compiled binary. I’m not 100% sure of the difference between DTS and DTD. I guess DTS and DTSI define different subset, and DTD defines all that in one and only file.

    Anyway, back to your issue. I guess your USB ports and SD card are not working because the pin assignment are wrong. If you don’t have firmware with kernel 3.10 and the device tree file, it’s a bit more complicated as you need to reverse engineer the DTD file in the source tree. Start with a similar hardware (meson6_something.dtd), look at the kernel log of a working Android firmware, and try to find which pins are used. If you may also need to check the board to find out where the right pins are with multimeter / oscilloscope…

  23. May 14th, 2014 at 11:16 | #25

    Yes, the firmware is 3.0.x. I also found a page related to my issue http://superuser.com/questions/740322/how-do-i-get-usb-devices-working-with-beagleboard-xm-and-yocto-project-linux
    This guy ‘s problem is just the same as mine. But he solved the problem by just deleting the ‘second file’, and I failed. I tried to generate a boot.img without a ‘second file’:
    ./mkbootimg –kernel ./arch/arm/boot/uImage –ramdisk ./rootfs.cpio –output ./m6boot.img
    but this img cannot be booted. It will hang on ‘starting kernel…’ after u-boot tried to boot it.
    And I even have tried to boot the uImage directly, and it hangs as well.

    BTW, is the ‘ramdisk’ that used to generate the boot.img related to the rootfs that I try to boot in? Since I found two lines in mk_m6.sh:

    #rootfs.cpio — original buildroot rootfs, busybox
    #m8rootfs.cpio — build from buildroot

    But I ‘m not using ‘busybox’, I ‘m using a complete rootfs(gentoo stage3, in fact), is that related to my issue?

    Thanks for your time!

  24. May 14th, 2014 at 11:58 | #26

    My guess is that:
    With Linux 3.0.5, the board file does not correspond to your hardware.
    With Linux 3.10, the device tree file does not correspond to your hardware.

    So funny things happen. So you may have to modifies the source code with 3.0.5, or modify a DTD fie with 3.10.

  25. May 14th, 2014 at 12:01 | #27

    I did some work and found some interesting things.
    I boot the official android firmware(boot.img), and capture the kernel log: http://bpaste.net/show/275140/
    Note the 5th line:
    [ [email protected]] Machine: Amlogic Meson6 g02 customer platform

    It give me some information, so I do a find in the kernel source directory

    find . -name “*meson6_g02*”

    and it gives:

    so it isn’t ‘meson6_defconfig’, it should be:

    make ARCH=arm meson6_g02_defconfig

    but then it tells me ‘no rules to make the target’, since the config files is not included(sourced) by any other file. Then what should I did?

    Thanks for your patience!

  26. May 14th, 2014 at 12:06 | #28

    Well, both approach is too hard to me… slim hope, right?

  27. May 14th, 2014 at 12:48 | #29

    Or try to find if your hardware is already supported by XBMC Linux, then somebody must already have done the hard part. Actually if you don’t need to modify the kernel, you could always try with the boot.img from your Android firmware. Some permissions issues (e.g. network) may occur, but solutions can probably be found on the net.

  28. May 15th, 2014 at 12:22 | #30

    I need to modify the kernel since I need the “nfs server” feature, I even want it to be up-to-date, since the nfsv4 support is experimental in 3.0.50, but stable in 3.10.10…
    There ‘s a XMBC for aml8726-mx (http://forum.xda-developers.com/showthread.php?t=2418029) but I haven’t tried it yet, and as I say above, I need to modify the kernel anyway…

    Maybe I should buy a atom board and play, and throw all these arm sh*t away…

  29. January 9th, 2015 at 14:25 | #31
    • January 9th, 2015 at 14:37 | #32

      It should be the Linux kernel for AM8726-M3 single core processor.

  30. January 9th, 2015 at 22:58 | #33

    That’s what I’m looking for. I wish I could build an image for the AM8726-M3 so I can bring back my old DVBS-2 STB alive.

  31. Bobby
    March 13th, 2015 at 17:51 | #35

    I’m trying to compile the latest release (2015-01-15) on Ubuntu 14.04.2 for S805. The extraction of archives seem to be the same as described here, but I get a number of compilation errors that do not seem related to problems with the directory structure (errors with regards to code loops and optimization – -Werror=aggressive-loop-optimizations, e.g. in the 8188eu). I’m using the Ubuntu repo version of arm-linux-gnueabihf-gcc (version 4.8.2). Is this the correct compiler to use for this kernel release?

  32. Bobby
    March 31st, 2015 at 03:48 | #36

    Thought I’d reply to my own comment: You have to use the old gnueabihf-gcc from the amlogic website (The 4.7.3 Linaro prerelease version). Then the kernel and modules compile.

  33. August 25th, 2015 at 11:28 | #37

    @Bobby any luck with that.. i’m cross-compiling the kernel for the S802 with the rlease_default settings from AMLogic buildroot settings …

  34. Jeff
    August 13th, 2016 at 20:30 | #38

    I am really trying to get this compile, but getting errors during the uboot-custom compiling

  1. May 7th, 2014 at 17:30 | #1
  2. May 15th, 2014 at 15:55 | #2
  3. May 18th, 2014 at 10:10 | #3
  4. December 16th, 2014 at 04:44 | #4