Table of Contents

Setting up Slackware ARM 14.0 on the OLinuXino A10S Micro from scratch

This document can also be found at http://www.malaya-digital.org/setting-up-slackware-arm-14-0-on-the-olinuxino-a10s-from-scratch/

NOTE: The documentation below needs updating. I recommend that you use the link I've just given above as it leads to updated documentation. I'll have the text below updated when time permits.

Setup of development environment

# apt-get update
# apt-get upgrade
# apt-get install openssh-client openssh-server
# apt-get install ncurses-dev uboot-mkimage build-essential git
# cd ~
# wget https://launchpad.net/linaro-toolchain-binaries/trunk/2013.01/+download/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux.tar.bz2
# tar xjfv gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux.tar.bz2
export PATH=/root/gcc-linaro-arm-linux-gnueabihf-4.7-2013.01-20130125_linux/bin:$PATH
# shutdown -r now

Compiling the kernel (Copied from http://olimex.wordpress.com/2013/06/19/building-linux-for-a10s-from-scratch/ and http://olimex.wordpress.com/2013/10/28/building-debian-sd-card-for-linux-with-kernel-3-4-from-scratch-for-a10s-olinuxino-micro/ with some modifications)

# cd ~
# git clone https://github.com/linux-sunxi/linux-sunxi
# cd ~/linux-sunxi/
# git rev-parse --verify HEAD
9ee9fc5f0988df5677f0f142b5b88a8988d283d7

So, to checkout the mentioned revision:

# cd ~/linux-sunxi/
# git checkout 9ee9fc5f0988df5677f0f142b5b88a8988d283d7
# cd ~/linux-sunxi
# make clean
# cd ~/linux-sunxi
# wget http://www.malaya-digital.org/a10s_defconfig
# mv a10s_defconfig ~/linux-sunxi/arch/arm/configs/
# cd ~/linux-sunxi/
# make ARCH=arm a10s_defconfig
# make ARCH=arm menuconfig
# cd ~/linux-sunxi/
# wget http://www.malaya-digital.org/hcd_axp-md.patch
# cp drivers/usb/sunxi_usb/hcd/hcd0/sw_hcd0.c drivers/usb/sunxi_usb/hcd/hcd0/sw_hcd0a.c
# cp drivers/usb/sunxi_usb/hcd/hcd0/sw_hcd0.c drivers/usb/sunxi_usb/hcd/hcd0/sw_hcd0b.c
# patch -p0 < hcd_axp-md.patch
# cp drivers/usb/sunxi_usb/hcd/hcd0/sw_hcd0a.c drivers/usb/sunxi_usb/hcd/hcd0/sw_hcd0.c
#define I2C0_TRANSFER_SPEED (400000)
#define I2C1_TRANSFER_SPEED (100000)
#define I2C2_TRANSFER_SPEED (100000)
#define I2C3_TRANSFER_SPEED (100000)
#define I2C4_TRANSFER_SPEED (100000)
# cd ~/linux-sunxi/
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_PATH=out modules
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_PATH=out modules_install

Compiling Uboot (Copied from http://olimex.wordpress.com/2013/06/19/building-linux-for-a10s-from-scratch/ and http://olimex.wordpress.com/2013/10/28/building-debian-sd-card-for-linux-with-kernel-3-4-from-scratch-for-a10s-olinuxino-micro/ with some modifications)

# cd ~
# git clone https://github.com/linux-sunxi/u-boot-sunxi
# cd ~/u-boot-sunxi/
root@debian:~/u-boot-sunxi# git rev-parse --verify HEAD
8a4621c488f33089d831168bfa5bae210a5684c8
        "setargs=" \
          "if test -z \\\\\"$root\\\\\"; then"\
            " if test \\\\\"$bootpath\\\\\" = \"/boot/\"; then"\
              " root=\"/dev/mmcblk0p1 rootwait\";"\
            " else" \
              " root=\"/dev/mmcblk0p2 rootwait\";"\
            " fi;"\
          " fi;"\
# cd ~/u-boot-sunxi/
# make distclean CROSS_COMPILE=arm-linux-gnueabihf-
# make a10s-olinuxino-m CROSS_COMPILE=arm-linux-gnueabihf-
# ls u-boot-sunxi-with-spl.bin

Format and setup the SD-card (Copied from http://olimex.wordpress.com/2013/06/19/building-linux-for-a10s-from-scratch/ and http://olimex.wordpress.com/2013/10/28/building-debian-sd-card-for-linux-with-kernel-3-4-from-scratch-for-a10s-olinuxino-micro/ with some modifications)

# ls /dev/sd
# fdisk -u=sectors /dev/sdX
Disk /dev/sdX: 3980 MB, 3980394496 bytes
123 heads, 62 sectors/track, 1019 cylinders, total 7774208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdg1 2048 34815 16384 83 Linux
/dev/sdg2 34816 7774207 3869696 83 Linux
# mkfs.vfat /dev/sdX1
# mkfs.ext4 /dev/sdX2

Installing the kernel, Slackware ARM 14.0 mini root filesystem, and kernel modules

# mkdir /mnt/olinuxino0
# mount /dev/sdX1 /mnt/olinuxino0 # Substitute the appropriate value for X in /dev/sdX1
# cp uImage /mnt/olinuxino0 # Get the uImage file from the environment you've compiled the kernel.
# umount /mnt/olinuxino0
# mkdir /mnt/olinuxino1
# mount /dev/sdX2 /mnt/olinuxino1 # Substitute the appropriate value for X in /dev/sdX1
# mkdir /mnt/olinuxino1/lib/modules
# cp -rf 3.x.xx+ /mnt/olinuxino1/lib/modules # Get the modules directory from the environment you've compiled the kernel.
/dev/mmcblk0p2   /               ext4    errors=remount-ro 0       1
# umount /mnt/olinuxino1

Write Uboot (Copied from http://olimex.wordpress.com/2013/06/19/building-linux-for-a10s-from-scratch/ and http://olimex.wordpress.com/2013/10/28/building-debian-sd-card-for-linux-with-kernel-3-4-from-scratch-for-a10s-olinuxino-micro/ with some modifications)

# dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
# sync

NB: When you boot OLinuXino using the micro SD card with Slackware 14.0 for ARM, the "root" user has the password "password" by default.

Sources