主题 : help -- mini2440 u-boot android-port 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 8349
精华: 0
发帖: 8
金钱: 75 两
威望: 36 点
贡献值: 0 点
综合积分: 16 分
注册时间: 2009-08-20
最后登录: 2010-10-03
楼主  发表于: 2009-08-27 16:02

 help -- mini2440 u-boot android-port

A newbie question on android-port to mini2440 64M:

Use this patch:
http://blogimg.chinaunix.net/blog/upfile2/090803104419.rar
Use compiler -- gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72)
Compiled successfully: zImage
Make a u-boot image:
mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000
-d ./zImage uImage
Write into nand offset 0x60000.
And boot it, will freeze on "done, booting the kernel."
What's the next I should do?

The output in qemu(same with mini2440 64M hardware):
==============================================
/mnt/src/mini2440/qemu/mini2440$ Starting in mini2440
mini2440/../arm-softmmu/qemu-system-arm -M mini2440 -drive
file=mini2440/mini2440_snapshots.img,snapshot=on -serial stdio -kernel
/tftpboot/uImage -mtdblock mini2440/mini2440_nand.bin -show-cursor
-usb -usbdevice
keyboard -usbdevice mouse -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 -
monitor
telnet::5555,server,nowait
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=57
QEMU: ee24c08_init
DM9000: INIT QEMU MAC : 52:54:00:12:34:56
QEMU mini2440_reset: loaded default u-boot from NAND
QEMU mini2440_reset: loaded override u-boot (size 38e00)
QEMU mini2440_reset: loaded /tftpboot/uImage (size 0)
S3C: CLK=240 HCLK=240 PCLK=240 UCLK=48
S3C: CLK=304 HCLK=304 PCLK=304 UCLK=48
S3C: CLK=304 HCLK=101 PCLK=50 UCLK=48
S3C: CLK=304 HCLK=76 PCLK=38 UCLK=48
S3C: CLK=304 HCLK=76 PCLK=38 UCLK=48
S3C: CLK=405 HCLK=101 PCLK=50 UCLK=48
U-Boot 1.3.2-mini2440 (Aug 20 2009 - 09:00:14)
I2C:   ready
DRAM:  64 MB
Flash:  2 MB
NAND:  Bad block table not found for chip 0
Bad block table not found for chip 0
64 MiB
Found Environment offset in OOB..
USB:   S3C2410 USB Deviced
In:    serial
Out:   serial
Err:   serial
MAC: 08:08:11:18:12:27
Hit any key to stop autoboot:  0
MINI2440 # s3c24xx speed get
FCLK = 405 MHz, HCLK = 101 MHz, PCLK = 50 MHz, UCLK = 48 MHz
MINI2440 # print
bootdelay=3
baudrate=115200
ethaddr=08:08:11:18:12:27
usbtty=cdc_acm
mtdparts=mtdparts=mini2440-nand:256k@0(u-boot),128k(env),5m(kernel),-
(root)
mini2440=mini2440=0tb
bootargs_base=console=ttySAC0,115200 noinitrd
bootargs_init=init=/sbin/init
root_nand=root=/dev/mtdblock3 rootfstype=jffs2
root_mmc=root=/dev/mmcblk0p2 rootdelay=2
root_nfs=/mnt/nfs
set_root_nfs=setenv root_nfs root=/dev/nfs rw nfsroot=${serverip}:$
{root_nfs}
ifconfig_static=run setenv ifconfig
ip=${ipaddr}:${serverip}::${netmask}:mini2440:eth0
ifconfig_dhcp=run setenv ifconfig ip=dhcp
ifconfig=ip=dhcp
set_bootargs_mmc=setenv bootargs ${bootargs_base} ${bootargs_init} $
{mini2440}
${root_mmc}
set_bootargs_nand=setenv bootargs ${bootargs_base} ${bootargs_init} $
{mini2440}
${root_nand}
set_bootargs_nfs=run set_root_nfs; setenv bootargs ${bootargs_base}
${bootargs_init}
${mini2440} ${root_nfs} ${ifconfig}
mtdids=nand0=mini2440-nand
bootcmd=run set_bootargs_nand;nboot.e kernel;bootm
bootargs=console=ttySAC0,115200 noinitrd init=/sbin/init mini2440=0tb
root=/dev/mtdblock3 rootfstype=jffs2
filesize=1D8E94
fileaddr=31000000
gatewayip=172.20.0.1
netmask=255.255.255.0
ipaddr=172.20.0.111
serverip=172.20.0.1
partition=nand0,0
mtddevnum=0
mtddevname=u-boot
Environment size: 1228/65532 bytes
MINI2440 # mtdparts
device nand0 <mini2440-nand>, # parts = 4
#: name                        size            offset
mask_flags
0: u-boot              0x00040000      0x00000000      0
1: env                 0x00020000      0x00040000      0
2: kernel              0x00500000      0x00060000      0
3: root                0x03aa0000      0x00560000      0
active partition: nand0,0 - (u-boot) 0x00040000 @ 0x00000000
defaults:
mtdids  : nand0=mini2440-nand
mtdparts: <NULL>
MINI2440 # boot
Loading from NAND 64MiB 3,3V 8-bit, offset 0x60000
  Image Name:
  Created:      2009-08-26   7:05:01 UTC
  Image Type:   ARM Linux Kernel Image (uncompressed)
  Data Size:    2357028 Bytes =  2.2 MB
  Load Address: 30008000
  Entry Point:  30008000
## Booting kernel from Legacy Image at 32000000 ...
  Image Name:
  Created:      2009-08-26   7:05:01 UTC
  Image Type:   ARM Linux Kernel Image (uncompressed)
  Data Size:    2357028 Bytes =  2.2 MB
  Load Address: 30008000
  Entry Point:  30008000
  Verifying Checksum ... OK
  Loading Kernel Image ... OK
OK
Starting kernel ...
Uncompressing
Linux...................................................................... ...........
........................................................................
done, booting the kernel.
==============================================
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-08-27 16:17
check MACH_TYPE your u-boot pass to kernel ...
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 64
精华: 0
发帖: 41
金钱: 395 两
威望: 143 点
贡献值: 0 点
综合积分: 82 分
注册时间: 2008-02-02
最后登录: 2015-12-31
2楼  发表于: 2009-08-27 16:50

 关于问题的问题

A newbie question on android-port to mini2440 64M:
------------------------------------------------------------------------------

newbie question翻译成中文是不是牛逼问题的意思?
级别: 新手上路
UID: 8349
精华: 0
发帖: 8
金钱: 75 两
威望: 36 点
贡献值: 0 点
综合积分: 16 分
注册时间: 2009-08-20
最后登录: 2010-10-03
3楼  发表于: 2009-08-27 17:24
谢谢kasim

> cat /mnt/src/mini2440/uboot/mini2440/include/asm-arm/mach-types.h | grep 2440
#define MACH_TYPE_S3C2440              362
#define MACH_TYPE_SMDK2440             1008
#ifdef CONFIG_ARCH_S3C2440
#  define machine_arch_type    MACH_TYPE_S3C2440
# define machine_is_s3c2440()    (machine_arch_type == MACH_TYPE_S3C2440)
# define machine_is_s3c2440()    (0)

> cat /mnt/src/mini2440/uboot/mini2440/board/mini2440/mini2440.c | grep MACH_TYPE
#ifndef MACH_TYPE_MINI2440
#define MACH_TYPE_MINI2440 1999
    gd->bd->bi_arch_number = MACH_TYPE_MINI2440;

> cat /mnt/src/myandroid/linux-2.6.25.8/arch/arm/tools/mach-types | grep 2440
s3c2440            ARCH_S3C2440        S3C2440            362
smdk2440        MACH_SMDK2440        SMDK2440        1008

这里如何debug?
是在哪里下断点?

---------------------------------------------------------------------
>newbie question翻译成中文是不是牛逼问题的意思?
倒...新手
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2009-08-27 17:44
倒...这么明显的问题不需要断点吧.
> cat /mnt/src/mini2440/uboot/mini2440/board/mini2440/mini2440.c | grep MACH_TYPE
#ifndef MACH_TYPE_MINI2440
#define MACH_TYPE_MINI2440 1999
    gd->bd->bi_arch_number = MACH_TYPE_MINI2440;

照这么看,U-Boot传给内核的MACH_TYPE是1999.

> cat /mnt/src/myandroid/linux-2.6.25.8/arch/arm/tools/mach-types | grep 2440
s3c2440            ARCH_S3C2440        S3C2440            362
smdk2440        MACH_SMDK2440        SMDK2440        1008

而内核里没有任何一个Machine用的是1999...
你觉得呢?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 8349
精华: 0
发帖: 8
金钱: 75 两
威望: 36 点
贡献值: 0 点
综合积分: 16 分
注册时间: 2009-08-20
最后登录: 2010-10-03
5楼  发表于: 2009-08-27 18:02
试过把kernel中mach-types 改成1999后就可以
谢谢

不过对于我这样的新手还是很郁闷
不知道是u-boot的问题还是kernel的问题

如果kernel只有uImage,没有source
能知道在哪里下断点就最好
有什么其他方法可以判断?请问

MINI2440 # bdinfo
arch_number = 0x000007CF
env_t       = 0x00000000
boot_params = 0x30000100
DRAM bank   = 0x00000000
-> start    = 0x30000000
-> size     = 0x04000000
ethaddr     = 08:08:11:18:12:27
ip_addr     = 172.20.0.111
baudrate    = 115200 bps

> cat kernel/arch/arm/tools/mach-types | grep 1999
s3c2440            ARCH_S3C2440        S3C2440            1999
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
6楼  发表于: 2009-08-27 23:21
对于open source的开发者来说,没有source的uImage是没有价值的。
对于gdb来说,没有symbol的执行档一样也是没有价值的。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 8349
精华: 0
发帖: 8
金钱: 75 两
威望: 36 点
贡献值: 0 点
综合积分: 16 分
注册时间: 2009-08-20
最后登录: 2010-10-03
7楼  发表于: 2009-08-28 10:06
引用第6楼kasim于2009-08-27 23:21发表的  :
对于open source的开发者来说,没有source的uImage是没有价值的。
对于gdb来说,没有symbol的执行档一样也是没有价值的。


Kasim
多谢指教