Report (2009/03/05)

(转载请说明出处,不得用于商业用途)

 (Linux forum id :hongjiujing)


Porting android on s3c6410
Environment: ubuntu 8.10
Board: XX6410
Kernel version: linux 2.6.24, android 1.0
1.Copy files
Create working location: /mydroid and copy the following files to this location:

Filename
Description
samsung-s3c6410-android.1.0.tar.bz2
Kernel
kandroid-1.1.2.1-20080530.glibc.gz
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-s3c6410-android.1.0.tar.bz2
kandroid-1.1.2.1-20080530.glibc.tgz   u-boot.bin
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-1.1.2.1-20080530.glibc.tgz
tommy@tommy-desktop:~/mydroid$ sudo mkdir -p /usr/local/arm
tommy@tommy-desktop:~/mydroid$ sudo mv kandroid-1.1.2.1-20080530.glibc /usr/local/arm
3.Compiling Kernel
Kernel source is compressed by the name of  ‘samsung-s3c6410-android.1.0.tar.bz2’. This is patched for s3c6410 so you don’t need to do this step. Extect this bz2 file by executing command. After extracting the kernel tarball file ‘samsung-s3c6410-android.1.0’

tommy@tommy-desktop:~/mydroid$ tar jxvf samsung-s3c6410-android.1.0.tar.bz2
tommy@tommy-desktop:~/mydroid$ cd samsung-s3c6410-android.1.0

Define the path of  toolchain for cross-compiling. Open file Makefile in this folder ( samsung-s3c6410-android.1.0 ). Go to line 197 and set:

CROSS_COMPILE   := /usr/local/arm/kandroid-1.1.2.1-20080530.glibc/bin/arm-android-linux-gnueabi-

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-s3c6410-android.1.0$ cp arch/arm/configs/smdk6410_android_nfs.config ./.config

Change default configurations by excuting ‘make menuconfig’

tommy@tommy-desktop:~/mydroid/samsung-s3c6410-android.1.0$ make menuconfig

please select ‘Boot options’, enter value for ‘Boot options’: boot from nfs file. Follow the below syntax :

root=/dev/nfs rw nfsroot=/ ,rsize=1024,wsize=1024 ip= :: :255.255.255.0::eth0:off init=/init console=ttySAC0,115200

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-s3c6410-android.1.0$ make zImage

.......
 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-s3c6410-android.1.0$ cp arch/arm/boot/zImage /TFTP
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 S3c6410 board is uploading u-boot.bin . This step is perfomed only 1 time. Because I don’t know how to uploading u-boot.bin on linux environment using USB cable so I move into WindowXP environment and uploading this file using DNW. Please see ‘XX6410 linux 2.6 Guide’ for more detail
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 COM Port as shown in figure
“UART/USB options”, enter the download address as 0x57e00000 and then click OK
button.





On the Serial Port menu, click Connect. Switch ON the reference board and then press
any key and then install the USB driver in DNW driver directory



Enter “0”, On the USB Port menu, click Transmit and the following window appears on
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 1.1.6 (Dec 16 2008 - 19:08:22) for XX6410                                                                                
                                                                                                                                
                                                                                                                                
CPU:     S3C6410@666MHz                                                                                                         
         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 2.6.24.back-21-26-lgs-android-g10351122-dirty (tommy@tommy-de9
CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387f     
Machine: SMDK6410                                                              
Ignoring unrecognised tag 0x00000000                                           
Memory policy: ECC disabled, Data cache writeback                              
CPU S3C6410 (id 0x36410101)                                                    
S3C6410: core 666.000 MHz, memory 133.000 MHz, peripheral 66.500 MHz           
S3C6410: EPLL 192.000 MHz                                                      
S3C64XX Clocks, (c) 2007 Samssung Electronics                                  
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 103c3, tcfg 00000400,00000000, usec 00001340         
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                                             
S3C6410 Power Management, (c) 2008 Samsung Electronics                         
s3c6410: Initialising architecture                                             
S3C DMA-pl080 Controller Driver, (c) 2006-2007 Samsung Electronics             
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 reno registered                                                            
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                                                    
S3C_LCD clock got enabled :: 133.000 Mhz                                       
LCD TYPE :: LTE480WV will be initialized                                       
Window[0] - FB1: map_video_memory: clear ff200000:00177000                     
            FB1: map_video_memory: dma=57a00000 cpu=ff200000 size=00177000     
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=57c00000 cpu=ff377000 size=00177000     
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       
s3c-uart.0: s3c_serial0 at MMIO 0x7f005000 (irq = 37) is a S3C                 
s3c-uart.1: s3c_serial1 at MMIO 0x7f005400 (irq = 38) is a S3C                 
s3c-uart.2: s3c_serial2 at MMIO 0x7f005800 (irq = 39) is a S3C                 
s3c-uart.3: s3c_serial3 at MMIO 0x7f005c00 (irq = 40) is a S3C                 
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize          
loop: module loaded                                                            
cs89x0:cs89x0_probe(0x0)                                                       
cs89x0.c: v2.4.3-pre1 Russell Nelson , Andrew Morton
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                       
S3C NAND Driver, (c) 2007 Samsung Electronics                                  
S3C NAND Driver is using hardware ECC.                                         
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                                               
s3c2410-ohci s3c2410-ohci: S3C OHCI                                            
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1       
s3c2410-ohci s3c2410-ohci: irq 47, io mem 0x74300000                           
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                                    
S3C Touchscreen driver, (c) 2008 Samsung Electronics                           
S3C TouchScreen got loaded successfully : 12 bits                              
input: S3C TouchScreen as /class/input/input0                                  
S3C24XX RTC, (c) 2004,2006 Simtec Electronics                                  
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling                             
s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0                      
i2c /dev entries driver                                                        
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics                            
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled        
[s3c_hsmmc_probe]: s3c-hsmmc.0: at 0xc9000000 with irq 56. clk src: sclk_DOUTmp0
[s3c_hsmmc_probe]: s3c-hsmmc.1: at 0xc9200000 with irq 57. clk src: sclk_DOUTmp1
[s3c_hsmmc_probe]: s3c-hsmmc.2: at 0xc9400000 with irq 49. clk src: sclk_DOUTmp2
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 1.0.15 (Tue Nov 20 19:16:42 20.
ASoC version 0.13.1                                                            
WM9713/WM9714 SoC Audio Codec 0.12                                             
asoc: AC97 HiFi <-> s3c64xx-ac97 mapping ok                                    
ALSA device list:                                                              
  #0: SMDK6400 (WM9713)                                                        
TCP cubic registered                                                           
NET: Registered protocol family 1                                              
RPC: Registered udp transport module.                                          
RPC: Registered tcp transport module.                                          
s3c2410-rtc s3c2410-rtc: setting system clock to 2000-01-04 23:42:11 UTC (94702)
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 port of RPC 100003/2 on 192.168.11.2                                
Looking up port of RPC 100005/1 on 192.168.11.2                                
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

更多相关文章

  1. android内存溢出处理方式之一
  2. Android:Activity中onCreate方法的参数及用途
  3. Android elevation 用途
  4. Android文件系统的结构及目录用途、操作方法
  5. Android 调试桥(adb)是多种用途的工具,该工具可以帮助你你管理设
  6. Android Inflate()方法用途

随机推荐

  1. Android SDK中的自动化测试
  2. Android_4.4环境搭建及程序结构
  3. Error retrieving parent for item: No r
  4. 2012-01-13面试题
  5. android sqlite语句
  6. android 直接进行数据库操作
  7. 学习日记android为menu添加button和事件
  8. network: Android(安卓)网络判断(wifi、3G
  9. Android TTS学习——用五种外语说出“我
  10. android计算器原创【安卓进化三】