Friday, 17 May 2013

I.MX6 GK802 - Uboot multi-boot

I spent some re-factoring the current uboot to enable the possibility of booting a roofs located on either:

1. Internal SD
2. External SD
3. Usb drive

Here's how it works, the new boot searches for a uboot script file called "boot.scr" on each of the above devices. The boot.scr is loaded and executed from the first device it encounters containing the file. We assume the device contains an ext2/3/4 partition and the boot.scr is located in /. Within the boot.scr file the variable 'boot_normal' has to be set to contain the uboot commands to run next, the contents of this variable are then executed.

You can download multi-uboot from here and 'dd' to an sd card that will reside in the internal sd card slot. Potentially this can be a very small SD card if you have no intentions of hosting a rootfs on it.

sudo dd if=u-boot_multi_boot.imx bs=1k seek=1 of=/dev/<internal SD card device> && sync

Lets start with an example, lets say we want to execute our ubuntu image from the external SD card. I am assuming the ubuntu rootfs exists on an sd card . First we create a text file I call them 'boot.cmd' (you can give it any name) containing the uboot commands to run as shown below:

setenv console 'ttymxc3,115200'
setenv root '/dev/mmcblk1p1 rootwait'
setenv rootfstype 'ext4'
setenv kernel 'uImage'
setenv video 'mxcfb0:dev=hdmi,1280x720M@60,if=RGB24'
setenv extra ''
setenv boot_normal 'setenv bootargs console=${console} root=${root} rootfstype=${rootfstype} video=${video} ${extra};  mmc dev 1; ext2load mmc 1:1 0x10800000 /boot/uImage; bootm'

For the above :

1. 'root' is set to the external sd card (/dev/mmcblk1p1).
2. 'video' contains the video resolution we want the kernel to set. Note setting the resolution may disable sound. So you could remove the video variable from the file to let the kernel detect the resolution using EDID. There is also a kernel patch from wolfgar that fixes the sound when the resolution is set to 720p or 1080. You can download precompiled kernel and modules with the patch. Copy kernel (uImage) to /boot and untar modules_3.0.35-02708-g899792c-dirty.tar.gz and copy modules directory to /lib/modules.

3. 'boot_normal' is told to use the external sd slot by  'mmc dev 1' and then to load the kernel located at /boot/uImage.

Next the text file has to be converted to a uboot script image file using the mkimage command to create  the boot.scr file.

mkimage -A arm -O linux -T script -n "boot" -d boot.cmd boot.scr

Copy the boot.src to the root directory of your external sd card containing the rootfs.

Ensure internal sd slot has a the sd card containing the mutli-boot uboot on in it and does not contain a /boot.scr. Place the sd card containing the rootfs in the external sd card slot and boot.

Here are some example script files (remember to rename compiled file to boot.scr) :
Note the source files contain a mistake that should be fixed: 
     setenv fbmem "fbmem=28M";  
    setenv fbmem ''; 

1. Boot from external SD (no video set)

2. Boot from from USB (assumes a single mass storage device is available).

3. Boot from internal SD (no video set)

Sunday, 5 May 2013

I.MX6 GK802 Xubuntu 12.04

This is an attempt at producing at fast and lightweight desktop release based upon xfce. Given that the majority of the Debian based ARM desktop distros still rely on Open GL Window Managers, the desktop makes use of the Open GL Vivante library where possible. However as the Vivante libraries don't seem to support all the mesa-gl api's this works with limited success.

Ideally the next step would be to rework/recompile some of the applications to use GLES instead of Open GL or find desktop with GLES support.

Given this is a rootfs, it can be tested on other imx6 devices but no guarantees.

What is working:

1. GPU acceleration
2. Video playback using totem
3. Chromium (with GPU acceleration, webgl does not work)
4. Numerous desktop applications
5. Wifi

As per the previous ubuntu 12.04 image, to deploy:

1. Download roofs.

2. Extract rootfs onto your sdcard.

There is a bug in ubuntu with dbus disabling wifi ( After booting execute the following and reboot to configure wifi from within xfce:

chgrp messagebus /usr/lib/dbus-1.0/dbus-daemon-launch-helper
chmod +s /usr/lib/dbus-1.0/dbus-daemon-launch-helper 

You can also download the Vivante GPU demos, these demonstrate the performance of the GC2000 core. Extract the tar file and the samples are in located in "viv_samples/vdk", there are number  tutorial files that you can run eg "tutorial1, tutorial1_es20".