Install Android Graphics SGX SDK

NOTE: By default SGX is tested with kernel 2.6.32. With kenerl 2.6.29, there will be errors: omap_3630_cpu not defined. To get kernel 2.16.32 working with DVSDK, follow instructions on http://tw.myblog.yahoo.com/stevegigijoe/article?mid=230&prev=-1&next=227

1. Checkout SGX code:

    git clone git://gitorious.org/rowboat/ti_android_sgx_sdk.git

2. Install ./OMAP35x_Android_Graphics_SDK_setuplinux_3_01_00_03.bin

3. Edit Rules.make to configure the SGX source build:

################# FIELDS MODIFIABLE BY THE USER ###############################
#set home area HOME (relative location for all SDK operations)
#HOME=INVALIDVAL
HOME=/home/rhuang/rowboat-android-eclair
#Current Directory where Graphics SDK is installed
GRAPHICS_INSTALL_DIR=$(HOME)/OMAP35x_Android_Graphics_SDK_3_01_00_03
#Android Specific
#Path of Android Root FS
#ANDROID_ROOT=$(HOME)/INVALIDVAL
ANDROID_ROOT=$(HOME)/out/target/product/beagleboard/root
#set toolchain root path for arm-eabi
#CSTOOL_DIR=INVALIDVAL
CSTOOL_DIR=/home/rhuang/rowboat-android-eclair/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/

CSTOOL_PREFIX=arm-eabi-
CSTOOL_PATH=$(CSTOOL_DIR)/bin
CSTOOL_LIBSTDC++_PATH=$(CSTOOL_DIR)/arm-none-linux-gnueabi/libc/usr/lib

#set the kernel installation path
#KERNEL_INSTALL_DIR=$(HOME)/INVALIDVAL
KERNEL_INSTALL_DIR=/home/rhuang/rowboat-android-eclair/kernel
TARGETFS_INSTALL_DIR=$(ANDROID_ROOT)

GFX_TARGETFS_KERMOD_PATH=$(TARGETFS_INSTALL_DIR)/lib/modules/2.6.32

#Android
ANDROID_DISCIMAGE=$(TARGETFS_INSTALL_DIR)/
#################################################################################

4. Comiple Kernel if not compiled yet
    cd ~/rowboat-eclair
    export PATH=${PWD}/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin:$PATH
    cd kernel
    make ARCH=arm omap3_beagle_android_defconfig
    make ARCH=arm CROSS_COMPILE=arm-eabi- uImage -j2

5. Compile SGX
    cd ~/rowboat-android-eclair/OMAP35x_Android_Graphics_SDK_3_01_00_03
    make

6. Install
    make install OMAPES=3.x   

7.
$ vim android_rootfs/init.rc

Just above the comment

# adbd is controlled by the persist.service.adb.enable system property

Add below two lines

# Start PowerVR SGX DDK
service pvr /system/bin/sgx/rc.pvr start

Trouble Shooting:
1) Unable to handle kernel NULL pointer dereference at virtual address 00000014
Serial Output:

input: DELL DELL USB Keyboard as /devices/platform/ehci-omap.0/usb2/2-2/2-2.1/2-2.1:1.0/input/input1
generic-usb 0003:413C:2005.0001: input: USB HID v1.10 Keyboard [DELL DELL USB Keyboard] on usb-ehci-omap.0-2.1/input0
usb 2-2.3: new low speed USB device using ehci-omap and address 4
input: Microsoft Microsoft 3-Button Mouse with IntelliEye(TM) as /devices/platform/ehci-omap.0/usb2/2-2/2-2.3/2-2.3:1.0/input/input2
generic-usb 0003:045E:0040.0002: input: USB HID v1.10 Mouse [Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)] on usb-ehci-omap.0-2.3/input0
usb 2-2.4: new high speed USB device using ehci-omap and address 5
Unable to handle kernel NULL pointer dereference at virtual address 00000014
pgd = c0004000
[00000014] *pgd=00000000
Internal error: Oops: 5 [#1]
last sysfs file:
Modules linked in:
CPU: 0    Not tainted  (2.6.32 #3)
PC is at musb_interrupt+0xa94/0xc40
LR is at musb_interrupt+0xa80/0xc40
pc : [<c0212748>]    lr : [<c0212734>]    psr: 60000193
sp : c045ff00  ip : 00000002  fp : 00000000
r10: 00000000  r9 : 000000f0  r8 : 00000001
r7 : 00000009  r6 : 00000099  r5 : 00000000  r4 : cf82b0e8
r3 : 00000000  r2 : 0000007b  r1 : cf82b0e8  r0 : cf82b0e8
Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c5387d  Table: 80004019  DAC: 00000017

Reason:  The crashes are generally caused by the usb port not giving enough power. Use 5V power supply instead.

Reference Links:
http://groups.google.com/group/rowboat/browse_thread/thread/fbf5076ac921c4d3/4deda3003da9a4a8?lnk=gst&q=sgx#4deda3003da9a4a8
http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/37855.aspx