Compile Android from source

Content

  1. Hardware support (HSG X5A)
  2. Preparing enviroment
  3. How to compile
  4. FWDN V7
  5. Serial output

1. Hardware support (HSG X5A)

Great X5A hardware page: http://aschillings.co.uk/html/x5a_hardware.html.

kernel/drivers/char/tca_backlight.c

//  A7 : LCD_bl_en ,  D22 : LCD_RST,   C28:LCD_DISP ,  extension: LCD_PWRCTL
#define LCD_PROT_INT()          BITCSET(HwGPIOA->GPEN, Hw7, Hw7);       \
                                BITCSET(HwGPIOD->GPEN, Hw22, Hw22); \
                                BITCSET(HwGPIOC->GPEN, Hw28 , Hw28); \
                                BITCSET(HwGPIOA->GPDAT, Hw7, 0);  \
                                BITCSET(HwGPIOD->GPDAT, Hw22, 0); \
                                BITCSET(HwGPIOC->GPDAT, Hw28 , 0);

#define LCD_POWER_ON()          Power_OnOff(1)
#define LCD_POWER_OFF()         Power_OnOff(0)
#define LCD_DISPLAYON()         BITCSET(HwGPIOC->GPDAT, Hw28 ,Hw28)
#define LCD_DISPLAYOFF()        BITCSET(HwGPIOC->GPDAT, Hw28, 0)
#define LCD_RESET_H()           BITCSET(HwGPIOD->GPDAT, Hw22 ,Hw22)
#define LCD_RESET_L()           BITCSET(HwGPIOD->GPDAT, Hw22, 0)

2. Preparing enviroment

I'm using Ubuntu 10.10 32-bit. Copy armv6_codesourcery.tar.bz2 to /opt/ directory
tar -jxvf armv6_codesourcery.tar.bz2
export PATH=/opt/armv6/codesourcery/bin:$PATH
Check version
arm-none-linux-gnueabi-gcc -v
Install other needed tools
sudo apt-get install libncurses5-dev libqt3-mt-dev qt3-dev-tools g++ flex bison gperf
Remove Java 6
sudo apt-get remove openjdk-6-jre
Install Java 5 (it is needed for Android 2.1)
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu dapper main multiverse"
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu dapper-updates main multiverse"
sudo apt-get update
sudo apt-get install sun-java5-jdk

3. How to compile

I recommend to create ~/mydroid/android/ folder and place the BSP files there.
ls -l ~/mydroid/android
First prepare & compile kernel
cd ~/mydroid/android/kernel
make tcc8900_defconfig
make menuconfig
make
Go back to android directory
cd ~/mydroid/android
lunch 27
Now its time to compile bootloader (lk.rom)
cd ~/mydroid/android/bootable/bootloader/lk
rm build-tcc*
make tcc8900_evm
Finally, go to build final images
cd ~/mydroid/android/
make

Now make a tea or coffee :) Correction: after you return with tea/coffee go for a walk...

Creating tcc8900_mtd.img
mkmtdimg --boot out/target/product/tcc8900/boot.img --system out/target/product/tcc8900/system.img --recovery out/target/product/tcc8900/recovery.img --output tcc8900_mtd.img

4. FWDN V7

To download images to the device use FWDN V7, older V6 is not supported anymore.

FWDN_V7

5. Serial output

TBD