DART Android RN: Difference between revisions

From Variscite Wiki
(Replaced content with "{{PageHeader|AJ.2.2.VAR.DART.R9 Release Notes}} {{DocImage|category1=DART|category2=Android}} __toc__ = under construction = = <br/> =")
(Undo revision 1274 by Oren (talk))
Line 1: Line 1:
{{PageHeader|AJ.2.2.VAR.DART.R9 Release Notes}} {{DocImage|category1=DART|category2=Android}} __toc__
{{PageHeader|AJ.2.2.VAR.DART.R9 Release Notes}} {{DocImage|category1=DART|category2=Android}} __toc__


= under construction =
= Introduction =


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


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


= <br/> =
= 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 [http://omapedia.org/wiki/Host_PC_Setup instructions].<br/>The following commands will install the correct packages to your server:
<pre>$ 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
$&nbsp;sudo apt-get install lib32readline5-dev libstdc++6 lib32z1 lib32z1-dev ia32-libs g++-multilib libx11-dev libncurses5-dev uboot-mkimage
</pre>
'''Install Oracle JDK 6'''
 
#Download the latest JDK 6 installer from Oracle [http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html].&nbsp;
#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.
#Follow the following steps to install JDK 6
<pre>$ 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</pre>
{{Note|'''NOTE:'''<br/>
Android Jelly Bean (4.1.2) needs Oracle JDK 6.<br>The Hard Disk should have at least 30 GigaBytes of free space to complete the building of sources.<br>Please refer to the AOSP documentation for latest information and instructions for setting up other Ubuntu versions http://source.android.com/source/initializing.html|info}}
 
'''Install ''repo'' tool:'''
<pre>$&nbsp;mkdir ~/bin -p
$&nbsp;sudo apt-get install curl
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$&nbsp;chmod a+x ~/bin/repo
$&nbsp;export PATH=~/bin:$PATH
</pre>
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:
<pre>$ cd <your work directory>
$ mkdir -p 4AJ.2.2; cd 4AJ.2.2
$&nbsp;export YOUR_PATH=`pwd`
$&nbsp;mkdir -p mydroid; cd mydroid
$ export MYDROID=`pwd`
$&nbsp;repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b 27.x -m RLS4AJ.2.2_JellyBean.xml
$&nbsp;repo sync
</pre>
Download AFS patch from Variscite's FTP ('''/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.AFS.patch''') and apply it:
<pre>$ cat 4AJ.2.2.VAR.DART.R9.AFS.patch | patch -p1 -d device/ti/blaze/
$ cat DART_Amic_Route.patch | patch -p1 -d device/ti/common-open/
</pre>
Download Ducati binaries package from Variscite's FTP ('''/Software/Android/4AJ.2.2.VAR.DART.R9/ducati_full_blaze.tgz''') and integrate it:
<pre>$ cp ducati_full_blaze.tgz device/ti/proprietary-open/omap4/ducati_full_blaze.tgz</pre>
Download WiLink6 binaries package from Variscite's FTP ('''/Software/Android/4AJ.2.2.VAR.DART.R9/wlan.tgz''') and integrate it:
<pre>$ cp wlan.tgz device/ti/proprietary-open/wl12xx/wlan/wlan.tgz</pre>
<span style="line-height: 1.5em;">To obtain </span>'''Kernel & Driver Sources'''<span style="line-height: 1.5em;">follow:</span>
 
To clone kernel source from scratch do:
<pre>$&nbsp;cd ${YOUR_PATH}
$&nbsp;git clone git://git.omapzoom.org/kernel/omap.git kernel/android-3.0
$ cd kernel/android-3.0
$&nbsp;git checkout 1f21f8ed30c1d6abd029b67d17106042930a93d2</pre>
Download kernel patch from Variscite's FTP ('''/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.kernel.patch''') and apply it''':'''
<pre>$&nbsp;cat 4AJ.2.2.VAR.DART.R9.kernel.patch | patch -p1</pre>
<span style="line-height: 1.5em;">To obtain </span>'''U-Boot Sources'''<span style="line-height: 1.5em;">follow:</span>
<pre>$ cd ${YOUR_PATH}
$ git clone git://git.omapzoom.org/repo/u-boot.git u-boot
$&nbsp;cd u-boot
$&nbsp;git checkout 622fcfe5ae67e10598bdba8173c68717809518fc
</pre>
Download U-Boot patch from Variscite's FTP ('''/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.uboot.patch''') and apply it:
<pre>$&nbsp;cat 4AJ.2.2.VAR.DART.R9.uboot.patch | patch -p1 </pre>
<span style="line-height: 1.5em;">To obtain </span>'''X-loader Sources'''<span style="line-height: 1.5em;">follow:</span>
<pre>$ cd ${YOUR_PATH}
$&nbsp;git clone git://git.omapzoom.org/repo/x-loader.git x-loader
$&nbsp;cd x-loader
$&nbsp;git checkout dd88047040dce4a926a6ab80e207bc757f44d648
</pre>
Download X-loader patch from Variscite's FTP ('''/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.xloader.patch''') and apply it:
<pre>$ cat 4AJ.2.2.VAR.DART.R9.xloader.patch | patch -p1
</pre>
= 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):
<pre>$&nbsp;export YOUR_PATH=`pwd`
$&nbsp;export MYDROID=${YOUR_PATH}/mydroid
$&nbsp;export PATH=$PATH:${MYDROID}/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
$&nbsp;mkdir ${MYDROID}/logs
$&nbsp;export CROSS_COMPILE=arm-eabi-
$&nbsp;export PATH=${YOUR_PATH}/u-boot/tools:$PATH
</pre>
=== Building U-BOOT ===
<pre>$&nbsp;cd ${YOUR_PATH}/u-boot
$ make ARCH=arm distclean
$ make ARCH=arm omap4460dart_evm_config      # To build u-boot for DART EVM
$ 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
</pre>
=== Building X-LOADER ===
<pre>$ cd ${YOUR_PATH}/x-loader
$&nbsp;make distclean
$ make ARCH=arm omap4460dart_config
$&nbsp;make ARCH=arm ift 2>&1 |tee ${MYDROID}/logs/x-loader_make.out</pre>
=== Building Kernel ===
 
''Note: If you are building for a GP device it is recommended not to build the SMC kernel driver''.<br/>To create kernel uImage you need to add "mkimage" directory path to your "PATH" environment variable:
<pre>$&nbsp;cd ${YOUR_PATH}/kernel/android-3.0
$&nbsp;make ARCH=arm distclean
$&nbsp;make ARCH=arm dart_defconfig
$&nbsp;make ARCH=arm uImage 2>&1 |tee ${MYDROID}/logs/kernel_make.out
</pre>
=== Building Kernel modules ===
<pre>$&nbsp;make ARCH=arm modules 2>&1 |tee ${MYDROID}/logs/kernel_modules.out
</pre>
=== Building WLAN driver ===
<pre>$&nbsp;cd ${MYDROID}/hardware/ti/wlan/mac80211/compat_wl12xx
$&nbsp;export KERNEL_DIR=${YOUR_PATH}/kernel/android-3.0
$&nbsp;export KLIB=${KERNEL_DIR}
$ export KLIB_BUILD=${KERNEL_DIR}
$ make ARCH=arm 2>&1 |tee ${MYDROID}/logs/wlan_modules.out
</pre>
The above step will produce the following kernel WLAN modules: ''compat.ko'', ''cfg80211.ko'', ''mac80211.ko'', ''wl18xx.ko'' and ''wl18xx_sdio.ko''. These modules are pushed into the ''/system/lib/modules'' directory on the flashed image.
 
=== Building BTFM driver ===
<pre>$&nbsp;cd ${MYDROID}/hardware/ti/wpan/bluetooth-compat
$ export KERNEL_DIR=${YOUR_PATH}/kernel/android-3.0
$ export KLIB=${KERNEL_DIR}
$&nbsp;export KLIB_BUILD=${KERNEL_DIR}
$ make ARCH=arm 2>&1 |tee ${MYDROID}/logs/wlan_modules.out
</pre>
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)
<pre>$&nbsp;cd $MYDROID
$ source build/envsetup.sh
</pre>
Now setup platform:
<pre>$&nbsp;lunch full_blaze-userdebug
</pre>
And build Android AFS:
<pre>$ make clean&nbsp; #(required for clean rebuild only)
$ make 2>&1 | tee ${MYDROID}/logs/android_make.out
</pre>
=== Preparing Android binaries ===
 
Install external kernel modules that are required by the DART-4460 board.
<pre>$&nbsp;export BOARD_TYPE="blaze"
 
$&nbsp;cd ${MYDROID}/out/target/product/${BOARD_TYPE}
$ mkdir -p system/lib/modules
$&nbsp;find ${MYDROID}/hardware/ti/wlan/mac80211/compat_wl12xx -name \*.ko |while read f; do cp $f system/lib/modules/; done
$&nbsp;find ${MYDROID}/hardware/ti/wpan/bluetooth-compat -name \*.ko |while read f; do cp $f system/lib/modules/; done
</pre>
=== Preparing eMMC images ===
<pre>$&nbsp;cd ${YOUR_PATH}
$&nbsp;mkdir -p omap4_emmc_files_omap4dart&nbsp;; cd omap4_emmc_files_omap4dart
$&nbsp;cp -f ${MYDROID}/out/host/linux-x86/bin/fastboot .
$&nbsp;cp -f ${MYDROID}/out/host/linux-x86/bin/mkbootimg .
$&nbsp;cp -f ${MYDROID}/out/host/linux-x86/bin/simg2img .
$&nbsp;cp -f ${MYDROID}/out/host/linux-x86/bin/make_ext4fs .
$ cp -f ${YOUR_PATH}/kernel/android-3.0/arch/arm/boot/zImage .
 
  <<  For OMAP4 Dart Board >>
$&nbsp;cp -f ${YOUR_PATH}/x-loader/MLO Dart_Board_OMAP4460_GP_ES1.1_MLO
$&nbsp;cp -f ${YOUR_PATH}/u-boot/u-boot.bin Dart_Board_u-boot.bin
 
  <<  For OMAP4 Dart EVM >>
$ cp -f ${YOUR_PATH}/x-loader/MLO Dart_EVM_OMAP4460_GP_ES1.1_MLO
$ cp -f ${YOUR_PATH}/u-boot/u-boot.bin Dart_EVM_u-boot.bin
</pre>
'''Create img files:'''
<pre>$&nbsp;cd ${MYDROID}
$&nbsp;find out/target/product/${BOARD_TYPE} -name *.img -exec rm -f {} \; 
$&nbsp;make
$ cd ${YOUR_PATH}/omap4_emmc_files_omap4dart
$&nbsp;cp -f ${MYDROID}/out/target/product/${BOARD_TYPE}/*.img .
</pre>
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:
<pre>$&nbsp;./mkbootimg --kernel zImage --ramdisk ramdisk.img --base 0x80000000 --board omap4 --cmdline "<extra_bootargs>" -o boot.img
</pre>
For example to create '''boot.img''' with HDMI resolution of 1920x1080:
<pre>$ ./mkbootimg --kernel zImage --ramdisk ramdisk.img --base 0x80000000 --board omap4 --cmdline "omapdss.def_disp=hdmi omapdss.hdmi_options=1920x1080" -o boot.img
</pre>
'''Create cache partition:'''
<pre>$&nbsp;dd if=/dev/zero of=./cache.img bs=1048510 count=128
$&nbsp;mkfs.ext4 -F cache.img -L cache
</pre>
= Flashing the Android binaries on eMMC =
 
== Flash Android binaries using&nbsp;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.
<pre>$ cd ${YOUR_PATH}/omap4_emmc_files_omap4dart
$&nbsp;cp ${MYDROID}/device/ti/${BOARD_TYPE}/boot/fastboot.sh .
</pre>
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 ===
 
<span style="line-height: 1.5em;">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'''&nbsp;utility which boot Dart over USB&nbsp;OTG port.</span>
 
'''<u>Boot using external SD card:</u>'''
 
To boot using external SD card c<span style="line-height: 1.5em;">opy '''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.</span>
 
'''<u>Boot using usbboot utility:</u>'''
 
'''usbboot''' is a small utility that boot Dart over USB OTG port, it has embedded 1ndstage bootloader (MLO) and it takes '''u-boot.bin'''&nbsp;image file as parameter.
 
(pre-built binary and source code of '''usbboot'''&nbsp;utility can be obtained from Variscite's FTP)
 
To boot using '''usbboot,&nbsp;'''&nbsp;press and hold the bootselect button, power on the board and then&nbsp;connect the Dart USB&nbsp;OTG port to Linux machine.
 
Then from Linux shell type:
<pre>$ sudo ./usbboot u-boot.bin</pre>
<u>'''Flash eMMC'''</u>
 
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
 
== Flash Android binaries using Ubuntu SD image ==
 
As an easy and fast way to flash Android binaries on OMAP4 DART, Variscite provides a Ubuntu core SD card image with pre-built Android binaries.<br/>This SD card image includes a script (emmc-flasher.sh) that installs the boot images and root file-system.
 
'''Preparing rescue SD-Card'''
 
*Plug your SD card to your Linux machine, run dmesg and see what device is added (i.e. /dev/sd<span style="color: rgb(255, 0, 0);">'''X'''</span>)
*gunzip Ubuntu_12.04_core-DART-BOARD.VAR10_2.img.gz
*dd if=Ubuntu_12.04_core-DART-BOARD.VAR10_2.img of=/dev/sd<span style="color: rgb(255, 0, 0);">'''X'''</span> bs=128k
 
'''Recover Nand Flash'''
 
*Insert the SD card into the SD/MMC slot of the custom board.
*Boot from SD card.
*Login as root (password:password)
*From Linux command line, type:
<pre>$&nbsp;cd eMMC/Android/
$&nbsp;./emmc-flasher.sh [Dart_Board|Dart_EVM]</pre>

Revision as of 22:19, 13 May 2014

AJ.2.2.VAR.DART.R9 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 (/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.AFS.patch) and apply it:

$ cat 4AJ.2.2.VAR.DART.R9.AFS.patch | patch -p1 -d device/ti/blaze/
$ cat DART_Amic_Route.patch | patch -p1 -d device/ti/common-open/

Download Ducati binaries package from Variscite's FTP (/Software/Android/4AJ.2.2.VAR.DART.R9/ducati_full_blaze.tgz) and integrate it:

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

Download WiLink6 binaries package from Variscite's FTP (/Software/Android/4AJ.2.2.VAR.DART.R9/wlan.tgz) and integrate it:

$ 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 (/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.kernel.patch) and apply it:

$ cat 4AJ.2.2.VAR.DART.R9.kernel.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 (/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.uboot.patch) and apply it:

$ cat 4AJ.2.2.VAR.DART.R9.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 (/Software/Android/4AJ.2.2.VAR.DART.R9/4AJ.2.2.VAR.DART.R9.xloader.patch) and apply it:

$ cat 4AJ.2.2.VAR.DART.R9.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_evm_config      # To build u-boot for DART EVM
$ 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 WLAN driver

$ cd ${MYDROID}/hardware/ti/wlan/mac80211/compat_wl12xx
$ 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 WLAN modules: compat.ko, cfg80211.ko, mac80211.ko, wl18xx.ko and wl18xx_sdio.ko. These modules are pushed into the /system/lib/modules directory on the flashed image.

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

Install external kernel modules that are required by the DART-4460 board.

$ export BOARD_TYPE="blaze"

$ cd ${MYDROID}/out/target/product/${BOARD_TYPE}
$ mkdir -p system/lib/modules
$ find ${MYDROID}/hardware/ti/wlan/mac80211/compat_wl12xx -name \*.ko |while read f; do cp $f system/lib/modules/; done
$ find ${MYDROID}/hardware/ti/wpan/bluetooth-compat -name \*.ko |while read f; do cp $f system/lib/modules/; done

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 .

  <<  For OMAP4 Dart Board >>
$ 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

  <<  For OMAP4 Dart EVM >>
$ cp -f ${YOUR_PATH}/x-loader/MLO Dart_EVM_OMAP4460_GP_ES1.1_MLO
$ cp -f ${YOUR_PATH}/u-boot/u-boot.bin Dart_EVM_u-boot.bin

Create img files:

$ cd ${MYDROID}
$ find out/target/product/${BOARD_TYPE} -name *.img -exec rm -f {} \;  
$ make
$ 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:

$ ./mkbootimg --kernel zImage --ramdisk ramdisk.img --base 0x80000000 --board omap4 --cmdline "<extra_bootargs>" -o boot.img

For example to create boot.img with HDMI resolution of 1920x1080:

$ ./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

Flash Android binaries using Ubuntu SD image

As an easy and fast way to flash Android binaries on OMAP4 DART, Variscite provides a Ubuntu core SD card image with pre-built Android binaries.
This SD card image includes a script (emmc-flasher.sh) that installs the boot images and root file-system.

Preparing rescue SD-Card

  • Plug your SD card to your Linux machine, run dmesg and see what device is added (i.e. /dev/sdX)
  • gunzip Ubuntu_12.04_core-DART-BOARD.VAR10_2.img.gz
  • dd if=Ubuntu_12.04_core-DART-BOARD.VAR10_2.img of=/dev/sdX bs=128k

Recover Nand Flash

  • Insert the SD card into the SD/MMC slot of the custom board.
  • Boot from SD card.
  • Login as root (password:password)
  • From Linux command line, type:
$ cd eMMC/Android/
$ ./emmc-flasher.sh [Dart_Board|Dart_EVM]