DART Android RN WL8

From Variscite Wiki
AJ.2.2.VAR.DART.R10_WL8 Release Notes

Introduction

This software release has been developed and verified in the following software and hardware environment.

OS Kernel: Linux® 3.0
Android: Android JellyBean 4.1.2
Kernel: 3.0.31
Toolchain: Andriod linux-x86 toolchain arm-eabi-4.4.3
Reference hardware platforms: Variscite OMAP4 DART board
Build Host OS: Ubuntu 10.04 64-bit
Daily Build Blaze_Tablet Version: JB DEV Daily Build 96

Tools & Dependency packages

Pre-requisite packages for building the Android Filesystem (Note: This is with reference to Ubuntu 10.04 64-bit). Ubuntu 64-bit is required for the cross-compilation of Android Jelly Bean Filesystem.

If you are behind a firewall, you will have to set-up firewall using the instructions.
The following commands will install the correct packages to your server:

$ sudo apt-get install git-core flex bison gperf libesd0-dev zip gawk ant libwxgtk2.6-dev zlib1g-dev build-essential tofrodos uboot-mkimage libxml2-utils
$ sudo apt-get install lib32readline5-dev libstdc++6 lib32z1 lib32z1-dev ia32-libs g++-multilib libx11-dev libncurses5-dev uboot-mkimage

Install Oracle JDK 6

  1. Download the latest JDK 6 installer from Oracle http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html
  2. Accept the license agreement and click on the Linux x64 bin installer. The downloaded file will be named jdk-6uXX-linux-x64.bin where XX is the JDK 6 update version.
  3. Follow the following steps to install JDK 6
chmod a+x jdk-6uXX-linux-x64.bin
./jdk-6uXX-linux-x64.bin
sudo mkdir -p /usr/lib/jvm
sudo mv jdk1.6.0_XX /usr/lib/jvm/
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_XX/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_XX/bin/javac" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
NOTE:
Android Jelly Bean (4.1.2) needs Oracle JDK 6.
The Hard Disk should have at least 30 GigaBytes of free space to complete the building of sources.
Please refer to the AOSP documentation for latest information and instructions for setting up other Ubuntu versions http://source.android.com/source/initializing.html

Install repo tool:

mkdir ~/bin -p
sudo apt-get install curl
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH

If you do not have sudo rights to your machine, contact your System Administrator for assistance. Tool Chain for building Kernel and Drivers

The Kernel and Driver sources are built using the Android linux-x86 toolchain for ARM GNU/Linux version.

This tool chain can be obtained when you pull the Android code based on the released manifest that will be given.

Downloading Release Software

To obtain Android Filesystem Sources follow:

cd <your work directory>
mkdir -p 4AJ.2.2; cd 4AJ.2.2
export YOUR_PATH=`pwd`
mkdir -p mydroid; cd mydroid
export MYDROID=`pwd`
repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b 27.x -m RLS4AJ.2.2_JellyBean.xml
repo sync

Download AFS patch from Variscite's FTP (/proprietary/DART_WL8/4AJ.2.2.VAR.DART.R10.AFS.* patches) and apply them:

cat 4AJ.2.2.VAR.DART.R10.AFS.patch | patch -p1 -d device/ti/blaze/
cat 4AJ.2.2.VAR.DART.R10.AFS.WL8.patch | patch -p1 -d device/ti/blaze/
cat 4AJ.2.2.VAR.DART.R10.AFS.WL8.tgz.patch | patch -p1 -d device/ti/proprietary-open/wl12xx/wlan
cat 4AJ.2.2.VAR.DART.R10.AFS.WL8.LIBHW.patch | patch -p1 -d hardware/libhardware_legacy/

Download Ducati binaries package from Variscite's FTP (/proprietary/DART_WL8/ducati_full_blaze.tgz) and integrate it:

$ cp ducati_full_blaze.tgz device/ti/proprietary-open/omap4/ducati_full_blaze.tgz

Copy wlan original TI binaries in place:

$ cp wlan.tgz device/ti/proprietary-open/wl12xx/wlan/wlan.tgz

To obtain Kernel & Driver Sourcesfollow:

To clone kernel source from scratch do:

cd ${YOUR_PATH}
git clone git://git.omapzoom.org/kernel/omap.git kernel/android-3.0
cd kernel/android-3.0
git checkout 1f21f8ed30c1d6abd029b67d17106042930a93d2

Download kernel patch from Variscite's FTP (/proprietary/DART_WL8/4AJ.2.2.VAR.DART.R10.kernel.WL8.patch) and apply it:

cat 4AJ.2.2.VAR.DART.R10.kernel.WL8.patch | patch -p1

To obtain U-Boot Sourcesfollow:

cd ${YOUR_PATH}
git clone git://git.omapzoom.org/repo/u-boot.git u-boot
cd u-boot
git checkout 622fcfe5ae67e10598bdba8173c68717809518fc

Download U-Boot patch from Variscite's FTP (/proprietary/DART_WL8/4AJ.2.2.VAR.DART.R10.uboot.patch) and apply it:

cat 4AJ.2.2.VAR.DART.R10.uboot.patch | patch -p1 

To obtain X-loader Sourcesfollow:

cd ${YOUR_PATH}
git clone git://git.omapzoom.org/repo/x-loader.git x-loader
cd x-loader
git checkout dd88047040dce4a926a6ab80e207bc757f44d648

Download X-loader patch from Variscite's FTP (/proprietary/DART_WL8/4AJ.2.2.VAR.DART.R10.xloader.patch) and apply it:

cat 4AJ.2.2.VAR.DART.R10.xloader.patch | patch -p1 

Release Content

This release has the below content - Kernel and Drivers tested with VAR-SOM-OM44 and verified with Jelly Bean UI - A9 source code for accelerating Video

Build Instructions

Setting up build environment

From your work directory (where your 4AJ.2.2 directory resides):

export YOUR_PATH=`pwd`
export MYDROID=${YOUR_PATH}/mydroid
export PATH=$PATH:${MYDROID}/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
mkdir ${MYDROID}/logs
export CROSS_COMPILE=arm-eabi-
export PATH=${YOUR_PATH}/u-boot/tools:$PATH

Building U-BOOT

cd ${YOUR_PATH}/u-boot
make ARCH=arm distclean
make ARCH=arm omap4460dart_board_config    # To build u-boot for DART Board
make ARCH=arm 2>&1 |tee ${MYDROID}/logs/u-boot_make.out

Building X-LOADER

cd ${YOUR_PATH}/x-loader
make distclean	
make ARCH=arm omap4460dart_config
make ARCH=arm ift 2>&1 |tee ${MYDROID}/logs/x-loader_make.out

Building Kernel

Note: If you are building for a GP device it is recommended not to build the SMC kernel driver.
To create kernel uImage you need to add "mkimage" directory path to your "PATH" environment variable:

cd ${YOUR_PATH}/kernel/android-3.0
make ARCH=arm distclean
make ARCH=arm dart_defconfig
make ARCH=arm uImage 2>&1 |tee ${MYDROID}/logs/kernel_make.out

Building Kernel modules

make ARCH=arm modules 2>&1 |tee ${MYDROID}/logs/kernel_modules.out

Building BTFM driver

cd ${MYDROID}/hardware/ti/wpan/bluetooth-compat
export KERNEL_DIR=${YOUR_PATH}/kernel/android-3.0
export KLIB=${KERNEL_DIR}
export KLIB_BUILD=${KERNEL_DIR}
make ARCH=arm 2>&1 |tee ${MYDROID}/logs/wlan_modules.out

The above step will produce the following kernel BTFM modules: compat.ko, btwilink.ko, bnep.ko, hidp.ko, rfcomm.ko, bluetooth.ko. These modules are pushed into the /system/lib/modules directory on the flashed image.

Building Android Filesystem (AFS) with TI Codecs enabled

In the make step below use the number of cores you have available; i.e. -j4 (for 4 cores) or -j12 (for 12 cores)

cd $MYDROID
source build/envsetup.sh

Now setup platform:

lunch full_blaze-userdebug

And build Android AFS:

make clean  #(required for clean rebuild only)
make 2>&1 | tee ${MYDROID}/logs/android_make.out

Preparing Android binaries

Copy external WLAN kernel modules:

cd ${MYDROID}/out/target/product/blaze/system/lib/modules
tar xvf wlan_modules.tar.gz

Copy WLAN firmware:

cd ${MYDROID}/out/target/product/blaze/system/etc/firmware/ti-connectivity
tar xvf wlan_firmware.tar.gz

Rebuild Android

cd ${MYDROID}
make 2>&1 | tee ${MYDROID}/logs/android_make.out

Preparing eMMC images

cd ${YOUR_PATH}
mkdir -p omap4_emmc_files_omap4dart ; cd omap4_emmc_files_omap4dart
cp -f ${MYDROID}/out/host/linux-x86/bin/fastboot .
cp -f ${MYDROID}/out/host/linux-x86/bin/mkbootimg .
cp -f ${MYDROID}/out/host/linux-x86/bin/simg2img .
cp -f ${MYDROID}/out/host/linux-x86/bin/make_ext4fs .
cp -f ${YOUR_PATH}/kernel/android-3.0/arch/arm/boot/zImage .

cp -f ${YOUR_PATH}/x-loader/MLO Dart_Board_OMAP4460_GP_ES1.1_MLO .
cp -f ${YOUR_PATH}/u-boot/u-boot.bin Dart_Board_u-boot.bin .

Create img files:

cd ${YOUR_PATH}/omap4_emmc_files_omap4dart
cp -f ${MYDROID}/out/target/product/${BOARD_TYPE}/*.img .

This build should not take too much time and will re-generate a new *.img files with the modified init.rc file in it

Now from this new directory we will create the eMMC images which will be flashed using fastboot protocol (described later).

First create boot.img image using kernel image we copied previously:
Build for LCD:

$ ./mkbootimg --kernel zImage --ramdisk ramdisk.img --base 0x80000000 --board omap4 -o boot.img

Build for HDMI:

$ ./mkbootimg --kernel zImage --ramdisk ramdisk.img --base 0x80000000 --board omap4 --cmdline "omapdss.def_disp=hdmi omapdss.hdmi_options=1920x1080" -o boot.img

Create cache partition:

$ dd if=/dev/zero of=./cache.img bs=1048510 count=128
$ mkfs.ext4 -F cache.img -L cache

Flashing the Android binaries on eMMC

Flash Android binaries using Fastboot

After the eMMC files are available you then can use the fastboot.sh script to upload binaries to your Dart Board or Dart EVM. You will need to copy the fastboot.sh script to the location of the eMMC files.

$ cd ${YOUR_PATH}/omap4_emmc_files_omap4dart
$ cp ${MYDROID}/device/ti/${BOARD_TYPE}/boot/fastboot.sh .

Connect the Dart Board or Dart EVM USB OTG port to your Linux machine and go to where the eMMC files are. Previous partitions created will be deleted and eMMC will be flashed with new u-boot and MLO. You need to boot the board and start fastboot server on the target (OMAP4 board).

   # fastboot

You should see a message such as:

    "Fastboot started..." or "Fastboot entered..."

When running the fastboot script the command should be issued as super user then run:

$ sudo ./fastboot.sh --pwd

Dart will boot up on its own with the new image in a few minutes. Until the user interface is ready for use, please avoid interrupting it by pressing any keys etc. This will detect your board and flash the images to the board.

First time flashing on eMMC

If there is no u-boot on your board's eMMC you have two options to boot Dard, using external SD card or using usbboot utility which boot Dart over USB OTG port.

Boot using external SD card:

To boot using external SD card copy u-boot.bin and MLO files to an SD card (boot partition) and then boot the target board from this external SD card by press and hold the bootselect button.

Boot using usbboot utility:

usbboot is a small utility that boot Dart over USB OTG port, it has embedded 1ndstage bootloader (MLO) and it takes u-boot.bin image file as parameter.

(pre-built binary and source code of usbboot utility can be obtained from Variscite's FTP)

To boot using usbboot,  press and hold the bootselect button, power on the board and then connect the Dart USB OTG port to Linux machine.

Then from Linux shell type:

$ sudo ./usbboot u-boot.bin

Flash eMMC

Once you boot the board, start fastboot server on the target (Dart board).

# fastboot

You should see a message such as:

    "Fastboot started..." or "Fastboot entered..."

Now from the PC execute following commands to flash MLO and u-boot to eMMC

$ sudo ./fastboot oem format
$ sudo ./fastboot flash xloader ./MLO
$ sudo ./fastboot flash bootloader ./u-boot.bin