Archive

Amlogic has an open linux website where they regurlarly release GPL source code, and with Amlogic S905 devices coming to market, they’ve released a few tarballs at the beginning of the month including Linux 3.14 source code, U-boot source code, and Mali-450MP GPU kernel source code (obviously not userspace), as well as some other drivers for WiFi, NAND flash, PMU, TVIN, etc…Let’s get to the download links:

I quickly tried to build the Linux source. If you’ve never build a 64-bit ARM kernel or app before, you’ll fist need to install the toolchain. I installed the one provided with Ubuntu 14.04:

Shell

1

sudo apt-getinstall gcc-aarch64-linux-gnu

Now extract the tarball and enter the source directory:

Shell

1

2

tar xvf arm-src-kernel-2015-11-04-9e845bea41.tar.gz

cdarm-src-kernel-2015-11-04-9e845bea41

At first I had a build failure due to a missing directory, so I created it, and use the default config for Amlogic S905/S912 (in arch/arm64/configs), before building the Linux kernel.

Shell

1

2

3

mkdir-p.git/hooks

makeARCH=arm64 meson64_defconfig

makeARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu--j8

and it ended well:

Shell

1

2

3

4

5

6

7

8

9

10

Building modules,stage2.

MODPOST2modules

OBJCOPY arch/arm64/boot/Image

OBJCOPY arch/arm64/boot/Image

CCdrivers/amlogic/usb/dwc_otg/310/dwc_otg.mod.o

CCdrivers/media/usb/gspca/gspca_main.mod.o

GZIParch/arm64/boot/Image.gz

LZOarch/arm64/boot/Image.lzo

LD[M]drivers/amlogic/usb/dwc_otg/310/dwc_otg.ko

LD[M]drivers/media/usb/gspca/gspca_main.ko

So that’s a good starting for anybody wanting to work on the Android or Linux kernel…

Unrelated to Amlogic S905/Meson64, but I’ve also noticed some OpenWRT packages and rootfs on Amlogic website that was released a little earlier this year. So either some people are using Amlogic Sxxx processors with OpenWRT, or Amlogic is working on a router chip that I missed. Probably the former.

HTC Nexus 9 is one of the first 64-bit ARM platform with powerful ARMv8 cores (e.g. not Cortex A53) that both commercially available, and relatively affordable at $399 to $599, at least significantly cheaper than the server boards such as Applied Micro X-C1. The tablet comes with Android 5.0 Lollipop, but for those of you who wish to have an ARM64 platform running Ubuntu or other 64-bit Linux operating systems, Ubuntu installation instructions provided by Ryan Houdek, Dolphin emulator developer, might come handy, especially it won’t affect your Android installation provided you have already unlocked your bootloader.

The instructions are fairly long so I won’t reproduce them all here, so I recommend you check the detailed instructions on XDA, but the short summary below may give an idea of the amount of work needed:

Build the Linux kernel. Again you’ll have to change a bunch of options in make menuconfig step related to watchdog, graphics supports, and overall system configuration:

Shell

1

2

3

4

5

6

7

8

git clonehttps://android.googlesource.com/kernel/tegra.git

cdtegra

git checkout android-tegra-flounder-3.10-lollipop-release

export ARCH=arm64

export CROSS_COMPILE=aarch64-linux-gnu-

makeflounder_defconfig

makemenuconfig

make-j8

Extract a rootfs (e.g. ubuntu-core-14.04.1-core-arm64.tar.gz) to a USB flash drive formatted with EXT-2/3/4, make some minor modifications to the rootfs, and rebuil the kernel. Once everything is don and well, boot Ubuntu with fastboot as follow:

Beside the Nexus 9, a USB OTG cable, and a USB flash drive required for installing Ubuntu ARM64 with these instructions, you should really make a headphone UART debug cable as accessing the serial console with make it easier to spot potential issues during installation.

ARM, Szeged University in Hungary, and Samsung Research UK have been working on TyGL, a new backend for WebKit accelerated with OpenGL ES2.0, and developed and tested on ARM Mali-T628 GPU found in Samsung ARM Chromebook. It will typically provide 1.5 to 4.5 times higher performance, but in the best cases, it can achieve up to eleven times the performance of a CPU-only rendered page.

The other good news is that TyGL is now open source, with the code available on github, and you can build it and give it a try on ARM Mali-T62X development boards such as Arndale Octa or ODROID-XU3 (Lite) running Ubuntu Linaro 14.04, or other Linux based distributions. The complete build is said to last about 10 hours, but this will obviously depend on your machine. TyGL should also work on other mobile GPU supporting OpenGL ES 2.0, but I understand this has not been tested yet.

Hardkernel ODROID-C1 board, a more powerful $35 alternative to the Raspberry Pi, garnered a lot of attention when it was announced last week. At the time source code was not available, but as scheduled, U-boot and Linux source code is now available, and the full Android SDL should be released on February 2015. Instructions to get the code, and build both Linux and U-boot are available on ODROID-C1 Wiki, and I’ve just given a try to Linux instructions myself to see if I would encounter any issues in Ubuntu 14.04.

I selected the Linux branch. Time to configure the build for ODROID-C1:

Shell

1

2

cdlinux

makeodroidc_defconfig

Install u-boot-tools for mkimage, and build the kernel image

Shell

1

2

sudo apt-getinstallu-boot-tools

makeuImage-j8

And the device tree file for ODROID-C1:

Shell

1

2

makemeson8b_odroidc.dtd

makemeson8b_odroidc.dtb

I’ve stopped there, but if you have a board you’ll want to copy / flash the files arch/arm/boot/uImage and arch/arm/boot/dts/amlogic/meson8b_odroidc.dtb to a bootable eMMC or SD card

For Linux – Copy uImage and meson8b_odroidc.dtb to the FAT32 partition of your boot device, replacing the existing files

For Android – Use fast boot as follows:

Shell

1

2

3

sudo apt-getinstall android-tools-fastboot

sudo fastboot flash boot&lt;path/of/your/uImage&gt;

sudo fastboot flash dtb&lt;path/of/your/meson8b_odroidc.dtb&gt;

Have fun 🙂

This source code release for ODROID-C1 should also open the way for Linux Kernel ports, and Ubuntu / Debian or other Linux distributions for other Amlogic S805 devices such as MK808B Plus, MXQ S85, or MINIX NEO X6.

After blowing up my ATX power supply, and learning such things as “FULL” power supplies do exists, I finally managed to build Android for Tronsmart Orion R28 using the provided SDK. I haven’t tried to load it on the device yet, but the build could complete successfully after following the steps below in Ubuntu 14.04. The SDK is probably not specific to one device, so it might just also work on other RK3288 TV boxes and tablets.

First download Android 4.4 SDK for RK3288, or use the one in the micro SD card provided with the Beta version of R28 Pro and Meta.

Edit the culprit file, remove the inline directive, and continue the build:

Shell

1

<del>makeARCH=arm CROSS_COMPILE=arm-linux-gnueabi-</del>

Similar errors will occur one or twice more, so repeat step 5 as needed….

Create kernel.img (not sure the command line is correct)

Shell

1

2

<del>./mkkrnlimg arch/arm/boot/Image kernel.imgrk3288-box

cd..</del>

Before building Android, you need to make sure you use the right version of Java. I recently build AOSP for ARMv8 which requires OpenJDK 1.7 in Ubuntu, but this version requires Oracle 1.6 SE. At first I used JDK 6u45 (1.6.045), but I got some errors:

In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
out/target/product/rk3288/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]

Firefly-RK3288 development board was first announced in July. I still don’t have news about availability nor pricing, but the T-Firefly website launched yesterday. They seem do have a nice Wiki, but unfortunately everything is currently in Chinese, except when you go to the download page. You’ll find firmware upgrade_tool for Linux and Windows, the USB drivers for rooting and firmware update, firmware images (Android 4.4.2, Ubuntu 14.04, and dual boot), the board schematics (PDF), and Android KitKat 4.4.2 SDK with U-Boot, Linux, and Android source code, some documentation, XBMC apk (no source) with H.265 hardware decode support for MP4, MOV and MKV container formats.

The SDK is available on Bitbucket. I planned to test it, but unfortunately my network connection is very slow (and unstable) to this server, and I failed to retrieve it with git clone. The company also posted the build instructions in Chinese in their website, but I’ll reproduce them here for Ubuntu 14.04.

As some of you already know, I’ve been playing around with Tronsmart Vega S89 Elite, an Android TV Box powered by Amlogic S802 quad core ARM Cortex A9r4 processor at 2 GHz. Today, I’ll show how to boot a headless Linux image on any Amlogic based S802 TV Box from the network. The instructions can mainly be used as a starting point for developers, as it requires access to a serial terminal via UART, but if you’ve never done it before, the instructions should be easy enough to follow. Everything is loaded from the network, the kernel (via boot.img) is loaded via TFTP, and the rootfs (Linaro ALIP image) is mounted via NFS, so it’s nearly impossible to brick your device using the method provided. Linaro ALIP rootfs comes with LXDE, but at this stage the desktop environment is not showing, even through my HDMI TV is properly detected by the drivers. However, Ethernet, USB mass storage, and the micro SD seem to be working just fine.

If you want to skip the kernel compilation part, ramdisk modification, and just boot your Vega S89 Elite from network you can download vegas89eboot.img (compressed with bzip2), and skip steps 4 to 9 included. Please don’t just flash this image or use it without reading the post, as even if it should not brick your device, Android won’t boot at all if you don’t follow the right instructions.

If not done already, you’ll need to install TFTP and NFS servers, and the get basic development tools in a Linux computer. All instructions here have been performed in a PC running Ubuntu 14.04 64-bit.

Run “make ARCH=arm menuconfig” to enable NFS client support as shown below.Then exit and save

You’ll need to edit mk_m8.sh script for your device using the correct DTD file, which you need to copy to ./arch/arm/boot/dts/amlogic/ directory. I’ve renamed the script to mk_vegas89e.sh, and edited it as follows:

We also need to create and init to switch the root to NFS. Normally, we should be able to do in the bootloader with “bootargs” but this did not work for me, probably because I missed some steps.

Extract the ramdisk provided with the source code

Shell

1

2

3

mkdirrootfs

cdrootfs

sudo cpio-i-F../rootfs.cpio

Delete sbin/init symlink to busybox, and create a new init file. Be very careful at this stage as if you inadvertently add a leading slash, you’ll mess up with your PC system.

Shell

1

2

rmsbin/init

sudo visbin/init

Here’s the content of sbin/init. Replace 192.168.0.104 by the IP address of your PC / NFS server, and /srv/nfs/alip by the path where you extracted your rootfs in the NFS directory.

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

#!/bin/busybox sh

echo"CNXSoft init script entered"

PATH="/bin:/sbin:/usr/bin:/usr/sbin"

echo"DHCP..."

udhcpc eth0

echo"Mounting NFS rootfs..."

mount-tnfs-oproto=tcp-onolock192.168.0.104:/srv/nfs/alip/mnt

echo"Switching root..."

exec switch_root/mnt/sbin/init

Recreate the ramdisk

Shell

1

2

find.|sudo cpio-o-Hnewc&gt;../rootfs.cpio

cd..

Now we can finally build the kernel, and boot.img:

Shell

1

2

chmod+xmk_vegas89e.sh

./mk_vegas89e.sh

It should take between a minute to a few minutes depending on your machine, and if everything works as planned you could get your boot.img, in my case vegas89eboot.img. Copy it to your tftp server directory

Shell

1

sudo cpvegas89eboot.img/srv/tftp/boot.img

Now start minicom connected to ttyUSB0 (115200 8N1), and power the TV box. Press the space bar, or any other key, during boot up to access U-boot command line. Let’s define IP addresses for the board, the TFTP server, and gateway (router), and save these to the U-boot environment:

Shell

1

2

3

4

m8_k200_v1# setenv ipaddr 192.168.0.144

m8_k200_v1# setenv serverip 192.168.0.104

m8_k200_v1# setenv gatewayip 192.168.0.1

m8_k200_v1# saveenv

Setup the boot arguments for NFS. I know I should really have used fixed IP instead of dhcp, for consistency, and to shave off two or three seconds to boot time, but…

You could also use saveenv to save these, but then Android won’t boot anymore next time your start the board. Alternatively, you could create a bootargs2 and copy this to bootargs before running Linux.

Load boot.img from the TFTP server

Shell

1

bootp

Start the system

Shell

1

bootm

Once you make sure boot.img loads properly from TFTP server, you could also combine both commands with “bootp; bootm“

You should now have access to the command line as root, no password required. An sshd daemon is already running so you can access it via ssh if you want. The board temperature will be outputted every second or so. There must be a way to disable that in the code, but in the meantime you can do:

There’s about 1.5GB ram free, I’ve got a lot of storage in the root as it is the 1TB hardware in my PC, and my 4GB USB flash drive was almost mounted automatically.

I’ll also through the CPU information for reference:

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

root@genericarmv7a:~# cat /proc/cpuinfo

Processor:ARMv7 Processor rev1(v7l)

processor:0

BogoMIPS:12.65

processor:1

BogoMIPS:12.65

processor:2

BogoMIPS:12.65

processor:3

BogoMIPS:12.65

Features:swp half thumb fastmult vfp edsp neon vfpv3 tls

CPU implementer:0x41

CPU architecture:7

CPU variant:0x4

CPU part:0xc09

CPU revision:1

Hardware:Amlogic Meson8 platform

Revision:000b

Serial:1900000000000000

You should easily be able to adapt these instructions to boot from flash, by inserting boot.img into one of the available firmware update packages, and switching root to a USB flash or hard drive with the rootfs. I’m not sure how to access the flash partitions right now, as only the bootloader shows up in the MTD partition, but it;s the same thing in Android.

Shell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

root@genericarmv7a:~# cat /proc/mtd

dev:sizeerasesizename

mtd0:0006000000001000"bootloader"

mtd1:0001000000001000"ubootenv"

root@genericarmv7a:~# ls /dev/block/ -l

total0

lrwxrwxrwx1rootroot8Apr1715:21254:0-&gt;../zram0

lrwxrwxrwx1rootroot12Apr1715:2131:0-&gt;../mtdblock0

lrwxrwxrwx1rootroot12Apr1715:2131:1-&gt;../mtdblock1

lrwxrwxrwx1rootroot8Apr1715:217:0-&gt;../loop0

lrwxrwxrwx1rootroot8Apr1715:217:1-&gt;../loop1

lrwxrwxrwx1rootroot8Apr1715:217:2-&gt;../loop2

lrwxrwxrwx1rootroot8Apr1715:217:3-&gt;../loop3

lrwxrwxrwx1rootroot8Apr1715:217:4-&gt;../loop4

lrwxrwxrwx1rootroot8Apr1715:217:5-&gt;../loop5

lrwxrwxrwx1rootroot8Apr1715:217:6-&gt;../loop6

lrwxrwxrwx1rootroot8Apr1715:217:7-&gt;../loop7

lrwxrwxrwx1rootroot6Apr1715:218:0-&gt;../sda

lrwxrwxrwx1rootroot7Apr1715:218:1-&gt;../sda1

I’m not sure I’ll go much further myself, but hopefully some people will pick up on this, and we’ll get a fully working easily installable Linux server and desktop images for Amlogic S802 based platforms.

Atmel SAMA5D3 Xplained is an evaluation board running Linux powered by SAMA5D36 ARM Cortex A5 micro-processor with 256 MB DDR2, 256 MB flash, two Ethernet ports, 3 USB connectors, and more. This embedded board targets industrial automation, networks, robotics, control panels and wearable applications. The only video output is an LCD connector so it is reserved for headless or flat panel based applications. You can check full specs on my Atmel SAMA5D3 Xplained announcement post. The company kindly sent me a sample, so that I can share my experience with the board. I’ll first post some unboxing pictures, show how to get started with the pre-installed image, and build my own Linux image.

Atmel SAMA5D3 Xplained Unboxing

I’ve been sent the board via DHL in the following package, which gives a short desscription of the board, and what it is used for. There’s also a QR core, but it just returns the board name of some production numbers and dates, no links.

In the package you’ve got the board, a micro USB to USB cable for power and programming, and a small card entitled “Overview and Compliance Information” which gives a list of key features, a link to get started http://www.atmel.com/sama5d3xplained, which I’ll use later, and some EU compliance informations regarding RoHS2 and EMC. The board is compliant with both CE and FCC standards.

Atmel SAMA5D3 Xplained Package Content (Click to Enlarge)

Let’s check the board in details.

Top of Atmel SAMA5D3 Xplained Board (Click to Enlarge)

On the top of the board, we’ll find the 2 USB host connectors, and 2 Ethernet connectors (GMAC and EMAC) on the right, the micro USB port, as well as pads to solder an external power supply and a micro SD slot on the left, reset, wake up and user buttons, as well as JTAG, LCD, and debug (serial) connectors at the bottom, and around the MPU and memories, the Arduino UNO R3 compatible headers with the names of the different pins. Bear in mind these only support 3.3V, not 5V.

Bottom of Atmel SAMA5D3 Xplained (Click to Enlarge)

On the back we’ll find the SD card slot, and again, the markings for the Arduino compatible connectors.

Atmel SAMA5D3 Xplained Quick Start Guide

From the link provided on the “Overview card”, you can download SAMA5D3 MPU datasheet, the board brief, design and manufacturing files, and user’s guide, as well as a Getting Started Guide, which I’ll try out in this post.

The board comes pre-loaded with a Linux distribution (poky) built with the Yocto Project comprised of bootloaders (AT91Bootstrap and U-boot), the Linux kernel, and a custom lightweight rootfs. To get started simply connect the micro USB to USB cable to your computer to boot the system, you should see a blue LED lit up and blink. There’s no display, but there are three ways to access the board from Linux or Windows computers:

Using the USB connection your PC. In Linux, run dmesg to check the latest kernel messages:

In my case the interface is /dev/ttyACM0. Run you favorite terminal emulator program, such as minicom, picocom, screen, PuTTY, etc… I’ve used minicom, and configured it to access /dev/TTYACM0 using 115200 8/N/1 configuration. Instructions for Windows can be found in the company’s Getting Started Guide.

Via a USB to Serial board connected via J23 header’s Tx, Rx and GND pins. I’ve also done this in minicom with /dev/ttyUSB0 and the same 115200 8/N/1 configuration.

Via SSH. The demo image in the board is running sshd, so provided you’ve connected one or two of the Ethernet ports on a LAN with a DHCP server, you should be able to connect with the IP of the board. In Linux: ssh [email protected]_address

You can login with the board using the root account without password. The USB and SSH methods are the most convenience since you don’t need to connect extra hardware, but you won’t be able to access the bootloader that way, debugging the Linux kernel, if needed, will be difficult, and each time, the board is rebooted, the connection will be lost. So for development, you should really get a serial to USB debug board.

So the board runs Linux 3.10 built with Yocto, has 136M free on the rootfs, and 21MB used out of 246 MB RAM.

Building the demo image for Atmel SAMA5D3 Xplained

Atmel Getting Started document mentions the software components in the NAND Flash have been compiled following instructions found on the Linux4SAM website, but instead I’ve followed the build procedure found in github.

Edit conf/local.conf to specify the SAMA5D3 Xplained board, and change the package type to ipk:

Shell

1

2

3

4

[...]

MACHINE??="sama5d3_xplained"

[...]

PACKAGE_CLASSES?="package_ipk"

Build the demo image

Shell

1

bitbake atmel-xplained-demo-image

This step will take a while, and you’ll find the binary images in tmp/deploy/images/sama5d3_xplained/ including the bootloaders, the kernel, modules, device tree files, and rootfs.

You can also optionally build the bootloaders separately with:

Shell

1

2

bitbake at91bootstrap

bitbakeu-boot

Flashing the Image

After you’ve built the image you may want to install them. You can also download the pre-built Yocto/Poky demo. I’ll use the files I’ve built, but the scripts from the pre-built demo zip file (linux4sam-poky-sama5d3_xplained-4.3.zip), since I could not find it anywhere else.

First you’ll need to install SAM-BA tool to flash the images. In Ubuntu 64-bit:

You’ll then need to add yourself into the dialout group inside /etc/group:

Shell

1

dialout:x:20:myusername

Logout and login.

Now copy demo_linux_nandflash.sh, demo_linux_nandflash.tcl and demo_script_linux_nandflash.tcl scripts from the zip file to tmp/deploy/images/sama5d3_xplained/ directory, and if needed, edit demo_linux_nandflash.tcl to match your newly built filenames: