Skip to content

Renesas-EMEV2/Renesas-device_emev

Repository files navigation

 Renesas EMEV Open Source Project (ROSP)

Discuss about it on : https://groups.google.com/forum/?fromgroups#!forum/renesas-emev-osp

-----------------------

1) Download full AOSP source code following the steps in:

 http://source.android.com/source/downloading.html

A customized version of the AOSP 2.3.6_r1 manifest can be found at:

 https://github.com/Renesas-EMEV2/Renesas-manifest

so, the "repo init" step should be made using this manifest:

 repo init -u https://github.com/Renesas-EMEV2/Renesas-manifest.git -b MyPad

In .repo/manifests/deafult.xml, customized projects are linked to the corresponding ffxx68 repositories, in place of the default Android ones.
The rest are pulled off the standard googlesource repositories, as usual in AOSP.

NOTE 1 - Downloading the full AOSP source may take hours to complete, even on a fast connection.

It's also useful to define an environment variable, to later refer to the AOSP work dir. 
E.g. I downloaded the AOSP source under my local home, in Android/aosp. Then I set:

 export AOSP=~/Android/aosp

-----------------------

2) Prepare the build environment

2.1) Install the mandatory packages

This is by far the less easy section o describe in general, as it may depend on the host system the build environment is based upon. Luckily, you need to fix this up only once (until you decide to migrate the project to a new host):

You need at least to install the AOSP prerequisite packages, as said in:

 http://source.android.com/source/initializing.html

but sometimes that's not enough. For example, a basic Ubuntu setup is normally missing the 'git' tool, which then needs to be installed with:

 sudo apt-get install git

2.2) Setting up JAVA 

We need JDK version 6 to build Gingerbread. The Open-JDK is installed with:

 sudo apt-get install openjdk-6-jdk
 
On the other hand, the suggested installation of Oracle JDK does not work!

If you have both Open-JDK and Oracle-JDK installed, you can choose which one to use executing:

 sudo update-alternatives --config java
 sudo update-alternatives --config javac
 sudo update-alternatives --config jar
 sudo update-alternatives --config javah
 sudo update-alternatives --config javadoc

and select the Open-JDK version for each of these, as a build using Oracle JDK failed to boot...

See also here:

 https://help.ubuntu.com/community/Java

2.3) Other missing stuff

Also, for an Ubuntu 12.04 host, even installing all the suggested packages, I got a couple of errors during make, so that I had to install these ones as well:

 sudo apt-get install lib32ncurses5-dev
 sudo apt-get install lib32z1-dev

I found these searching on Google for the error codes + "Ubuntu 12", so please try the same before asking...

To compile kernel images I also missed this:

 sudo apt-get install uboot-mkimage

-----------------------

3) Generating the Signing Keys for this project

I'm not sure about the aim of these steps are, or if they're actually required, but I did them following a tutorial I found about Android porting... (http://marakana.com/static/courseware/android/Remixing_Android/index.html):

 SIGNER="/C=IT/ST=RM/L=Rome/O=ffxx68/OU=Android/CN=Android Platform Signer/[email protected]"
 cd $AOSP
 rm build/target/product/security/*.p*
 echo | development/tools/make_key build/target/product/security/platform "$SIGNER"
 echo | development/tools/make_key build/target/product/security/shared "$SIGNER"
 echo | development/tools/make_key build/target/product/security/media "$SIGNER"
 echo | development/tools/make_key build/target/product/security/testkey "$SIGNER"

With these to verify that all went fine:
 
 ls -1 build/target/product/security/*.p*
 openssl x509 -noout -subject -issuer -in  build/target/product/security/platform.x509.pem

------------------------

4) Notes about projects

A number of customized "projects" make up our ROSP, e.g.

Project                              Path                  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renesas-device_emev           device/renesas/emev   
Renesas-hardware_emev         hardware/renesas/emev
Renesas-bionic                bionic
Renesas-frameworks_base       frameworks/base       
Renesas-build                 build
...

each implemented into a different repository, as per the standard AOSP approach.

I meant "Renesas-device_emev" to be the "entry point" to the ROSP, with the present README explaining the basic steps to build the firmware update package from scratch.

As "device/renesas/emev" and "hardware/renesas/emev" didn't exist in the AOSP, these were created from scratch and pushed on the ffxx68 GitHub account.

Others were forked from the corresponding android/platform_... the Gingerbread branch. 

The "frameworks/base" and "build" were modified only to allow compilation on Ubuntu 11.10 64-bit, after these suggestions:

 http://groups.google.com/group/android-building/browse_thread/thread/7b7d307c8038aab9
 http://code.google.com/p/android/issues/detail?id=20795

Each projects has a "MyPad" branch, to track ROSP changes.

The procedure I followed, for each project, was the following:

 - In GitHub, fork android/platform_<abc>, Gingerbread branch, to ffxx68
 - In GitHub, admin->rename ffxx68/platform_<abc> to ffxx68/Renesas-<abc>
 - cd <abc-path>
 - git branch MyPad
 - git checkout MyPad
 - Applied here whatever customization is needed for the Renesas EMEV
 - git remote add github [email protected]:ffxx68/Renesas-<abc>.git
 - git push -u github MyPad

-----------------------

5) How to push changes back to GitHub

Altough it is off topic to describe here how to use git, or GitHub in general (find docs online), if you change anything, to push it back onto our GitHub repository you would do:

 git add <whatever file you changed>
 git commit -m "Leave your commit comments here"
 git push -u github MyPad

This would require you to have an account registered on GitHub, where you may have forked the project to.

Find help oh GitHub, for admin and access details. E.g.

 http://help.github.com/send-pull-requests/

A "Renesas-EMEV2" Oragazization:

 https://github.com/organizations/Renesas-EMEV2

has been setup on GitHub, in order to allow collaborative development. Members taking part to this organization can "push" or "pull" commits on the various repositories.

Anyone interested in participating can use our ROSP Discussion Group on Google, to ask for membership:

 https://groups.google.com/forum/#!forum/renesas-emev-osp
 
Use the same group if you think anything in the whole process may be improved. Suggestions are always welcome!

-----------------------

6) First time build

If you've just downlaoded AOSP sources, you won't have adb, which is an out-product of the build. 

If you don't have adb you can't either build SGX or pull the OMF files (see below), hence you can't complete the build. So, first time you need to build skipping the OMF and SGX stuff.

You can do this renaming the makefiles:

 cd $AOSP/devive/renesas/emev
 mv omf/Android.mk omf/Android.mx
 mv sgx/Android.mk sgx/Android.mx

and build (see below). Then restore them after first build:

 mv omf/Android.mx omf/Android.mk
 mv sgx/Android.mx sgx/Android.mk

run pull_firmware.sh and build once again.

Another useful tip, for Ubuntu and Linux in general, in order to use 'adb' seamlessly with your device, is this:

 http://ptspts.blogspot.co.uk/2011/10/how-to-fix-adb-no-permissions-error-on.html

All of the above is (luckly) required only once, as these files aren't touched by the build procedure.

-----------------------

7) Building Android

Once you have your code, you would build Android with:

 cd $AOSP
 . build/envsetup.sh

including device/htc/passion/vendorsetup.sh
including device/renesas/emev/vendorsetup.sh
including device/samsung/crespo4g/vendorsetup.sh
including device/samsung/crespo/vendorsetup.sh

 lunch full_renesas_emev-eng

PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.6
TARGET_PRODUCT=full_renesas_emev
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GRK39F

 time make -j2 showcommands 2>&1 | tee make.log
...
(took about 1-1.5 hours to make, on my 2x2.4GHz, 4 Gb RAM Ubuntu)
...
Installed file list: out/target/product/emev/installed-files.txt

-----------------------

8) Getting OMX and SGX firmware blobs and libraries

The script

 $AOSP/device/renesas/emev/pull_firmware.sh

can be used to pull off the real device the firmware binaries and libraries managing:

 - the video encoder/decoder (OMX)
 - 3D-graphics accelerator (SGX)

These are released only as pre-compiled libraries, source code being proprietary.

The device must have a stock 2.3 Android on board (e.g. the "1220" build), to pull these files from, and should be running and connected through USB to your build host.

Try "adb shell" first, to verify if the connection works properly.

The script puts files in sgx/ and omf/ under $AOSP/device/renesas/emev. The Android build process then moves files under the expected target directories.

NOTE - The script assumes $AOSP is set with the path to aosp top dir.

-----------------------

9) Building SGX modules

To build the SGX modules (i.e. Power VR graphic acceleration handlers), follow instructions found in 

 $AOSP/device/renesas/emev/sgx/emev_sgx_km/compile.txt
 
Other propretary libraries are provided as a binary only. E.g.

-rw-r--r-- 1 ffxx68 ffxx68  14172 Nov 10  2011 gralloc.emxx.so
-rw-r--r-- 1 ffxx68 ffxx68   9224 Nov 10  2011 libEGL_POWERVR_SGX530_120.so
-rw-r--r-- 1 ffxx68 ffxx68 424448 Nov 10  2011 libGLESv1_CM_POWERVR_SGX530_120.so
(etc.)

These include gralloc.emxx.so, which is also built by our project, but wthout SGX support. The provided binary should include SGX support instead. *** UNDER TEST ***

NOTE - The procedure assumes Android is built already, as well as $AOSP and $KERNEL are set with your aosp and kernel home dirs respectively.

-----------------------

10) Packaging files

NOTE - Remeber to re-build Android after SGX and OMF files are completed, as expleined above.

Then, in order to wrap up the final build and prepar it for delivery to the device, the script

 $AOSP/device/renesas/emev/pack.sh

collects the complete Android file system, kernel image, device drivers, as well as bootloader binaries, and put them into:

 $AOSP/device/renesas/emev/pack

The content of this directory then needs to be transferred into the root folder of an SD-card, (max 2Gb size allowed) formatted as FAT16 or FAT32, and the tablet started with teh Vol+ & Power to replace internal NAND firmware.

The script assumes $AOSP and $KERNEL variables are set, pointing to the properly aosp and kernel of course. Our kernel source code is found at:

 https://github.com/ffxx68/RenesasEV2-BSPGB-Kernel

NOTE - Part of the firmware update binaries have been copied from a stock Livall upgrade package. As two variants of the Livall tablet board exists, with two or four DDR RAM chips, the corresponding bootloader variants are found in 2DDR and 4DDR subdirs. Use (try) the ones that fit your board, replacing them directly in the SD-card before performing the upgrade.

Alternatively, for quicker test cycles, you could follow the instructions to create a bootable SD-card, as explained in https://github.com/ffxx68/Renesas-BootSD.

-----------------------

11) About Google Apps

The AOSP source code comes naked of the most common Google Apps, fond in any tytpical device.

These include Market (now Play), GMail, Maps, etc.

Packages with these apps can be found on the net. E.g. see:

 http://wiki.rootzwiki.com/Google_Apps

The pack.sh script assumes that you have downloaded these separately into a directory named "GoogleApps" under $AOSP/device/renesas/emev

Note - this is NOT a mandatory step, to complete a working build.

-----------------------

12) The bootloader 

The internals of the bootloader and the corresponding source code is found at:

 https://github.com/ffxx68/RenesasEV2-bootloader

More info is found there, in README-Renesas. The code is meant for a develpment board and it isn't tested yet for being used in a real tablet, athough the differences should be minor. For the time being, a "stock" bootlader (from the tablet vendor) is being used for our tests, until the Open Sorce bootloader is ported and tested for tablets.


About

Repository to hold Renesas EMEV customizations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published