Leon Anavi
IT Tips && Tricks

Mobile & Embedded

Created: 05.10.2013 01:59 Last Modified: 05.10.2013 01:59 Views: 2073
Keywords: a10s, build, dd, i2c.h, kernel, Linux, make, microSD, patch, SPL, u-boot, Olimex

Hints for Building Linux for A10S-OLinuXino-MICRO from Scratch

Introduction

A good tutorial for building Debian from Scratch for A10S-OLinuXino-MICRO is available at Olimex’s blog. Since the main difference between Linux distributions is the rootfs so the same tutorial can be applied in other cases too. In this article you will find several hints which combined with the other tutorial will allow you to build the latest kernel and u-boot provided by linux-sunxi as of October 2013.

Building the Kernel

The algorithm to build a kernel is quite simple: checkout linux-sunxi source code from GitHub, patch file i2c.h and build it using Make. In order to succeed with latest version of the source code the following patch should be applied to i2c.h:
--- i2c.h	2013-06-17 16:02:04.000000000 +0300
+++ i2c_100kHz.h	2013-06-17 16:02:45.000000000 +0300
@@ -185,8 +185,8 @@
 #define TWI2_BASE_ADDR_END    (TWI2_BASE_ADDR_START + AW_TWI_ADDR_SIZE)
 
 #define I2C0_TRANSFER_SPEED     (400000)
-#define I2C1_TRANSFER_SPEED     (200000)
-#define I2C2_TRANSFER_SPEED     (200000)
-#define I2C3_TRANSFER_SPEED     (200000)
-#define I2C4_TRANSFER_SPEED     (200000)
+#define I2C1_TRANSFER_SPEED     (100000)
+#define I2C2_TRANSFER_SPEED     (100000)
+#define I2C3_TRANSFER_SPEED     (100000)
+#define I2C4_TRANSFER_SPEED     (100000)


 struct sunxi_i2c_platform_data {
 	int 		 bus_num;
The following commands should be executed:
# make ARCH=arm a10s_olinuxino_defconfig
# cd linux-sunxi/arch/arm/plat-sunxi/include/plat/
# wget http://anavi.org/olimex/a10s/A10S_100kHz_I2C.patch
# patch -p0 < A10S_100kHz_I2C.patch
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install

Write U-Boot and SPL to the microSD Card

The following commands should be used to install the latest version of u-boot and SPL to the microSD card:
sudo dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8
sudo dd if=u-boot.img of=/dev/sdX bs=1024 seek=40

HDMI Output

If you are using A10S-OLinuXino-MICRO with a monitor connected to the board through an HDMI cable you have to force the display to use. Edit uEnv.txt file and add disp.screen0_output_type=3 as an extra argument.

  Home | About | Contact | Disclaimer | Sitemap © 2009-2016 Leon Anavi. All rights reserved.