Linux on the ST-Ericsson U300, Nomadik and Ux500 platforms

Seeing my submissions on the various Linux kernel mailing lists it's quite easy to see that at work I do a lot of Linux kernel work for the ST-Ericsson U300, Nomadik and Ux500 platforms. This is available in the mainline Linux kernel starting with version 2.6.31. Here are some tools and patches I use when doing community work:

Old Snowball Files

The support for Snowball U9500 has been discontinued, but there is a backup of all related files here on GitHub if you e.g. need to recover the board or so.

Toolchain

The latest Linaro GCC toolchain is what I usually use to compile recent kernels. For compiling the userspace for Nomadik and U300, you need to use a compiler built for ARMv5 or the stuff just won't work. You can use Rob Landleys precompiled ARMv5 binary if you like, it works for me.

Download the toolchain and install it such that it is always in your path. Sometimes the toolchain has been compiled for i686 and then you need to install a i686 multipath library to execute it on an x86_64 machine. A good way to get the cross compiler into your $PATH is to install it in /var/linus/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/ and then add this to a file called /etc/profile.d/crosscompilers.sh

CS_BASE=/var/linus/gcc-linaro-arm-linux-gnueabihf-4.8-2013.08_linux/
export PATH=$PATH:${CS_BASE}/bin
export MANPATH=$MANPATH:${CS_BASE}/share/doc/gcc-linaro-arm-linux-gnueabihf/man/

Here are some .mak Makefiles that I use to configure and build a U300, Nomadik or Ux500 series kernel out-of-the box:

Using these also optionally use a minimal initramfs root filesystem placed in your home directory. (This is to get you to a prompt without a root filesystem installed in the flash, such as the ArchLinux method described below.) These root filesystems are created using this script. Prebuilt versions can be obtained here:

Copy the rootfs to you home directory and the *.mak file to your linux/ git tree or base dir and simply:

> make -f ux500.mak config
> make -f ux500.mak build

Use the same pattern mutatis mutandis for Nomadik and U300.

Or for the simple machine.mak makefile (the MACHINE is simply the prefix for the defconfig file found in arch/arm/configs/*):

> make -f machine.mak MACHINE=nhk8815 config
> make -f machine.mak MACHINE=nhk8815 build

Upload a zImage on ux500 using fastboot

The fastboot i.e. LittleKernel boot loader in the later ux500 platforms does not support not passing an initrd image when booting over USB. The proper way to kick a boot with just initramfs is like this:

> echo "foo" > null-initrd
> fastboot -b 0x00000000 boot zImage null-initrd

ArchLinux on the ux500 (especially Snowball)

It's fairly simple to install a generic ArchLinux distribution on the ux500 variants to get some proper root filesystem with some more action. This is based on the Versatile Express installation procedure.

We start by putting it on an SD card and from there to the internal eMMC.

You need to first build a kernel, you can use the prebuilt v4.4 kernel found further down this page.

U-Boot procedure

The following was done on the Snowball which has an on-board 7GiB eMMC which appears as /dev/mmcblk0 and is pre-partitioned with three partitions:

We will proceed to overwrite the uImage in mmcblk0p2 with the latest we have and then overwrite the root filesysystem in mmcblk0p3 with ArchLinux.

Fastboot procedure

If the board has Fastboot installed, we do not need to screw around with FAT partitions etc.

Booting a uImage on the Nomadik

The Nomadik uses U-Boot which has an interactive boot loader prompt. Usually you want to boot the uImage from TFTP by first setting up a TFTP server and then issue something like this (with proper constants changed):

setenv serverip 192.168.1.100;setenv ipaddr 192.168.1.104;setenv bootfile uImage;tftpboot;bootm

ArchLinux on the Nomadik

This is a pretty straight-forward ARMv5 platform and ArchLinux can easily be brought up on the SD card:

Prebuilt images ux500

Prebuilt images Nomadik NDK15