by EmbedSky on Thu Oct 22, 2009 2:57 pm
How to Port Android to TQ2440?
A. Status
1. Android can run on TQ2440 using NFS
B. Remaining Issues
1. Touchscreen not calibrated
2.The clock of Android stops, kills zygote process, after system reboot, clock will update, but will stop again.
C. Porting steps
AA. Port Android Kernel to TQ2440
1. Download linux-2.6.25-android-1.0_r1.tar.gz from http://code.google.com/p/android/downloads/list.
The URL is http://android.googlecode.com/files/lin ... _r1.tar.gz
2. Unzip kernel to an user directory, such as /root/kernel.git.
3. Enter kernel.git directory, such as cd ~/kernel.git/
4. Change nand flash partition setting in arch/arm/plat-s3c24xx/common-smdk.c, such as gedit arch/arm/plat-s3c24xx/common-smdk.c
Modify the structure static struct mtd_partition smdk_default_nand_part[] as:
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "TQ2440_uboot",
.size = 0x00040000,
.offset = 0x00000000,
},
[1] = {
.name = "TQ2440_kernel",
.offset = 0x0004C000,
.size = 0x00200000,
},
[2] = {
.name = "TQ2440_yaffs2",
.offset = 0x0024C000,
.size = 0x03DB0000,
}
};
5. Download IA32 GNU/Linux TAR from http://www.codesourcery.com/gnu_toolcha... release644.
6. Unzip files to an user directory as /usr/local/arm/arm-2008q3
7. Enter directory arm-2008q3/bin, as cd ~/arm-2008q3/bin/
8. Add current path to the environment variable, such as export PATH=$PWD:$PATH, or modify ~/.bashrc, and login again.
9. Enter into kernel directory, as, cd ~/kernel.git/
10. Modify Makefile, as, gedit Makefile
Change ARCH and CROSS_COMPILE
#ARCH ?= $(SUBARCH)
ARCH ?= arm
#CROSS_COMPILE ?= arm-eabi-
CROSS_COMPILE ?= arm-none-gnueabi-
11. Use make s3c2410_defconfig, default setting 2410 kernel.
12. Run make menuconfig
12.1 Make sure the content in System Type ---> ARM system type () are: Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443
12.2 Make sure System Type ---> S3C2410 Machines ---> SMDK2410/A9M2410 is checked.
12.3 Un-check the contents related to Goldfish.
Device Drivers ---> Character devices ---> < > Goldfish TTY Driver
Device Drivers ---> Power supply class support ---> < > Goldfish battery driver (NEW)
Device Drivers ---> Real Time Clock ---> < > GOLDFISH (NEW)
Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> < > Goldfish Framebuffer
12.4 Select the contents related to S3C2410 LCD
Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> <*> S3C2410 LCD framebuffer support
Device Drivers ---> Graphics support --->
Bootup logo ---> Standard black and white Linux logo
Device Drivers ---> Graphics support ---> Bootup logo ---> Standard 16-color Linux logo
Device Drivers ---> Graphics support ---> Bootup logo ---> Standard 224-color Linux logo
12.5 Select the must-have for Android kernel
Kernel Features ---> Use the ARM EABI to compile the kernel
General setup ---> Use full shmem filesystem
General setup ---> Enable Android's Shared Memory Subsystem
System Type ---> Support Thumb user binaries
Device Drivers ---> Android ---> Android log driver
Device Drivers ---> Android ---> <*> Binder IPC Driver
12.6 Try to select the options of Android kernel as many as possible
Device Drivers ---> Android ---> RAM buffer console
Device Drivers ---> Android ---> Android timed gpio driver
Device Drivers ---> Android ---> Only allow certain groups to create sockets
12.7 Other CONFIG options, if the system supports, please select:
CONFIG_ANDROID_POWER =y
CONFIG_ANDROID_POWER_STAT =y
CONFIG_ANDROID_POWER_ALARM =y
(We can also find ANDROID_POWER etc in Kconfig file and do selection there, or to directly change .config file)
13. Exit and save .config
BB. Port LCD driver to Linux-2.6.25 kernel
CC. Port touchscreen driver to Linux-2.6.25 kernel
Line 256:
ts.dev->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS);
ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT(BTN_TOUCH);
Changed to :
ts.dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
DD. Port Ethernet driver to Linux-2.6.25 kernel
EE. Make Android file system that supporting ARMv4
1、Download Android file system for ARMv4, which is S3C2440. Download ARMv4 file system
2. Add null and console device nodes under /dev.
mknod -m 660 null c 1 3
mknod -m 660 console c 5 1
3. Change the booting parameter init to /init in U-boot. The complete command lines are as follows:
a. Power on and press SPACE button
b. Select [0] Set the boot parameters
c. [1] Set NFS boot parameter
d. input 192.168.1.3 (this is your PC's ip), and press enter
e. input 192.168.1.6 (this is TQ2440's IP), and press enter, enter 255.255.255.0
f. Select [3], Set parameter, This is very important, enter bootargs, and enter return, input: console=ttySAC0 root=/dev/nfs init=/init nfsroot=192.168.1.3:/opt/EmbedSky/root_nfs ip=192.168.1.6:192.168.1.3:192.168.1.6:255.255.255.0:tq2440.5d6d.com:eth0:off
g, save and power cycle
Note: TQ2440's kernel looks like has some nfs booting issue.
/opt/EmbedSky/root_nfs is the nfs directory.
4. change /init.rc file, remove all other mount command except mount tmpfs tmpfs /sqlite_stmt_journals size=4m
So you can see the big clock.
First time booting will create files, TQ2440 will take about 2 minutes, and after that, it will take about 1 minute for booting.
Now, android can run. As the file system is too big, and the image is 70MB, TQ2440 has only 64MB RAM, so can only use nfs.