分类: 嵌入式
2010-10-19 12:02:40
Porting android on s
Environment: ubuntu 8.10
Board: XX6410
Kernel version: linux
1.Copy files
Create working location: /mydroid and copy the following files to this location:
Filename
Description
samsung-s
Kernel
kandroid-
libiconv-1.12.tar.gz
Toolchain
090227-android-cupcake-rootfs.tar.bz2
Cupcake root file system
u-boot.bin
DNW
Bootloader
Below is the list of files:
tommy@tommy-desktop:~$ mkdir mydroid
tommy@tommy-desktop:~$ cd mydroid
tommy@tommy-desktop:~/mydroid$ ls
090227-android-cupcake-rootfs.tar.gz libiconv-1.12.tar.gz
DNW samsung-s
kandroid-
2.Installing Toolchain
Please follow the commands below and install the tool chain in the directory mentioned below:
installing libiconv
tommy@tommy-desktop:~$ cd mydroid
tommy@tommy-desktop:~/mydroid$ tar xvf libiconv-1.12.tar.gz
tommy@tommy-desktop:~/mydroid$ cd libiconv-1.12
tommy@tommy-desktop:~/mydroid/libiconv-1.12$ ./configure --prefix=/usr/local
tommy@tommy-desktop:~/mydroid/libiconv-1.12$ make install
tommy@tommy-desktop:~/mydroid/libiconv-1.12$ vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
tommy@tommy-desktop:~/mydroid/libiconv-1.12$ ldconfig
installing toolchain
tommy@tommy-desktop:~$ cd ~/mydroid
tommy@tommy-desktop:~/mydroid$ tar xvf kandroid-
tommy@tommy-desktop:~/mydroid$ sudo mkdir -p /usr/local/arm
tommy@tommy-desktop:~/mydroid$ sudo mv kandroid-
3.Compiling Kernel
Kernel source is compressed by the name of ‘samsung-s
tommy@tommy-desktop:~/mydroid$ tar jxvf samsung-s
tommy@tommy-desktop:~/mydroid$ cd samsung-s
Define the path of toolchain for cross-compiling. Open file Makefile in this folder ( samsung-s
CROSS_COMPILE := /usr/local/arm/kandroid-
Set the configuration values for the kernel. At first, copy the default configuration files which is located in arch/arm/configs/ to be the configuration file.
tommy@tommy-desktop:~/mydroid/samsung-s
Change default configurations by excuting ‘make menuconfig’
tommy@tommy-desktop:~/mydroid/samsung-s
please select ‘Boot options’, enter value for ‘Boot options’: boot from nfs file. Follow the below syntax :
root=/dev/nfs rw nfsroot=
Please change ip config to suite your PC’s configuration
My values:
root=/dev/nfs rw nfsroot=192.168.11.2:/nfsroot/090227-Android-cupcake-rootfs,rsize=1024,wsize=1024 ip=192.168.11.3:192.168.11.2:192.168.11.2:255.255.255.0::eth0:off init=/init console=ttySAC0,115200s
Please select 'Power management' , set 'Power_Suspend=y'
Finally, make the kernel image file by executing:’make zImage’,copy the image to the tftp root folder.
tommy@tommy-desktop:~/mydroid/samsung-s
.......
LD vmlinux
SYSMAP System.map
SYSMAP .tmp_System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
AS arch/arm/boot/compressed/head.o
GZIP arch/arm/boot/compressed/piggy.gz
AS arch/arm/boot/compressed/piggy.o
CC arch/arm/boot/compressed/misc.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
tommy@tommy-desktop:~/mydroid/samsung-s
4.install nfs server and copy root file system
Please follow the below commands to install nfs server and copy cupcake root file system into the nfs server’s root folder
tommy@tommy-desktop:~$ cd ~/mydroid
tommy@tommy-desktop:~/mydroid$ tar xvf 090227-android-cupcake-rootfs.tar.gz
tommy@tommy-desktop:~/mydroid$ sudo apt-get install nfs-kernel-server portmap
tommy@tommy-desktop:~/mydroid$ sudo mkdir /nfsroot
tommy@tommy-desktop:~/mydroid$ sudo mv 090227-Android-cupcake-rootfs /nfsroot
tommy@tommy-desktop:~/mydroid$ sudo vim /etc/exports
insert:
/nfsroot/090227-android-cupcake-rootfs *(rw,no_root_squash,no_all_squash)
tommy@tommy-desktop:~/mydroid$ sudo /etc/init.d/nfs-kernel-server restart
5.Porting Android
The first step to port android on S
a.Uploading ‘u-boot.bin’ using USB 2.0 Cable on WindowXP environment
Please copy 2 file: u-boot.bin, tftpserver-setup and DNW folder to Windowxp environment.
Step 1: Installing tftpserver
Step 2: Copy file u-boot.bin into tftp root folder.
Step 3: Change NOR Flash Boot Mode:
Step 4: Run dnw.exe in DNW folder.
On the Configuration menu, click Options to set the UART/USB options. The following
window appears on your screen. Select Baud Rate and
“UART/USB options”, enter the download address as 0x57e00000 and then click OK
button.
On the
any key and then install the USB driver in DNW driver directory
Enter “
your screen. Select u-boot.bin file and then
click Open button.
As soon as u-boot.bin download is over, the following messages appear in the DNW
window. Please hit the SPACE BAR key to view the current Ethernet Boot Loader
Configuration. Configure the Ethernet Boot loader as follows by entering the respective
options.
Setting IP address: set your ip address as serverip and a ramdom ip for the board
TFTP Server IP : setenv serverip 192.168.0.232
Device PC IP : setenv ipaddr 192.168.0.236
For erasing Bad blocks in NAND : nand scrub
Input ‘Y’ directly hit ‘Enter’
tftp c0000000 u-boot.bin
nand erase 0 40000
nand write c0000000 0 40000
Please reboot After Setting NAND of Boot Mode
Now, u-boot.bin is uploaded on the board. You don’t need perform this step more. Restart PC and come back liux environment. Now, our working environment is only Linux.
b.Uploading kernel image using Minicom on Linux
If your system has not minicom , please install Mincom using apt-get.
tommy@tommy-desktop:~$ minicom -s : Execute minicom on setting mode
Please select ‘Serial port setup’ and set configuration as below:
Restart minicom, then restart the board and hit SPACE BAR immediately. On Mincom screen:
U-Boot
CPU: S
Fclk = 666MHz, Hclk = 133MHz, Pclk = 66MHz, Serial = CLKUART (ASYNC Mode)
Board: SMDK6410
DRAM: 128 MB
Flash: 0 kB
NAND: 128 MB
In: serial
Out: serial
Err: serial
Net: Found CS8900@0x18800300
Hit any key to stop autoboot: 0
MV6410 #
Set environment variables for the board
XX6410 # setenv serverip 192.168.11.2
XX6410 # setenv ipaddr 192.168.11.3
XX6410 # setenv bootargs root=/dev/nfs rw nfsroot=192.168.11.2: /nfsroot/090227-Android-cupcake-rootfs,rsize=1024,wsize=1024 ip=192.168.11.3:192.168.11.2:192.168.11.2:255.255.255.0::eth0:off init=/init console=ttySAC0,115200N81
XX6410 # saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Download image kernel from tftp server into DRAM
XX6410 # tftp c0008000 zImage
XX6410 # tftp c0008000 zImage
TFTP from server 192.168.11.2; our IP address is 192.168.11.3
Filename 'zImage'.
Load address: 0xc0008000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
######
done
Bytes transferred = 2027440 (1eefb0 hex)
Boot from DRAM(only for testing)
MV6410 # bootm
Boot with zImage
Starting kernel ...
Uncompressing Linux.............................................................
Linux version
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=
Machine: SMDK6410
Ignoring unrecognised tag 0x00000000
Memory policy: ECC disabled, Data cache writeback
CPU S
S
S
S
CPU0: D VIPT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: root=/dev/nfs rw nfsroot=192.168.11.2:/nfsroot/090227-Andr1
Trying to install chained interrupt handler for IRQ0
Trying to install chained interrupt handler for IRQ1
Trying to install chained interrupt handler for IRQ32
Trying to install chained interrupt handler for IRQ33
PID hash table entries: 512 (order: 9, 2048 bytes)
timer tcon=00600000, tcnt
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 125312KB available (3412K code, 530K data, 508K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 64 bytes
android_power_init
android_power_init done
NET: Registered protocol family 16
S
s
S
Total 32 DMA channels will be initialized.
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP
NetWinder Floating Point Emulator V0.97 (double precision)
ashmem: initialized
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
yaffs May 4 2009 21:03:15 Installing.
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
S
LCD TYPE :: LTE480WV will be initialized
Window[0] - FB1: map_video_memory: clear ff200000:00177000
FB1: map_video_memory: dma=
Window[0] - FB2: map_video_memory: clear ff2bb800:000bb800
FB2: map_video_memory: dma=57abb800 cpu=ff2bb800 size=000bb800
Console: switching to colour frame buffer device 100x30
fb0: s3cfb frame buffer device
Window[1] - FB1: map_video_memory: clear ff377000:00177000
FB1: map_video_memory: dma=
Window[1] - FB2: map_video_memory: clear ff432800:000bb800
FB2: map_video_memory: dma=57cbb800 cpu=ff432800 size=000bb800
fb1: s3cfb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s
s
s
s
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: module loaded
cs89x0:cs89x0_probe(0x0)
cs89x0.c: v
eth0: cs8900 rev J found at 0xf7600300
cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command le
cs89x0 media RJ-45, IRQ 74, programmed I/O, MAC 00:09:c0:ff:ec:48
cs89x0_probe1() successful
Invalid chip endian 0x080
smc911x: not found (-19).
Driver 'sd' needs updating - please use bus_type methods
S
S
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-b)
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000-0x00040000 : "Bootloader"
0x00040000-0x00400000 : "Kernel"
0x00400000-0x03400000 : "Root - Cramfs"
0x03400000-0x08000000 : "File System"
usbmon: debugfs is not available
s
s
s
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
S
S
input: S
S
s
s
i
S
s
[s
[s
[s
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
logger: created 64K log 'log_main'
logger: created 64K log 'log_events'
logger: created 64K log 'log_radio'
Advanced Linux Sound Architecture Driver Version
ASoC version
WM9713/WM9714 SoC Audio Codec 0.12
asoc: AC97 HiFi <-> s
ALSA device list:
#0: SMDK6400 (WM9713)
TCP cubic registered
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
s
eth0: using half-duplex 10Base-T (RJ-45)
IP-Config: Complete:
device=eth0, addr=192.168.11.3, mask=255.255.255.0, gw=192.168.11.2,
host=192.168.11.3, domain=, nis-domain=(none),
bootserver=192.168.11.2, rootserver=192.168.11.2, rootpath=
Looking up
Looking up
VFS: Mounted root (nfs filesystem).
Freeing init memory: 508K
Warning: unable to open an initial console.
init: cannot open '/initlogo.rle'
init: cannot find '/system/bin/playmp3', disabling 'bootsound'
sh: can't access tty; job control turned off
# tsdev (compaq touchscreen emulation) is scheduled for removal.
See Documentation/feature-removal-schedule.txt for details.
android_power_suspend: 117110645000
android sleep state 0->2 at 117110645000
active wake lock
PowerManagerService
android_power_suspend: enter suspend
Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.00 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
Suspending console(s)
The system hangs at here